From: <pat...@us...> - 2009-08-06 14:02:48
|
Revision: 914 http://cishell.svn.sourceforge.net/cishell/?rev=914&view=rev Author: pataphil Date: 2009-08-06 14:02:35 +0000 (Thu, 06 Aug 2009) Log Message: ----------- * Overhauled Static Executable Wizard. * There are still a few minor things to touch up on it. * NOT REVIEWED. Modified Paths: -------------- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/AttributeDefinitionEditor.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ListBuilder.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ParameterBuilderDelegate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ParameterListBuilder.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/BasicTemplate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/dataset/NewDatasetTemplate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/java/NewJavaAlgorithmTemplate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/java/NewJavaAlgorithmWizard.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/jython/NewJythonAlgorithmTemplate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmWizard.java trunk/templates/org.cishell.templates.wizards/templates_3.0/java_algorithm/java/$algClass$.java trunk/templates/org.cishell.templates.wizards/templates_3.0/java_algorithm/java/$algClass$Factory.java trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/config.properties trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/service.properties trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/gui.xml trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/manifest.properties Added Paths: ----------- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputDataProvider.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputParameterProvider.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOption.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOptionProvider.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SetupPlatformsPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseExecutableFilesPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyTemplateStringPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItem.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItemEditor.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItem.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItemEditor.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableInputDataDelegate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/utilities/ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/utilities/MultiHashMapWithCounts.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseExecutableFileWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseFileWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseRelatedFilesWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupHeaderWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ResizeCompositeHackWidget.java trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/linux.x86_64/ trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/macosx.ppc/ trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/macosx.x86/ trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/solaris.sparc/ trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/win32/ Removed Paths: ------------- trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/linux.x86/SampleAlg Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/AttributeDefinitionEditor.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/AttributeDefinitionEditor.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/AttributeDefinitionEditor.java 2009-08-06 14:02:35 UTC (rev 914) @@ -1,16 +1,3 @@ -/* **************************************************************************** - * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Apache License v2.0 which accompanies - * this distribution, and is available at: - * http://www.apache.org/licenses/LICENSE-2.0.html - * - * Created on Aug 16, 2006 at Indiana University. - * - * Contributors: - * Indiana University - - * ***************************************************************************/ package org.cishell.templates.guibuilder; import org.eclipse.jface.dialogs.Dialog; @@ -26,12 +13,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; -/** - * - * @author Bruce Herr (bh...@bh...) - */ public class AttributeDefinitionEditor extends Dialog { - protected EditableAttributeDefinition attr; public static final String[] TYPE_LABELS = new String[]{ "String","Integer","Long","Short","Double","Float","Boolean", "Char", "Byte", "File", "Directory" @@ -40,40 +22,41 @@ 1,3,2,4,7,8,11,5,6,1,1 }; - protected Text id; - protected Text name; - protected Text description; - protected Text defaultValue; - protected Combo type; + private EditableAttributeDefinition attribute; + private Text id; + private Text name; + private Text description; + private Text defaultValue; + private Combo type; - protected AttributeDefinitionEditor(Composite parent, EditableAttributeDefinition attr) { + public AttributeDefinitionEditor(Composite parent, EditableAttributeDefinition attr) { this(parent.getShell(), attr); } - protected AttributeDefinitionEditor(Shell parentShell, EditableAttributeDefinition attr) { + private AttributeDefinitionEditor(Shell parentShell, EditableAttributeDefinition attr) { super(parentShell); - this.attr = attr; + this.attribute = attr; } protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); Composite panel = new Composite(composite, SWT.NONE); - GridLayout gridLayout = new GridLayout(2,false); + GridLayout gridLayout = new GridLayout(2, false); panel.setLayout(gridLayout); - id = newTextInput(panel,"Unique ID"); - id.setText(attr.getID()); + id = newTextInput(panel, "Unique ID"); + id.setText(attribute.getID()); - name = newTextInput(panel,"Name"); - name.setText(attr.getName()); + name = newTextInput(panel, "Name"); + name.setText(attribute.getName()); - description = newTextInput(panel,"Description"); - description.setText(attr.getDescription()); + description = newTextInput(panel, "Description"); + description.setText(attribute.getDescription()); defaultValue = newTextInput(panel, "Default Value"); - defaultValue.setText(attr.getDefaultValue()[0]); + defaultValue.setText(attribute.getDefaultValue()[0]); type = newListInput(panel, "Input Type"); type.setItems(TYPE_LABELS); @@ -95,7 +78,7 @@ }}); for (int i=0; i < TYPE_VALUES.length; i++) { - if (TYPE_VALUES[i] == attr.getType()) { + if (TYPE_VALUES[i] == attribute.getType()) { type.select(i); break; } @@ -106,7 +89,7 @@ return composite; } - protected Text newTextInput(Composite panel, String text) { + private Text newTextInput(Composite panel, String text) { Label label = new Label(panel, SWT.NONE); label.setText(text); GridData data = new GridData(SWT.LEFT, SWT.BEGINNING, false, false); @@ -119,7 +102,7 @@ return input; } - protected Combo newListInput(Composite panel, String text) { + private Combo newListInput(Composite panel, String text) { Label label = new Label(panel, SWT.NONE); label.setText(text); GridData data = new GridData(SWT.LEFT, SWT.BEGINNING, false, false); @@ -131,20 +114,20 @@ } protected void okPressed() { - attr.setID(cleanText(id.getText())); - attr.setName(cleanText(name.getText())); + attribute.setID(cleanText(id.getText())); + attribute.setName(cleanText(name.getText())); String desc = cleanText(description.getText()); if (desc.length() == 0) { desc = " "; } - attr.setDescription(desc); - attr.setDefaultValue(new String[]{cleanText(defaultValue.getText())}); - attr.setType(TYPE_VALUES[type.getSelectionIndex()]); + attribute.setDescription(desc); + attribute.setDefaultValue(new String[]{cleanText(defaultValue.getText())}); + attribute.setType(TYPE_VALUES[type.getSelectionIndex()]); super.okPressed(); } - protected String cleanText(String text) { + private String cleanText(String text) { text = text.replaceAll("<", "<"); text = text.replaceAll(">", ">"); Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ListBuilder.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ListBuilder.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ListBuilder.java 2009-08-06 14:02:35 UTC (rev 914) @@ -31,9 +31,9 @@ import org.eclipse.swt.widgets.TableItem; public class ListBuilder { - protected BuilderDelegate delegate; - protected Table table; - protected Composite panel; + private BuilderDelegate delegate; + private Table table; + private Composite panel; public ListBuilder(Composite parent, BuilderDelegate delegate) { this(parent, SWT.NONE, delegate); @@ -41,91 +41,104 @@ public ListBuilder(Composite parent, int style, BuilderDelegate delegate) { this.delegate = delegate; + createGUI(parent, style); } private void createGUI(Composite parent, int style) { panel = new Composite(parent, style); - GridLayout gridLayout = new GridLayout(2, false); - panel.setLayout(gridLayout); + GridLayout panelLayout = new GridLayout(2, false); + panel.setLayout(panelLayout); - GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true); - gridData.verticalSpan = 10; + GridData tableData = + new GridData(GridData.FILL, GridData.FILL, true, true); + tableData.verticalSpan = 10; table = createTable(panel); - table.setLayoutData(gridData); + table.setLayoutData(tableData); setupTableDoubleClicking(); setupTableDeleteKey(); - gridData = new GridData(GridData.FILL, GridData.BEGINNING, false, false); - Button add = createAddButton(panel); - add.setLayoutData(gridData); + GridData addButtonLayoutData = + new GridData(GridData.FILL, GridData.BEGINNING, false, false); + Button addButton = createAddButton(panel); + addButton.setLayoutData(addButtonLayoutData); - gridData = new GridData(GridData.FILL, GridData.BEGINNING, false, false); - Button edit = createEditButton(panel); - edit.setLayoutData(gridData); + GridData editButtonLayoutData = + new GridData(GridData.FILL, GridData.BEGINNING, false, false); + Button editButton = createEditButton(panel); + editButton.setLayoutData(editButtonLayoutData); - gridData = new GridData(GridData.FILL, GridData.BEGINNING, false, false); - Button remove = createRemoveButton(panel); - remove.setLayoutData(gridData); + GridData removeButtonLayoutData = + new GridData(GridData.FILL, GridData.BEGINNING, false, false); + Button removeButton = createRemoveButton(panel); + removeButton.setLayoutData(removeButtonLayoutData); - new Label(panel, SWT.NONE); //filler label + // This is a filler label. + new Label(panel, SWT.NONE); - gridData = new GridData(GridData.FILL, GridData.BEGINNING, false, false); - Button up = createUpButton(panel); - up.setLayoutData(gridData); + GridData moveUpButtonLayoutData = + new GridData(GridData.FILL, GridData.BEGINNING, false, false); + Button moveUpButton = createMoveUpButton(panel); + moveUpButton.setLayoutData(moveUpButtonLayoutData); - gridData = new GridData(GridData.FILL, GridData.BEGINNING, false, false); - Button down = createDownButton(panel); - down.setLayoutData(gridData); + GridData moveDownButtonLayoutData = + new GridData(GridData.FILL, GridData.BEGINNING, false, false); + Button moveDownButton = createMoveDownButton(panel); + moveDownButton.setLayoutData(moveDownButtonLayoutData); } private Button createAddButton(Composite parent) { - Button button = new Button(parent, SWT.FLAT); - button.setText("Add..."); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); + Button addButton = new Button(parent, SWT.PUSH); + addButton.setText("Add..."); + + addButton.addSelectionListener(new SelectionListener() { + public void widgetDefaultSelected(SelectionEvent selectionEvent) { + widgetSelected(selectionEvent); } - public void widgetSelected(SelectionEvent e) { + public void widgetSelected(SelectionEvent selectionEvent) { String[] item = delegate.createItem(); - if (item != null) add(item); + if (item != null) { + addItem(item); + } }}); - return button; + return addButton; } private Button createEditButton(Composite parent) { - Button button = new Button(parent, SWT.FLAT); - button.setText("Edit..."); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); + Button editButton = new Button(parent, SWT.PUSH); + editButton.setText("Edit..."); + + editButton.addSelectionListener(new SelectionListener() { + public void widgetDefaultSelected(SelectionEvent selectionEvent) { + widgetSelected(selectionEvent); } - public void widgetSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); + public void widgetSelected(SelectionEvent selectionEvent) { + TableItem[] tableItems = table.getSelection(); - if (items.length > 0) { - delegate.edit(items[0]); + if (tableItems.length > 0) { + delegate.edit(tableItems[0]); } }}); - return button; + return editButton; } private Button createRemoveButton(Composite parent) { - Button button = new Button(parent, SWT.FLAT); - button.setText("Remove"); - button.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); + Button removeButton = new Button(parent, SWT.PUSH); + removeButton.setText("Remove"); + + removeButton.addSelectionListener(new SelectionListener() { + public void widgetDefaultSelected(SelectionEvent selectionEvent) { + widgetSelected(selectionEvent); } - public void widgetSelected(SelectionEvent e) { + public void widgetSelected(SelectionEvent selectionEvent) { int index = table.getSelectionIndex(); if (index != -1) { @@ -133,11 +146,11 @@ } }}); - return button; + return removeButton; } - private Button createUpButton(Composite parent) { - Button button = new Button(parent, SWT.FLAT); + private Button createMoveUpButton(Composite parent) { + Button button = new Button(parent, SWT.PUSH); button.setText("Up"); button.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { @@ -161,8 +174,8 @@ return button; } - private Button createDownButton(Composite parent) { - Button button = new Button(parent, SWT.FLAT); + private Button createMoveDownButton(Composite parent) { + Button button = new Button(parent, SWT.PUSH); button.setText("Down"); button.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { @@ -204,7 +217,7 @@ return table; } - private void add(String[] item) { + private void addItem(String[] item) { int index = table.getSelectionIndex(); TableItem row; if (index == -1) { Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ParameterBuilderDelegate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ParameterBuilderDelegate.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ParameterBuilderDelegate.java 2009-08-06 14:02:35 UTC (rev 914) @@ -1,16 +1,3 @@ -/* **************************************************************************** - * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Apache License v2.0 which accompanies - * this distribution, and is available at: - * http://www.apache.org/licenses/LICENSE-2.0.html - * - * Created on Aug 16, 2006 at Indiana University. - * - * Contributors: - * Indiana University - - * ***************************************************************************/ package org.cishell.templates.guibuilder; import java.util.HashMap; @@ -21,97 +8,91 @@ import org.eclipse.swt.widgets.TableItem; import org.osgi.service.metatype.AttributeDefinition; -/** - * - * @author Bruce Herr (bh...@bh...) - */ public class ParameterBuilderDelegate implements BuilderDelegate { - protected static final String[] COLUMN_LABELS = new String[]{"id","Type","Label"}; - protected Map idToAttrMap; - protected int lastID; - protected Composite parent; + public static final String[] COLUMN_LABELS = new String[] { + "id", "Type", "Label" + }; + private Map idToAttributeMap; + private int lastID; + private Composite parent; + public ParameterBuilderDelegate(Composite parent) { this.parent = parent; - idToAttrMap = new HashMap(); + idToAttributeMap = new HashMap(); lastID = 0; } - /** - * @see org.cishell.templates.guibuilder.BuilderDelegate#createItem() - */ public String[] createItem() { - EditableAttributeDefinition attr = new EditableAttributeDefinition(); + EditableAttributeDefinition attribute = new EditableAttributeDefinition(); lastID++; - attr.setID(""+lastID); - attr.setName("Parameter Label"); - attr.setDescription("Parameter Description"); - attr.setDefaultValue(new String[]{"Default value"}); - attr.setType(AttributeDefinition.STRING); + attribute.setID("" + lastID); + attribute.setName("Parameter Label"); + attribute.setDescription("Parameter Description"); + attribute.setDefaultValue(new String[] { "Default value" }); + attribute.setType(AttributeDefinition.STRING); - boolean success = edit(attr); + boolean success = edit(attribute); if (success) { - idToAttrMap.put(attr.getID(), attr); + idToAttributeMap.put(attribute.getID(), attribute); String[] item = new String[]{ - attr.getID(), - getTypeString(attr.getType()), - attr.getName() + attribute.getID(), + getTypeString(attribute.getType()), + attribute.getName() }; + return item; } else { return null; } } - /** - * @see org.cishell.templates.guibuilder.BuilderDelegate#edit(org.eclipse.swt.widgets.TableItem) - */ public void edit(TableItem item) { - String id = item.getText(0); + String itemID = item.getText(0); - EditableAttributeDefinition attr = - (EditableAttributeDefinition) idToAttrMap.get(id); + EditableAttributeDefinition attribute = + (EditableAttributeDefinition)idToAttributeMap.get(itemID); - edit(attr); + edit(attribute); - item.setText(0, attr.getID()); - item.setText(1, getTypeString(attr.getType())); - item.setText(2, attr.getName()); + item.setText(0, attribute.getID()); + item.setText(1, getTypeString(attribute.getType())); + item.setText(2, attribute.getName()); } - protected boolean edit(EditableAttributeDefinition attr) { - AttributeDefinitionEditor editor = new AttributeDefinitionEditor(parent, attr); - int returnCode = editor.open(); + protected boolean edit(EditableAttributeDefinition attribute) { + AttributeDefinitionEditor attributeDefinitionEditor = + new AttributeDefinitionEditor(parent, attribute); + int returnCode = attributeDefinitionEditor.open(); if (returnCode == Dialog.OK) { - idToAttrMap.put(attr.getID(), attr); + idToAttributeMap.put(attribute.getID(), attribute); } return returnCode == Dialog.OK; } protected String getTypeString(int type) { - String str = "Unknown"; + String typeString = "Unknown"; - for (int i=0; i < AttributeDefinitionEditor.TYPE_VALUES.length; i++) { - if (AttributeDefinitionEditor.TYPE_VALUES[i] == type) { - str = AttributeDefinitionEditor.TYPE_LABELS[i]; + for (int ii = 0; + ii < AttributeDefinitionEditor.TYPE_VALUES.length; + ii++) { + if (AttributeDefinitionEditor.TYPE_VALUES[ii] == type) { + typeString = AttributeDefinitionEditor.TYPE_LABELS[ii]; break; } } - return str; + return typeString; } public EditableAttributeDefinition getAttributeDefinition(String id) { - return (EditableAttributeDefinition) idToAttrMap.get(id); + return (EditableAttributeDefinition)idToAttributeMap.get(id); } - - /** - * @see org.cishell.templates.guibuilder.BuilderDelegate#getColumns() - */ + public String[] getColumns() { return COLUMN_LABELS; } Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ParameterListBuilder.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ParameterListBuilder.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/guibuilder/ParameterListBuilder.java 2009-08-06 14:02:35 UTC (rev 914) @@ -1,16 +1,3 @@ -/* **************************************************************************** - * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Apache License v2.0 which accompanies - * this distribution, and is available at: - * http://www.apache.org/licenses/LICENSE-2.0.html - * - * Created on Aug 16, 2006 at Indiana University. - * - * Contributors: - * Indiana University - - * ***************************************************************************/ package org.cishell.templates.guibuilder; import org.eclipse.swt.SWT; @@ -19,8 +6,8 @@ import org.eclipse.swt.widgets.TableItem; public class ParameterListBuilder { - protected ListBuilder builder; - protected ParameterBuilderDelegate delegate; + private ListBuilder builder; + private ParameterBuilderDelegate delegate; public ParameterListBuilder(Composite parent) { this(parent, SWT.NONE); @@ -37,24 +24,28 @@ public EditableAttributeDefinition[] getCreatedAttributes() { Display display = Display.getDefault(); + if (display != null) { - GetAttributeDefinitionsAction action = new GetAttributeDefinitionsAction(); + GetAttributeDefinitionsAction action = + new GetAttributeDefinitionsAction(); display.syncExec(action); - return action.attrs; + + return action.attributes; } else { return new EditableAttributeDefinition[0]; } } private class GetAttributeDefinitionsAction implements Runnable { - EditableAttributeDefinition[] attrs; + EditableAttributeDefinition[] attributes; public void run() { TableItem[] items = builder.getTable().getItems(); - attrs = new EditableAttributeDefinition[items.length]; + attributes = new EditableAttributeDefinition[items.length]; - for (int i=0; i < items.length; i++) { - attrs[i] = delegate.getAttributeDefinition(items[i].getText(0)); + for (int ii = 0; ii < items.length; ii++) { + attributes[ii] = + delegate.getAttributeDefinition(items[ii].getText(0)); } } } Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputDataProvider.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputDataProvider.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputDataProvider.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,7 @@ +package org.cishell.templates.staticexecutable.providers; + +import org.cishell.templates.wizards.staticexecutable.InputDataItem; + +public interface InputDataProvider { + public InputDataItem[] getInputDataItems(); +} \ No newline at end of file Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputParameterProvider.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputParameterProvider.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputParameterProvider.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,7 @@ +package org.cishell.templates.staticexecutable.providers; + +import org.osgi.service.metatype.AttributeDefinition; + +public interface InputParameterProvider { + public AttributeDefinition[] getInputParameters(); +} \ No newline at end of file Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOption.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOption.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOption.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,28 @@ +package org.cishell.templates.staticexecutable.providers; + +import org.eclipse.pde.ui.templates.BaseOptionTemplateSection; +import org.eclipse.pde.ui.templates.StringOption; + +public class PlatformOption extends StringOption { + private String platformName; + private String platformPath; + + public PlatformOption(BaseOptionTemplateSection section, + String name, + String label, + String platformName, + String platformPath) { + super(section, name, label); + + this.platformName = platformName; + this.platformPath = platformPath; + } + + public String getPlatformName() { + return this.platformName; + } + + public String getPlatformPath() { + return this.platformPath; + } +} \ No newline at end of file Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOptionProvider.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOptionProvider.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOptionProvider.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,17 @@ +package org.cishell.templates.staticexecutable.providers; + +public interface PlatformOptionProvider { + public PlatformOption getExecutableFileOption(String platformName); + public PlatformOption[] getExecutableFileOptions(); + public void addExecutableFileOption(PlatformOption executableFileOption); + public PlatformOption createExecutableFileOption( + String platformName, String platformPath); + public String formExecutableFileOptionName(String platformName); + + public PlatformOption[] getRelatedFileOptions(String platformName); + public void addRelatedFileOption(PlatformOption relatedFileOption); + public void removeRelatedFileOption(PlatformOption relatedFileOption); + public PlatformOption createRelatedFileOption( + String platformName, String platformPath); + public String formRelatedFileOptionName(String platformName); +} \ No newline at end of file Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/BasicTemplate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/BasicTemplate.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/BasicTemplate.java 2009-08-06 14:02:35 UTC (rev 914) @@ -24,10 +24,6 @@ import org.eclipse.pde.ui.templates.OptionTemplateSection; import org.eclipse.pde.ui.templates.TemplateOption; -/** - * - * @author Bruce Herr (bh...@bh...) - */ public abstract class BasicTemplate extends OptionTemplateSection { protected final String sectionID; protected Map valueMap; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/dataset/NewDatasetTemplate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/dataset/NewDatasetTemplate.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/dataset/NewDatasetTemplate.java 2009-08-06 14:02:35 UTC (rev 914) @@ -36,7 +36,7 @@ } public void addPages(Wizard wizard) { - WizardPage page = new WizardNewProjectCreationPage("projectPage"); + WizardPage page = new WizardNewProjectCreationPage("createProjectPage"); page.setTitle("Project Properties"); page.setDescription("Enter the project name and location"); wizard.addPage(page); Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/java/NewJavaAlgorithmTemplate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/java/NewJavaAlgorithmTemplate.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/java/NewJavaAlgorithmTemplate.java 2009-08-06 14:02:35 UTC (rev 914) @@ -59,7 +59,7 @@ } public void addPages(Wizard wizard) { - projectPage = new WizardNewProjectCreationPage("projectPage"); + projectPage = new WizardNewProjectCreationPage("createProjectPage"); WizardPage page = projectPage; page.setTitle("Project Properties"); page.setDescription("Enter the project name and location"); Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/java/NewJavaAlgorithmWizard.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/java/NewJavaAlgorithmWizard.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/java/NewJavaAlgorithmWizard.java 2009-08-06 14:02:35 UTC (rev 914) @@ -48,10 +48,6 @@ import org.eclipse.ui.ide.IDE; import org.eclipse.ui.part.ISetSelectionTarget; -/** - * - * @author Bruce Herr (bh...@bh...) - */ public class NewJavaAlgorithmWizard extends NewPluginTemplateWizard implements IWorkbenchWizard { NewJavaAlgorithmTemplate template; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/jython/NewJythonAlgorithmTemplate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/jython/NewJythonAlgorithmTemplate.java 2009-08-03 16:41:30 UTC (rev 913) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/jython/NewJythonAlgorithmTemplate.java 2009-08-06 14:02:35 UTC (rev 914) @@ -36,7 +36,7 @@ } public void addPages(Wizard wizard) { - WizardPage page = new WizardNewProjectCreationPage("projectPage"); + WizardPage page = new WizardNewProjectCreationPage("createProjectPage"); page.setTitle("Project Properties"); page.setDescription("Enter the project name and location"); wizard.addPage(page); Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,97 @@ +package org.cishell.templates.wizards.pagepanels; + +import java.util.Map; + +import org.cishell.templates.guibuilder.BuilderDelegate; +import org.cishell.templates.guibuilder.ListBuilder; +import org.cishell.templates.wizards.staticexecutable.InputDataItem; +import org.cishell.templates.wizards.staticexecutable.StaticExecutableInputDataDelegate; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Device; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Layout; +import org.eclipse.swt.widgets.TableItem; + +public class AddInputDataPanel extends Composite { + public static final String INPUT_DATA_LABEL_TEXT = "Input Data"; + + private ListBuilder listBuilder; + private StaticExecutableInputDataDelegate delegate; + + public AddInputDataPanel(Composite parent, int style) { + super(parent, style); + setLayout(createLayoutForThis()); + + createHeader(); + this.delegate = new StaticExecutableInputDataDelegate(parent); + this.listBuilder = new ListBuilder(parent, SWT.NONE, delegate); + + GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); + this.listBuilder.getPanel().setLayoutData(gridData); + } + + public ListBuilder getListBuilder() { + return this.listBuilder; + } + + public BuilderDelegate getDelegate() { + return this.delegate; + } + + public InputDataItem[] getInputDataItems() { + TableItem[] tableItems = this.listBuilder.getTable().getItems(); + InputDataItem[] inputDataItems = new InputDataItem[tableItems.length]; + Map idToInputDataItemMap = this.delegate.getIDToInputDataItemMap(); + + for (int ii = 0; ii < tableItems.length; ii++) { + inputDataItems[ii] = (InputDataItem) + idToInputDataItemMap.get(tableItems[ii].getText(0)); + } + + return inputDataItems; + } + + private Layout createLayoutForThis() { + GridLayout layout = new GridLayout(1, true); + layout.marginHeight = 0; + layout.marginBottom = 0; + layout.marginTop = 0; + + return layout; + } + + private void createHeader() { + Label inputDataLabel = new Label(this, SWT.NONE); + inputDataLabel.setLayoutData(createInputDataLabelLayoutData()); + inputDataLabel.setText(INPUT_DATA_LABEL_TEXT); + inputDataLabel.setFont( + createInputDataLabelFont(inputDataLabel.getDisplay(), + inputDataLabel.getFont().getFontData())); + } + + private Object createInputDataLabelLayoutData() { + GridData data = new GridData(); + data.horizontalAlignment = SWT.BEGINNING; + + return data; + } + + private Font createInputDataLabelFont(Device device, + FontData[] oldFontData) { + FontData[] newFontData = new FontData[oldFontData.length]; + + for (int ii = 0; ii < oldFontData.length; ii++) { + newFontData[ii] = new FontData( + oldFontData[ii].getName(), + oldFontData[ii].getHeight() + 2, + oldFontData[ii].getStyle() | SWT.BOLD); + } + + return new Font(device, newFontData); + } +} \ No newline at end of file Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,79 @@ +package org.cishell.templates.wizards.pagepanels; + +import org.cishell.templates.guibuilder.BuilderDelegate; +import org.cishell.templates.guibuilder.ListBuilder; +import org.cishell.templates.wizards.staticexecutable.StaticExecutableOutputDataDelegate; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Device; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Layout; + +public class AddOutputDataPanel extends Composite { + public static final String OUTPUT_DATA_LABEL_TEXT = "Output Data"; + + private ListBuilder listBuilder; + private BuilderDelegate delegate; + + public AddOutputDataPanel(Composite parent, int style) { + super(parent, style); + + setLayout(createLayoutForThis()); + + createHeader(); + delegate = new StaticExecutableOutputDataDelegate(parent); + listBuilder = new ListBuilder(parent, SWT.NONE, delegate); + + GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); + this.listBuilder.getPanel().setLayoutData(gridData); + } + + public ListBuilder getListBuilder() { + return this.listBuilder; + } + + public BuilderDelegate getDelegate() { + return this.delegate; + } + + private Layout createLayoutForThis() { + GridLayout layout = new GridLayout(6, true); + + return layout; + } + + private void createHeader() { + Label outputDataLabel = new Label(this, SWT.NONE); + outputDataLabel.setLayoutData(createOutputDataLabelLayoutData()); + outputDataLabel.setText(OUTPUT_DATA_LABEL_TEXT); + outputDataLabel.setFont(createOutputDataLabelFont( + outputDataLabel.getDisplay(), + outputDataLabel.getFont().getFontData())); + } + + private Object createOutputDataLabelLayoutData() { + GridData data = new GridData(); + data.horizontalAlignment = SWT.CENTER; + data.horizontalSpan = 6; + + return data; + } + + private Font createOutputDataLabelFont(Device device, + FontData[] oldFontData) { + FontData[] newFontData = new FontData[oldFontData.length]; + + for (int ii = 0; ii < oldFontData.length; ii++) { + newFontData[ii] = new FontData( + oldFontData[ii].getName(), + oldFontData[ii].getHeight() + 2, + oldFontData[ii].getStyle() | SWT.BOLD); + } + + return new Font(device, newFontData); + } +} \ No newline at end of file Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SetupPlatformsPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SetupPlatformsPanel.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SetupPlatformsPanel.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,129 @@ +package org.cishell.templates.wizards.pagepanels; + +import java.util.ArrayList; + +import org.cishell.templates.staticexecutable.providers.PlatformOptionProvider; +import org.cishell.templates.wizards.staticexecutable.NewStaticExecutableAlgorithmWizard; +import org.cishell.templates.wizards.widgets.PlatformSetupWidget; +import org.cishell.templates.wizards.widgets.ResizeCompositeHackWidget; +import org.eclipse.pde.ui.templates.TemplateOption; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Layout; +import org.eclipse.swt.widgets.Text; + +public class SetupPlatformsPanel extends ResizeCompositeHackWidget { + public static final String SPECIFY_EXECUTABLE_NAME_LABEL = + "Executable Name"; + + // public static final int SPECIFY_EXECUTABLE_NAME_TEXT_WIDTH = 350; + + private ArrayList platformSetupWidgets; + + public SetupPlatformsPanel(Composite parent, + int style, + TemplateOption executableNameOption, + PlatformOptionProvider platformOptionProvider) { + super(parent, style); + + setLayout(createLayoutForThis()); + createExecutableNameOptionWidget(executableNameOption); + + this.platformSetupWidgets = + createPlatformSetupWidgets(platformOptionProvider); + } + + public ArrayList getPlatformSetupWidgets() { + return this.platformSetupWidgets; + } + + private Layout createLayoutForThis() { + GridLayout layout = new GridLayout(2, true); + layout.makeColumnsEqualWidth = false; + + return layout; + } + + private void createExecutableNameOptionWidget( + TemplateOption executableNameOption) { + executableNameOption.createControl(this, 2); + } + + private void createSpecifyExecutableNameLabel() { + Label specifyExecutableNameLabel = new Label(this, SWT.NONE); + specifyExecutableNameLabel.setLayoutData( + createSpecifyExecutableNameLableLayoutData()); + specifyExecutableNameLabel.setText( + SPECIFY_EXECUTABLE_NAME_LABEL + ":"); + } + + private Text createSpecifyExecutableNameText() { + Text specifyExecutableNameText = new Text(this, SWT.BORDER); + specifyExecutableNameText.setLayoutData( + createSpecifyExecutableNameTextLayoutData()); + + return specifyExecutableNameText; + } + + private ArrayList createPlatformSetupWidgets( + PlatformOptionProvider platformOptionProvider) { + ArrayList platformSetupWidgets = new ArrayList(); + + PlatformSetupWidget defaultPlatformSetupWidget = + new PlatformSetupWidget( + this, + SWT.NONE, + NewStaticExecutableAlgorithmWizard.DEFAULT_LABEL, + NewStaticExecutableAlgorithmWizard.DEFAULT_PATH, + false, + platformOptionProvider); + defaultPlatformSetupWidget.setLayoutData( + createPlatformSetupWidgetLayoutData()); + platformSetupWidgets.add(defaultPlatformSetupWidget); + + for (int ii = 1; + ii < NewStaticExecutableAlgorithmWizard.PLATFORM_LABELS.length; + ii++) { + PlatformSetupWidget platformSetupWidget = + new PlatformSetupWidget( + this, + SWT.NONE, + NewStaticExecutableAlgorithmWizard.PLATFORM_LABELS[ii], + NewStaticExecutableAlgorithmWizard.PLATFORM_PATHS[ii], + true, + platformOptionProvider); + platformSetupWidget.setLayoutData( + createPlatformSetupWidgetLayoutData()); + platformSetupWidgets.add(platformSetupWidget); + } + + return platformSetupWidgets; + } + + private Object createSpecifyExecutableNameLableLayoutData() { + GridData data = new GridData(); + + return data; + } + + private Object createSpecifyExecutableNameTextLayoutData() { + GridData data = new GridData(); + data.horizontalAlignment = SWT.FILL; + data.grabExcessHorizontalSpace = true; + // data.widthHint = SPECIFY_EXECUTABLE_NAME_TEXT_WIDTH; + + return data; + } + + private Object createPlatformSetupWidgetLayoutData() { + GridData data = new GridData(); + data.horizontalAlignment = SWT.FILL; + data.grabExcessHorizontalSpace = true; + data.horizontalSpan = 2; + + return data; + } +} \ No newline at end of file Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,239 @@ +package org.cishell.templates.wizards.pagepanels; + +import org.cishell.templates.staticexecutable.providers.InputDataProvider; +import org.cishell.templates.staticexecutable.providers.InputParameterProvider; +import org.cishell.templates.wizards.staticexecutable.InputDataItem; +import org.eclipse.pde.ui.templates.TemplateOption; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Layout; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.swt.widgets.Text; +import org.osgi.service.metatype.AttributeDefinition; + +public class SpecifyTemplateStringPanel extends Composite + implements SelectionListener { + public static final String PLACEHOLDER_LABEL = + "Template String Placeholders"; + public static final String TEMPLATE_STRING_LABEL = "Template String"; + public static final String INSERT_PLACEHOLDER_BUTTON_LABEL = "Insert"; + + public static final String PLACEHOLDER_LABEL_COLUMN_LABEL = "Item"; + public static final String PLACEHOLDER_COLUMN_LABEL = + "Placeholder String for Item"; + + public static final int COLUMN_WIDTH = 85; + public static final int TABLE_HEIGHT = 300; + + private Table placeholderTable; + private Button insertPlaceholderButton; + private TemplateOption templateStringOption; + + public SpecifyTemplateStringPanel(Composite parent, + int style, + TemplateOption templateStringOption) { + super(parent, style); + + this.templateStringOption = templateStringOption; + + setLayout(createLayoutForThis()); + + createHeader(); + this.placeholderTable = createPlaceholderTable(); + this.insertPlaceholderButton = createInsertPlaceholderButton(); + createTemplateStringText(); + } + + public void updateControls(InputParameterProvider inputParameterProvider, + InputDataProvider inputDataProvider) { + this.placeholderTable.deselectAll(); + this.placeholderTable.removeAll(); + + AttributeDefinition[] inputParameters = + inputParameterProvider.getInputParameters(); + + for (int ii = 0; ii < inputParameters.length; ii++) { + String label = inputParameters[ii].getName() + + " (" + + inputParameters[ii].getDescription() + + ")"; + String value = "\"${" + inputParameters[ii].getName() + "}\""; + addTableItem(label, value); + } + + InputDataItem[] inputDataItems = + inputDataProvider.getInputDataItems(); + + for (int ii = 0; ii < inputDataItems.length; ii++) { + String label = inputDataItems[ii].getMimeType() + " File"; + String value = "\"${inFile[" + ii + "]}\""; + addTableItem(label, value); + } + } + + public void widgetDefaultSelected(SelectionEvent selectionEvent) { + insertButtonSelected(selectionEvent); + } + + public void widgetSelected(SelectionEvent selectionEvent) { + insertButtonSelected(selectionEvent); + } + + private Layout createLayoutForThis() { + GridLayout layout = new GridLayout(4, true); + layout.makeColumnsEqualWidth = false; + + return layout; + } + + private void createHeader() { + Label placeholderTableLabel = new Label(this, SWT.NONE); + placeholderTableLabel.setLayoutData( + createPlaceholderTableLabelLayoutData()); + placeholderTableLabel.setText(PLACEHOLDER_LABEL); + + Label insertButtonLabel = new Label(this, SWT.NONE); + insertButtonLabel.setLayoutData( + createInsertPlaceholderButtonLayoutData()); + insertButtonLabel.setText(INSERT_PLACEHOLDER_BUTTON_LABEL); + insertButtonLabel.setVisible(false); + + // To accomodate for the option label control. + new Label(this, SWT.NONE).setLayoutData(new GridData()); + + Label templateStringLabel = new Label(this, SWT.NONE); + templateStringLabel.setLayoutData( + createTemplateStringTextLayoutData()); + templateStringLabel.setText(TEMPLATE_STRING_LABEL); + } + + private Table createPlaceholderTable() { + Table placeholderTable = new Table( + this, SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION); + placeholderTable.setLayoutData(createPlaceholderTableLayoutData()); + placeholderTable.setLinesVisible(true); + placeholderTable.setHeaderVisible(true); + + TableColumn placeholderLabelColumn = + new TableColumn(placeholderTable, SWT.NONE); + placeholderLabelColumn.pack(); + placeholderLabelColumn.setWidth(COLUMN_WIDTH); + placeholderLabelColumn.setText(PLACEHOLDER_LABEL_COLUMN_LABEL); + + TableColumn placeholderColumn = + new TableColumn(placeholderTable, SWT.NONE); + placeholderColumn.pack(); + placeholderColumn.setWidth(COLUMN_WIDTH); + placeholderColumn.setText(PLACEHOLDER_COLUMN_LABEL); + + return placeholderTable; + } + + private Button createInsertPlaceholderButton() { + Button insertPlaceholderButton = new Button(this, SWT.PUSH); + insertPlaceholderButton.setLayoutData( + createInsertPlaceholderButtonLayoutData()); + insertPlaceholderButton.setText(INSERT_PLACEHOLDER_BUTTON_LABEL); + insertPlaceholderButton.addSelectionListener(this); + + return insertPlaceholderButton; + } + + private void createTemplateStringText() { + this.templateStringOption.createControl(this, 2); + } + + private Object createPlaceholderTableLabelLayoutData() { + GridData data = new GridData(); + data.horizontalAlignment = SWT.CENTER; + + return data; + } + + private Object createPlaceholderTableLayoutData() { + GridData data = new GridData(); + data.horizontalAlignment = SWT.CENTER; + data.heightHint = TABLE_HEIGHT; + + return data; + } + + private Object createInsertPlaceholderButtonLayoutData() { + GridData data = new GridData(); + + return data; + } + + private Object createTemplateStringTextLayoutData() { + GridData data = new GridData(); + data.horizontalAlignment = SWT.FILL; + data.grabExcessHorizontalSpace = true; + + return data; + } + + private void addTableItem(String label, String value) { + String[] tableItemText = new String[] { label, value }; + TableItem tableItem = new TableItem(this.placeholderTable, SWT.NONE); + tableItem.setText(tableItemText); + } + + private void insertButtonSelected(SelectionEvent selectionEvent) { + int selectedTableItemIndex = this.placeholderTable.getSelectionIndex(); + + if (selectedTableItemIndex != -1) { + TableItem selectedTableItem = + this.placeholderTable.getItem(selectedTableItemIndex); + String placeholder = selectedTableItem.getText(1); + + insertPlaceholder(placeholder); + } + } + + private void insertPlaceholder(String placeholder) { + /*if (!this.templateStringOption.getSelectionText().equals("")) { + // If there is a selection, replace the selection with the + // placeholder. + this.templateStringText.insert(placeholder); + } else { + // Otherwise, insert the placeholder at the fixedCaretPosition. + int caretPosition = this.templateStringText.getCaretPosition(); + int fixedCaretPosition = fixCaretPosition(caretPosition); + this.templateStringText.setSelection(fixedCaretPosition); + this.templateStringText.insert(" " + placeholder + " "); + }*/ + + this.templateStringOption.setValue( + this.templateStringOption.getValue().toString() + + " " + + placeholder); + } + + /*private int fixCaretPosition(int caretPosition) { + int fixedCaretPosition = caretPosition; + String templateStringText = this.templateStringText.getText(); + + if (fixedCaretPosition == 0 || templateStringText.length() == 0) { + return fixedCaretPosition; + } else { + char currentCharacter = templateStringText.charAt(fixedCaretPosition); + + while (!Character.isWhitespace(currentCharacter) && + fixedCaretPosition < templateStringText.length()) { + fixedCaretPosition++; + currentCharacter = + templateStringText.charAt(fixedCaretPosition); + } + } + + return fixedCaretPosition; + }*/ +} \ No newline at end of file Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseExecutableFilesPage.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseExecutableFilesPage.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseExecutableFilesPage.java 2009-08-06 14:02:35 UTC (rev 914) @@ -0,0 +1,56 @@ +package org.cishell.templates.wizards.pages; + +import org.cishell.templates.staticexecutable.providers.PlatformOptionProvider; +import org.cishell.templates.wizards.pagepanels.SetupPlatformsPanel; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.pde.ui.templates.TemplateOption; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.widgets.Composite; + +public class ChooseExecutableFilesPage extends WizardPage { + private SetupPlatformsPanel setupPlatformsPanel; + private TemplateOption executableNameOption; + private PlatformOptionProvider platformOptionProvider; + + public ChooseExecutableFilesPage( + String pageName, + TemplateOption executableNameOption, + PlatformOptionProvider platformOptionProvider) { + super(pageName); + + this.executableNameOption = executableNameOption; + this.platformOptionProvider = platformOptionProvider; + } + + public void createControl(Composite parent) { + final ScrolledComposite scrollingContainer = + new ScrolledComposite(parent, SWT.V_SCROLL); + final SetupPlatformsPanel setupPlatformsPanel = + new SetupPlatformsPanel(scrollingContainer, + SWT.NONE, + this.executableNameOption, + this.platformOptionProvider); + this.setupPlatformsPanel = setupPlatformsPanel; + + // TODO: This control listener should maybe be on setupPlatformsPanel? + scrollingContainer.addControlListener(new ControlAdapter() { + public void controlResized(ControlEvent controlEvent) { + scrollingContainer.setMinSize( + setupPlatformsPanel.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + } + }); + + scrollingContainer.setContent(setupPlatformsPanel); + scrollingContainer.setExpandHorizontal(true); + scrollingContainer.setExpandVertical(true); + + setControl(scrollingContainer); + } + + public SetupPlatformsPanel getSetupPlatforms... [truncated message content] |
From: <pat...@us...> - 2009-08-06 15:12:40
|
Revision: 915 http://cishell.svn.sourceforge.net/cishell/?rev=915&view=rev Author: pataphil Date: 2009-08-06 15:12:31 +0000 (Thu, 06 Aug 2009) Log Message: ----------- * Now outputs all necessary data in the newly-created projects. * Fixed a couple of bugs with the way input/output data was being retrieved. * STILL NOT REVIEWED. Modified Paths: -------------- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputDataProvider.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/config.properties Added Paths: ----------- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/OutputDataProvider.java Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputDataProvider.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputDataProvider.java 2009-08-06 14:02:35 UTC (rev 914) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/InputDataProvider.java 2009-08-06 15:12:31 UTC (rev 915) @@ -4,4 +4,6 @@ public interface InputDataProvider { public InputDataItem[] getInputDataItems(); + + public String formServicePropertiesInputDataString(); } \ No newline at end of file Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/OutputDataProvider.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/OutputDataProvider.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/OutputDataProvider.java 2009-08-06 15:12:31 UTC (rev 915) @@ -0,0 +1,10 @@ +package org.cishell.templates.staticexecutable.providers; + +import org.cishell.templates.wizards.staticexecutable.OutputDataItem; + +public interface OutputDataProvider { + public OutputDataItem[] getOutputDataItems(); + + public String formServicePropertiesOutputDataString(); + public String formConfigPropertiesOutFilesString(); +} \ No newline at end of file Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java 2009-08-06 14:02:35 UTC (rev 914) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java 2009-08-06 15:12:31 UTC (rev 915) @@ -3,6 +3,7 @@ import java.util.Map; import org.cishell.templates.guibuilder.BuilderDelegate; +import org.cishell.templates.guibuilder.EditableAttributeDefinition; import org.cishell.templates.guibuilder.ListBuilder; import org.cishell.templates.wizards.staticexecutable.InputDataItem; import org.cishell.templates.wizards.staticexecutable.StaticExecutableInputDataDelegate; @@ -13,6 +14,7 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.TableItem; @@ -44,16 +46,16 @@ } public InputDataItem[] getInputDataItems() { - TableItem[] tableItems = this.listBuilder.getTable().getItems(); - InputDataItem[] inputDataItems = new InputDataItem[tableItems.length]; - Map idToInputDataItemMap = this.delegate.getIDToInputDataItemMap(); - - for (int ii = 0; ii < tableItems.length; ii++) { - inputDataItems[ii] = (InputDataItem) - idToInputDataItemMap.get(tableItems[ii].getText(0)); - } - - return inputDataItems; + Display display = Display.getDefault(); + + if (display != null) { + GetInputDataAction action = new GetInputDataAction(); + display.syncExec(action); + + return action.inputDataItems; + } else { + return new InputDataItem[0]; + } } private Layout createLayoutForThis() { @@ -94,4 +96,19 @@ return new Font(device, newFontData); } + + private class GetInputDataAction implements Runnable { + InputDataItem[] inputDataItems; + + public void run() { + TableItem[] tableItems = listBuilder.getTable().getItems(); + inputDataItems = new InputDataItem[tableItems.length]; + Map idToInputDataItemMap = delegate.getIDToInputDataItemMap(); + + for (int ii = 0; ii < tableItems.length; ii++) { + inputDataItems[ii] = (InputDataItem) + idToInputDataItemMap.get(tableItems[ii].getText(0)); + } + } + } } \ No newline at end of file Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java 2009-08-06 14:02:35 UTC (rev 914) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java 2009-08-06 15:12:31 UTC (rev 915) @@ -1,7 +1,11 @@ package org.cishell.templates.wizards.pagepanels; +import java.util.Map; + import org.cishell.templates.guibuilder.BuilderDelegate; import org.cishell.templates.guibuilder.ListBuilder; +import org.cishell.templates.wizards.staticexecutable.InputDataItem; +import org.cishell.templates.wizards.staticexecutable.OutputDataItem; import org.cishell.templates.wizards.staticexecutable.StaticExecutableOutputDataDelegate; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Device; @@ -10,14 +14,16 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Layout; +import org.eclipse.swt.widgets.TableItem; public class AddOutputDataPanel extends Composite { public static final String OUTPUT_DATA_LABEL_TEXT = "Output Data"; private ListBuilder listBuilder; - private BuilderDelegate delegate; + private StaticExecutableOutputDataDelegate delegate; public AddOutputDataPanel(Composite parent, int style) { super(parent, style); @@ -40,6 +46,19 @@ return this.delegate; } + public OutputDataItem[] getOutputDataItems() { + Display display = Display.getDefault(); + + if (display != null) { + GetOutputDataAction action = new GetOutputDataAction(); + display.syncExec(action); + + return action.inputDataItems; + } else { + return new OutputDataItem[0]; + } + } + private Layout createLayoutForThis() { GridLayout layout = new GridLayout(6, true); @@ -76,4 +95,19 @@ return new Font(device, newFontData); } + + private class GetOutputDataAction implements Runnable { + OutputDataItem[] inputDataItems; + + public void run() { + TableItem[] tableItems = listBuilder.getTable().getItems(); + inputDataItems = new OutputDataItem[tableItems.length]; + Map idToInputDataItemMap = delegate.getIDToOutputDataItemMap(); + + for (int ii = 0; ii < tableItems.length; ii++) { + inputDataItems[ii] = (OutputDataItem) + idToInputDataItemMap.get(tableItems[ii].getText(0)); + } + } + } } \ No newline at end of file Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java 2009-08-06 14:02:35 UTC (rev 914) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java 2009-08-06 15:12:31 UTC (rev 915) @@ -1,9 +1,11 @@ package org.cishell.templates.wizards.pages; import org.cishell.templates.staticexecutable.providers.InputDataProvider; +import org.cishell.templates.staticexecutable.providers.OutputDataProvider; import org.cishell.templates.wizards.pagepanels.AddInputDataPanel; import org.cishell.templates.wizards.pagepanels.AddOutputDataPanel; import org.cishell.templates.wizards.staticexecutable.InputDataItem; +import org.cishell.templates.wizards.staticexecutable.OutputDataItem; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; @@ -12,7 +14,7 @@ import org.eclipse.swt.widgets.Layout; public class SpecifyInAndOutDataPage extends WizardPage - implements InputDataProvider { + implements InputDataProvider, OutputDataProvider { private AddInputDataPanel addInputDataPanel; private AddOutputDataPanel addOutputDataPanel; @@ -69,4 +71,72 @@ public InputDataItem[] getInputDataItems() { return this.addInputDataPanel.getInputDataItems(); } + + public String formServicePropertiesInputDataString() { + InputDataItem[] inputDataItems = getInputDataItems(); + + StringBuffer inputDataStringInProgress = new StringBuffer(); + + if (inputDataItems.length != 0) { + inputDataStringInProgress.append( + "file:" + inputDataItems[0].getMimeType()); + + for (int ii = 1; ii < inputDataItems.length; ii++) { + inputDataStringInProgress.append( + ",file:" + inputDataItems[0].getMimeType()); + } + } + + String inputDataString = inputDataStringInProgress.toString(); + + return inputDataString; + } + + public OutputDataItem[] getOutputDataItems() { + return this.addOutputDataPanel.getOutputDataItems(); + } + + public String formServicePropertiesOutputDataString() { + OutputDataItem[] outputDataItems = getOutputDataItems(); + + StringBuffer outputDataStringInProgress = new StringBuffer(); + + if (outputDataItems.length != 0) { + outputDataStringInProgress.append( + "file:" + outputDataItems[0].getMimeType()); + + for (int ii = 1; ii < outputDataItems.length; ii++) { + outputDataStringInProgress.append( + ",file:" + outputDataItems[0].getMimeType()); + } + } + + String outputDataString = outputDataStringInProgress.toString(); + + return outputDataString; + } + + public String formConfigPropertiesOutFilesString() { + OutputDataItem[] outputDataItems = getOutputDataItems(); + + StringBuffer outputFilesStringInProgress = new StringBuffer(); + + for (int ii = 0; ii < outputDataItems.length; ii++) { + String outFileBase = "outFile[" + ii + "]"; + outputFilesStringInProgress.append( + outFileBase + "=" + outputDataItems[ii].getFileName() + "\n"); + outputFilesStringInProgress.append( + outFileBase + ".label=" + + outputDataItems[ii].getLabel() + + "\n"); + outputFilesStringInProgress.append( + outFileBase + ".type=" + + outputDataItems[ii].getDataType() + + "\n"); + } + + String outputDataString = outputFilesStringInProgress.toString(); + + return outputDataString; + } } \ No newline at end of file Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java 2009-08-06 14:02:35 UTC (rev 914) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java 2009-08-06 15:12:31 UTC (rev 915) @@ -13,6 +13,8 @@ * ***************************************************************************/ package org.cishell.templates.wizards.staticexecutable; +import java.io.BufferedWriter; +import java.io.FileWriter; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -137,6 +139,15 @@ public static final String REMOTABLE_LABEL = "Remotable?"; public static final boolean DEFAULT_REMOTABLE_VALUE = true; + public static final String IN_DATA_ID = "inData"; + public static final String HAS_IN_DATA_ID = "hasInData"; + + public static final String OUT_DATA_ID = "outData"; + public static final String HAS_OUT_DATA_ID = "hasOutData"; + public static final String OUT_FILES_ID = "outFiles"; + public static final String OUT_FILE_LABELS_ID = "outFileLabels"; + public static final String OUT_FILE_TYPES_ID = "outFileTypes"; + public static final String BASE_EXECUTABLE_FILE_OPTION_NAME = "executableFileOption"; public static final String BASE_RELATED_FILE_OPTION_NAME = @@ -223,7 +234,44 @@ handleEmptyOption(REFERENCE_URL_ID, HAS_REFERENCE_URL_ID, ""); handleEmptyOption(DOCUMENTATION_URL_ID, HAS_DOCUMENTATION_URL_ID, ""); handleEmptyOption(WRITTEN_IN_ID, HAS_WRITTEN_IN_ID, ""); - + + // Project Parameters Page + + setValue("attributeDefinitions", + this.projectParametersPage.toOutputString()); + + // In and Out Data Page + try{ + addOption(IN_DATA_ID, + "", + this.inputAndOutputDataPage. + formServicePropertiesInputDataString(), + SPECIFY_INPUT_AND_OUTPUT_DATA_PAGE_NUMBER); + handleEmptyOption(IN_DATA_ID, HAS_IN_DATA_ID, ""); + + addOption(OUT_DATA_ID, + "", + this.inputAndOutputDataPage. + formServicePropertiesOutputDataString(), + SPECIFY_INPUT_AND_OUTPUT_DATA_PAGE_NUMBER); + handleEmptyOption(OUT_DATA_ID, HAS_OUT_DATA_ID, ""); + + addOption(OUT_FILES_ID, + "", + this.inputAndOutputDataPage. + formConfigPropertiesOutFilesString(), + SPECIFY_INPUT_AND_OUTPUT_DATA_PAGE_NUMBER); + } + catch (Exception e1) { + try { + FileWriter fstream = new FileWriter("C:/Documents and Settings/pataphil/Desktop/out.txt", true); + BufferedWriter out = new BufferedWriter(fstream); + out.write("exception: \'" + e1.toString() + "\'\n"); + out.close(); + } catch (Exception e) { + System.err.println("Error: " + e.getMessage()); + } + } super.execute(project, model, monitor); } @@ -440,7 +488,8 @@ private void handleEmptyOption( String optionID, String isEmptyOptionID, String compareTo) { - if (getOption(optionID).getValue().toString().equals(compareTo)) { + if (getOption(optionID).getValue() == null || + getOption(optionID).getValue().toString().equals(compareTo)) { setValue(isEmptyOptionID, "#"); } else { setValue(isEmptyOptionID, ""); Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java 2009-08-06 14:02:35 UTC (rev 914) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java 2009-08-06 15:12:31 UTC (rev 915) @@ -38,6 +38,10 @@ public Composite getParent() { return this.parent; } + + public Map getIDToOutputDataItemMap() { + return this.idToOutputDataItemMap; + } public String[] createItem() { OutputDataItem outputDataItem = new OutputDataItem(); Modified: trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/config.properties =================================================================== --- trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/config.properties 2009-08-06 14:02:35 UTC (rev 914) +++ trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/config.properties 2009-08-06 15:12:31 UTC (rev 915) @@ -1,5 +1,3 @@ executable=$executableName$ template=$${executable} $templateString$ $outFiles$ -$outFileLabels$ -$outFileTypes$ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-08-06 16:27:00
|
Revision: 916 http://cishell.svn.sourceforge.net/cishell/?rev=916&view=rev Author: pataphil Date: 2009-08-06 16:26:46 +0000 (Thu, 06 Aug 2009) Log Message: ----------- * Fixed some bugs. * STILL NOT REVIEWED. Modified Paths: -------------- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/service.properties trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/build.xml trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/gui.xml Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java 2009-08-06 15:12:31 UTC (rev 915) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java 2009-08-06 16:26:46 UTC (rev 916) @@ -65,7 +65,7 @@ " (" + inputParameters[ii].getDescription() + ")"; - String value = "\"${" + inputParameters[ii].getName() + "}\""; + String value = "\"${" + inputParameters[ii].getID() + "}\""; addTableItem(label, value); } Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java 2009-08-06 15:12:31 UTC (rev 915) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java 2009-08-06 16:26:46 UTC (rev 916) @@ -85,6 +85,7 @@ public static final String MENU_PATH_ID = "menuPath"; public static final String MENU_PATH_LABEL = "Menu Path (Optional)"; public static final String DEFAULT_MENU_PATH = "menu_path"; + public static final String FULL_MENU_PATH = "fullMenuPath"; public static final String MENU_GROUP_ID = "menuGroup"; public static final String MENU_GROUP_LABEL = "Menu Item Placement"; @@ -142,6 +143,9 @@ public static final String IN_DATA_ID = "inData"; public static final String HAS_IN_DATA_ID = "hasInData"; + public static final String ATTRIBUTE_DEFINITIONS_ID = + "attributeDefinitions"; + public static final String OUT_DATA_ID = "outData"; public static final String HAS_OUT_DATA_ID = "hasOutData"; public static final String OUT_FILES_ID = "outFiles"; @@ -235,9 +239,28 @@ handleEmptyOption(DOCUMENTATION_URL_ID, HAS_DOCUMENTATION_URL_ID, ""); handleEmptyOption(WRITTEN_IN_ID, HAS_WRITTEN_IN_ID, ""); + String menuPath = (String)getValue(MENU_PATH_ID); + if (!menuPath.endsWith("/")) { + menuPath += "/"; + } + + String choice = (String)getOption(MENU_GROUP_ID).getValue(); + + for (int ii = 0; ii < GROUP_CHOICES.length; ii++) { + if (GROUP_CHOICES[ii][1].equals(choice) || + GROUP_CHOICES[ii][0].equals(choice)) { + menuPath += GROUP_CHOICES[ii][0]; + + break; + } + + } + + setValue(FULL_MENU_PATH, menuPath); + // Project Parameters Page - setValue("attributeDefinitions", + setValue(ATTRIBUTE_DEFINITIONS_ID, this.projectParametersPage.toOutputString()); // In and Out Data Page Modified: trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/service.properties =================================================================== --- trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/service.properties 2009-08-06 15:12:31 UTC (rev 915) +++ trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/service.properties 2009-08-06 16:26:46 UTC (rev 916) @@ -1,7 +1,7 @@ service.pid=$bundleSymbolicName$ $hasInData$in_data=$inData$ $hasOutData$out_data=$outData$ -$isOnMenu$menu_path=$menuPath$ +$isOnMenu$menu_path=$fullMenuPath$ $hasLabel$label=$label$ $hasDescription$description=$description$ $hasImplementers$implementers=$implementers$ Modified: trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/build.xml =================================================================== --- trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/build.xml 2009-08-06 15:12:31 UTC (rev 915) +++ trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/build.xml 2009-08-06 16:26:46 UTC (rev 916) @@ -1,56 +1,55 @@ -<!-- This file in almost all cases will not need edited --> -<project name="Static Executable Integration Template" basedir="." default="compile"> - <property file="manifest.properties"/> - - <property name="repository.dir" value="${basedir}"/> - <property name="build.dir" value="${repository.dir}/build"/> - <property name="lib.dir" value="${repository.dir}/lib"/> - <property name="out.dir" value="${build.dir}/out"/> - <property name="global.properties" value="${repository.dir}/manifest.properties"/> - <property name="gui.file" value="${repository.dir}/gui.xml"/> - <property name="dest.gui.file" value="${out.dir}/OSGI-INF/metatype/METADATA.XML"/> - <property name="l10n.dir" value="${repository.dir}/l10n" /> - <property name="dest.l10n.dir" value="${out.dir}/OSGI-INF/l10n"/> - <property name="template.file" value="${lib.dir}/component.xml"/> - - <target name="compile" depends="copy.files" - description="Compile an OSGi Bundle of the Static Executable"> - - <createManifest basedir="${out.dir}" - baseproperties="${global.properties}" - template="${template.file}"/> - - <copy file="${gui.file}" tofile="${dest.gui.file}" failonerror="false"/> - - <copy todir="${dest.l10n.dir}"> - <fileset dir="${l10n.dir}"/> - </copy> - - <jar destfile="${build.dir}/${Bundle-SymbolicName}_${Bundle-Version}.jar" - basedir="${out.dir}" manifest="${out.dir}/META-INF/MANIFEST.MF"/> - </target> - - <target name="copy.files" description="Copying files" depends="tasks.init"> - <copy todir="${out.dir}"> - <fileset dir="${repository.dir}"> - <include name="**/*"/> - <exclude name="${lib.dir},${build.dir},${l10n.dir}"/> - <exclude name="l10n/**/*"/> - <exclude name="build/**/*"/> - <exclude name="lib/**/*"/> - <exclude name="src/**/*"/> - <exclude name="*"/> - </fileset> - </copy> - </target> - - <target name="tasks.init" description="Initialize TaskDefinitions"> - <taskdef name="createManifest" - classname="org.cishell.templates.staticexecutable.StaticExecutableIntegrationTask" - classpath="${lib.dir}/cishell_templates.jar"/> - </target> - - <target name="clean" description="Clean build directory"> - <delete dir="${build.dir}"/> - </target> +<!-- This file in almost all cases will not need edited --> +<project name="Static Executable Integration Template" basedir="." default="compile"> + <property file="manifest.properties"/> + + <property name="repository.dir" value="${basedir}"/> + <property name="build.dir" value="${repository.dir}/build"/> + <property name="lib.dir" value="${repository.dir}/lib"/> + <property name="out.dir" value="${build.dir}/out"/> + <property name="global.properties" value="${repository.dir}/manifest.properties"/> + <property name="gui.file" value="${repository.dir}/gui.xml"/> + <property name="dest.gui.file" value="${out.dir}/OSGI-INF/metatype/METADATA.XML"/> + <property name="l10n.dir" value="${repository.dir}/l10n" /> + <property name="dest.l10n.dir" value="${out.dir}/OSGI-INF/l10n"/> + <property name="template.file" value="${lib.dir}/component.xml"/> + + <target name="compile" depends="copy.files" + description="Compile an OSGi Bundle of the Static Executable"> + + <createManifest basedir="${out.dir}" + baseproperties="${global.properties}" + template="${template.file}"/> + + <copy file="${gui.file}" tofile="${dest.gui.file}" failonerror="false"/> + + <copy todir="${dest.l10n.dir}"> + <fileset dir="${l10n.dir}"/> + </copy> + + <jar destfile="${build.dir}/${Bundle-SymbolicName}_${Bundle-Version}.jar" + basedir="${out.dir}" manifest="${out.dir}/META-INF/MANIFEST.MF"/> + </target> + + <target name="copy.files" description="Copying files" depends="tasks.init"> + <copy todir="${out.dir}"> + <fileset dir="${repository.dir}"> + <include name="**/*"/> + <exclude name="${lib.dir},${build.dir},${l10n.dir}"/> + <exclude name="l10n/**/*"/> + <exclude name="build/**/*"/> + <exclude name="lib/**/*"/> + <exclude name="*"/> + </fileset> + </copy> + </target> + + <target name="tasks.init" description="Initialize TaskDefinitions"> + <taskdef name="createManifest" + classname="org.cishell.templates.staticexecutable.StaticExecutableIntegrationTask" + classpath="${lib.dir}/cishell_templates.jar"/> + </target> + + <target name="clean" description="Clean build directory"> + <delete dir="${build.dir}"/> + </target> </project> \ No newline at end of file Modified: trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/gui.xml =================================================================== --- trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/gui.xml 2009-08-06 15:12:31 UTC (rev 915) +++ trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/gui.xml 2009-08-06 16:26:46 UTC (rev 916) @@ -1,12 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> -<!-- SAMPLE - <OCD name="$bundleName$" id="$bundleSymbolicName$.OCD" + <OCD name="$bundleName$" id="$bundleSymbolicName$.gui" description="$description$"> $attributeDefinitions$ </OCD> <Designate pid="$bundleSymbolicName$"> <Object ocdref="$bundleSymbolicName$.gui" /> </Designate> - --> </metatype:MetaData> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-08-13 18:42:33
|
Revision: 918 http://cishell.svn.sourceforge.net/cishell/?rev=918&view=rev Author: pataphil Date: 2009-08-13 18:42:24 +0000 (Thu, 13 Aug 2009) Log Message: ----------- * Added the choose source code files page. * Had entire code base for the wizard reviewed by Chintan. * Attempted to comment code well. Modified Paths: -------------- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOption.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOptionProvider.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SetupPlatformsPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseExecutableFilesPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyTemplateStringPage.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItem.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItemEditor.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmWizard.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItem.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItemEditor.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableInputDataDelegate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseExecutableFileWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseFileWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseRelatedFilesWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupHeaderWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupWidget.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ResizeCompositeHackWidget.java Added Paths: ----------- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/ChooseSourceCodeFilesPanel.java trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseSourceCodeFilesPage.java trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/src/ Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOption.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOption.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOption.java 2009-08-13 18:42:24 UTC (rev 918) @@ -1,11 +1,24 @@ package org.cishell.templates.staticexecutable.providers; import org.eclipse.pde.ui.templates.BaseOptionTemplateSection; -import org.eclipse.pde.ui.templates.StringOption; +import org.eclipse.pde.ui.templates.TemplateOption; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; -public class PlatformOption extends StringOption { +public class PlatformOption extends TemplateOption { + public final static int DEFAULT_STYLE = SWT.SINGLE | SWT.BORDER; + private String platformName; private String platformPath; + private Text textWidget; + private Label labelWidget; + private boolean shouldIgnoreListener; + private int style; public PlatformOption(BaseOptionTemplateSection section, String name, @@ -14,6 +27,9 @@ String platformPath) { super(section, name, label); + this.style = DEFAULT_STYLE; + setRequired(true); + this.platformName = platformName; this.platformPath = platformPath; } @@ -25,4 +41,86 @@ public String getPlatformPath() { return this.platformPath; } + + public void setReadOnly(boolean readOnly) { + if (readOnly) { + this.style = DEFAULT_STYLE | SWT.READ_ONLY; + } else { + this.style = DEFAULT_STYLE; + } + } + + public String getText() { + if (getValue() != null) { + return getValue().toString(); + } else { + return null; + } + } + + public void setText(String newText) { + setValue(newText); + } + + public void setValue(Object value) { + super.setValue(value); + + if (this.textWidget != null) { + this.shouldIgnoreListener = true; + String textValue = getText(); + + if (textValue != null) { + this.textWidget.setText(textValue); + } else { + this.textWidget.setText(""); + } + + this.shouldIgnoreListener = false; + } + } + + public void createControl(Composite parent, int span) { + this.labelWidget = createLabel(parent, 1); + this.labelWidget.setEnabled(isEnabled()); + this.textWidget = new Text(parent, style); + + if (getValue() != null) { + this.textWidget.setText(getValue().toString()); + } + + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.horizontalSpan = span - 1; + this.textWidget.setLayoutData(gridData); + this.textWidget.setEnabled(isEnabled()); + + this.textWidget.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent modifyEvent) { + if (PlatformOption.this.shouldIgnoreListener) { + return; + } + + PlatformOption.super.setValue( + PlatformOption.this.textWidget.getText()); + getSection().validateOptions(PlatformOption.this); + } + }); + } + + public boolean isEmpty() { + if (getValue() == null || + getValue().toString().length() == 0) { + return false; + } else { + return true; + } + } + + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + + if (this.labelWidget != null) { + this.labelWidget.setEnabled(enabled); + this.textWidget.setEnabled(enabled); + } + } } \ No newline at end of file Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOptionProvider.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOptionProvider.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/staticexecutable/providers/PlatformOptionProvider.java 2009-08-13 18:42:24 UTC (rev 918) @@ -1,5 +1,7 @@ package org.cishell.templates.staticexecutable.providers; +import org.eclipse.pde.ui.templates.TemplateOption; + public interface PlatformOptionProvider { public PlatformOption getExecutableFileOption(String platformName); public PlatformOption[] getExecutableFileOptions(); @@ -10,7 +12,7 @@ public PlatformOption[] getRelatedFileOptions(String platformName); public void addRelatedFileOption(PlatformOption relatedFileOption); - public void removeRelatedFileOption(PlatformOption relatedFileOption); + public void removeRelatedFileOption(TemplateOption relatedFileOption); public PlatformOption createRelatedFileOption( String platformName, String platformPath); public String formRelatedFileOptionName(String platformName); Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddInputDataPanel.java 2009-08-13 18:42:24 UTC (rev 918) @@ -3,7 +3,6 @@ import java.util.Map; import org.cishell.templates.guibuilder.BuilderDelegate; -import org.cishell.templates.guibuilder.EditableAttributeDefinition; import org.cishell.templates.guibuilder.ListBuilder; import org.cishell.templates.wizards.staticexecutable.InputDataItem; import org.cishell.templates.wizards.staticexecutable.StaticExecutableInputDataDelegate; @@ -19,6 +18,18 @@ import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.TableItem; +/* + * This panel provides the user an interface for managing input data via + * org.cishell.templates.guibuilder.ListBuilder, an appropriate delegate + * (org.cishell.templates.wizards.staticexecutable. + * StaticExecutableInputDataDelegate), and an appropriate editor + * (org.cishell.templates.wizards.staticexecutable.InputDataItemEditor). + * The ListBuilder manages the GUI table and associated buttons. + * The delegate provides the ListBuilder and editor the appropriate columns + * that represent the data items being managed. It also stores the input data + * items. + * The editor provides an interface for the user to edit the actual data items. + */ public class AddInputDataPanel extends Composite { public static final String INPUT_DATA_LABEL_TEXT = "Input Data"; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/AddOutputDataPanel.java 2009-08-13 18:42:24 UTC (rev 918) @@ -4,7 +4,6 @@ import org.cishell.templates.guibuilder.BuilderDelegate; import org.cishell.templates.guibuilder.ListBuilder; -import org.cishell.templates.wizards.staticexecutable.InputDataItem; import org.cishell.templates.wizards.staticexecutable.OutputDataItem; import org.cishell.templates.wizards.staticexecutable.StaticExecutableOutputDataDelegate; import org.eclipse.swt.SWT; @@ -19,6 +18,18 @@ import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.TableItem; +/* + * This panel provides the user an interface for managing output data via + * org.cishell.templates.guibuilder.ListBuilder, an appropriate delegate + * (org.cishell.templates.wizards.staticexecutable. + * StaticExecutableOutputDataDelegate), and an appropriate editor + * (org.cishell.templates.wizards.staticexecutable.OutputDataItemEditor). + * The ListBuilder manages the GUI table and associated buttons. + * The delegate provides the ListBuilder and editor the appropriate columns + * that represent the data items being managed. It also stores the output + * data items. + * The editor provides an interface for the user to edit the actual data items. + */ public class AddOutputDataPanel extends Composite { public static final String OUTPUT_DATA_LABEL_TEXT = "Output Data"; Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/ChooseSourceCodeFilesPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/ChooseSourceCodeFilesPanel.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/ChooseSourceCodeFilesPanel.java 2009-08-13 18:42:24 UTC (rev 918) @@ -0,0 +1,37 @@ +package org.cishell.templates.wizards.pagepanels; + +import org.cishell.templates.wizards.widgets.ChooseFileWidget; +import org.eclipse.pde.ui.templates.TemplateOption; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Layout; + +/* + */ +public class ChooseSourceCodeFilesPanel extends Composite { + public ChooseSourceCodeFilesPanel( + Composite parent, + int style, + TemplateOption sourceCodeFilesLocationOption) { + super(parent, style); + + setLayout(createLayoutForThis()); + createChooseSourceCodeFilesWidget(sourceCodeFilesLocationOption); + } + + private Layout createLayoutForThis() { + GridLayout layout = new GridLayout(3, true); + layout.makeColumnsEqualWidth = false; + + return layout; + } + + private void createChooseSourceCodeFilesWidget( + TemplateOption sourceCodeFilesLocationOption) { + int parentWidth = + this.getParent().computeSize(SWT.DEFAULT, SWT.DEFAULT).x; + ChooseFileWidget fileSelector = new ChooseFileWidget( + this, SWT.NONE, false, parentWidth, sourceCodeFilesLocationOption); + } +} Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SetupPlatformsPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SetupPlatformsPanel.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SetupPlatformsPanel.java 2009-08-13 18:42:24 UTC (rev 918) @@ -15,12 +15,16 @@ import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.Text; +/* + * This panel contains several platform setup widgets + * (org.cishell.templates.wizards.widgets.PlatformSetupWidget). There is one + * platform setup widget per (operating system) platform and a special + * platform setup widget for files common to all (operating system) platforms. + */ public class SetupPlatformsPanel extends ResizeCompositeHackWidget { public static final String SPECIFY_EXECUTABLE_NAME_LABEL = "Executable Name"; - // public static final int SPECIFY_EXECUTABLE_NAME_TEXT_WIDTH = 350; - private ArrayList platformSetupWidgets; public SetupPlatformsPanel(Composite parent, @@ -52,22 +56,6 @@ executableNameOption.createControl(this, 2); } - private void createSpecifyExecutableNameLabel() { - Label specifyExecutableNameLabel = new Label(this, SWT.NONE); - specifyExecutableNameLabel.setLayoutData( - createSpecifyExecutableNameLableLayoutData()); - specifyExecutableNameLabel.setText( - SPECIFY_EXECUTABLE_NAME_LABEL + ":"); - } - - private Text createSpecifyExecutableNameText() { - Text specifyExecutableNameText = new Text(this, SWT.BORDER); - specifyExecutableNameText.setLayoutData( - createSpecifyExecutableNameTextLayoutData()); - - return specifyExecutableNameText; - } - private ArrayList createPlatformSetupWidgets( PlatformOptionProvider platformOptionProvider) { ArrayList platformSetupWidgets = new ArrayList(); @@ -103,21 +91,6 @@ return platformSetupWidgets; } - private Object createSpecifyExecutableNameLableLayoutData() { - GridData data = new GridData(); - - return data; - } - - private Object createSpecifyExecutableNameTextLayoutData() { - GridData data = new GridData(); - data.horizontalAlignment = SWT.FILL; - data.grabExcessHorizontalSpace = true; - // data.widthHint = SPECIFY_EXECUTABLE_NAME_TEXT_WIDTH; - - return data; - } - private Object createPlatformSetupWidgetLayoutData() { GridData data = new GridData(); data.horizontalAlignment = SWT.FILL; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pagepanels/SpecifyTemplateStringPanel.java 2009-08-13 18:42:24 UTC (rev 918) @@ -16,9 +16,10 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; import org.osgi.service.metatype.AttributeDefinition; +/* + */ public class SpecifyTemplateStringPanel extends Composite implements SelectionListener { public static final String PLACEHOLDER_LABEL = @@ -100,11 +101,13 @@ createPlaceholderTableLabelLayoutData()); placeholderTableLabel.setText(PLACEHOLDER_LABEL); - Label insertButtonLabel = new Label(this, SWT.NONE); - insertButtonLabel.setLayoutData( + // This is to keep the layout manager happy and make everything line up + // the way it should. + Label dummyLabel = new Label(this, SWT.NONE); + dummyLabel.setLayoutData( createInsertPlaceholderButtonLayoutData()); - insertButtonLabel.setText(INSERT_PLACEHOLDER_BUTTON_LABEL); - insertButtonLabel.setVisible(false); + dummyLabel.setText(INSERT_PLACEHOLDER_BUTTON_LABEL); + dummyLabel.setVisible(false); // To accomodate for the option label control. new Label(this, SWT.NONE).setLayoutData(new GridData()); Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseExecutableFilesPage.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseExecutableFilesPage.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseExecutableFilesPage.java 2009-08-13 18:42:24 UTC (rev 918) @@ -10,6 +10,13 @@ import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.widgets.Composite; +/* + * This page allows users to specify the name of the executable file (which + * should be the same across all platforms), the actual executable files for + * the various platforms, and the related files for the various platforms. + * The logic for this page is spread out in several locations, but for a start, + * check org.cishell.templates.wizards.pagepanels.SetupPlatformsPanel . + */ public class ChooseExecutableFilesPage extends WizardPage { private SetupPlatformsPanel setupPlatformsPanel; private TemplateOption executableNameOption; Added: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseSourceCodeFilesPage.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseSourceCodeFilesPage.java (rev 0) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ChooseSourceCodeFilesPage.java 2009-08-13 18:42:24 UTC (rev 918) @@ -0,0 +1,31 @@ +package org.cishell.templates.wizards.pages; + +import org.cishell.templates.wizards.pagepanels.ChooseSourceCodeFilesPanel; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.pde.ui.templates.TemplateOption; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; + +/* + * This page allows algorithm creators to choose a single file that is intended + * to be an archive file containing their algorithm source code. + */ +public class ChooseSourceCodeFilesPage extends WizardPage { + private ChooseSourceCodeFilesPanel chooseSourceCodeFilesPanel; + private TemplateOption sourceCodeFilesLocationOption; + + public ChooseSourceCodeFilesPage( + String pageName, + TemplateOption sourceCodeFilesLocationOption) { + super(pageName); + + this.sourceCodeFilesLocationOption = sourceCodeFilesLocationOption; + } + + public void createControl(Composite parent) { + this.chooseSourceCodeFilesPanel = new ChooseSourceCodeFilesPanel( + parent, SWT.NONE, this.sourceCodeFilesLocationOption); + + setControl(this.chooseSourceCodeFilesPanel); + } +} \ No newline at end of file Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/ParameterListBuilderPage.java 2009-08-13 18:42:24 UTC (rev 918) @@ -27,7 +27,10 @@ import org.eclipse.swt.widgets.Shell; import org.osgi.service.metatype.AttributeDefinition; - +/* + * This page provides algorithm creators with an interface for specifying the + * GUI-based input parameters that their algorithms accept. + */ public class ParameterListBuilderPage extends WizardPage implements InputParameterProvider { ParameterListBuilder builder; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyInAndOutDataPage.java 2009-08-13 18:42:24 UTC (rev 918) @@ -13,6 +13,13 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Layout; +/* + * This page allows users the specify input and output data. + * Input data is handled in + * org.cishell.templates.wizards.pagepanels.AddInputDataPanel, and output data + * is handled in + * org.cishell.templates.wizards.pagepanels.AddOutputDataPanel. + */ public class SpecifyInAndOutDataPage extends WizardPage implements InputDataProvider, OutputDataProvider { private AddInputDataPanel addInputDataPanel; @@ -42,19 +49,19 @@ return layout; } - private AddInputDataPanel createAndSetupInputDataPanel(Composite container, - final Composite parent) { + private AddInputDataPanel createAndSetupInputDataPanel( + Composite container, final Composite parent) { AddInputDataPanel addInputDataPanel = - new AddInputDataPanel(container, SWT.BORDER); + new AddInputDataPanel(container, SWT.NONE); addInputDataPanel.setLayoutData(createPanelLayoutData()); return addInputDataPanel; } - private AddOutputDataPanel createAndSetupOutputDataPanel(Composite container, - final Composite parent) { + private AddOutputDataPanel createAndSetupOutputDataPanel( + Composite container, final Composite parent) { AddOutputDataPanel addOutputDataPanel = - new AddOutputDataPanel(container, SWT.BORDER); + new AddOutputDataPanel(container, SWT.NONE); addOutputDataPanel.setLayoutData(createPanelLayoutData()); return addOutputDataPanel; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyTemplateStringPage.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyTemplateStringPage.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/pages/SpecifyTemplateStringPage.java 2009-08-13 18:42:24 UTC (rev 918) @@ -8,6 +8,14 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; +/* + * This page provides algorithm creators with a list of possible "placeholders" + * that can be used in the template string. + * The template string is the string used when invoking the static executable + * on the command line. As such, it specifies all program arguments. + * The placeholders possible are the input data items and algorithm parameters + * that the algorithm creator specified. + */ public class SpecifyTemplateStringPage extends WizardPage { private SpecifyTemplateStringPanel specifyTemplateStringPanel; private InputParameterProvider inputParameterProvider; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItem.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItem.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItem.java 2009-08-13 18:42:24 UTC (rev 918) @@ -1,5 +1,11 @@ package org.cishell.templates.wizards.staticexecutable; +/* + * For static executable algorithms, input data items are always files, and + * they are always referred to by an index (as opposed to an ID). + * Thus, input data items only contain mime types and a position, and the + * position is determined by the delegate. + */ public class InputDataItem { String mimeType; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItemEditor.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItemEditor.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/InputDataItemEditor.java 2009-08-13 18:42:24 UTC (rev 918) @@ -10,6 +10,10 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +/* + * This editor provides the user with an interface to edit input data items + * (InputDataItem). + */ public class InputDataItemEditor extends Dialog { private Text mimeTypeText; private InputDataItem inputDataItem; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmTemplate.java 2009-08-13 18:42:24 UTC (rev 918) @@ -13,8 +13,6 @@ * ***************************************************************************/ package org.cishell.templates.wizards.staticexecutable; -import java.io.BufferedWriter; -import java.io.FileWriter; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -23,6 +21,7 @@ import org.cishell.templates.staticexecutable.providers.PlatformOptionProvider; import org.cishell.templates.wizards.BasicTemplate; import org.cishell.templates.wizards.pages.ChooseExecutableFilesPage; +import org.cishell.templates.wizards.pages.ChooseSourceCodeFilesPage; import org.cishell.templates.wizards.pages.ParameterListBuilderPage; import org.cishell.templates.wizards.pages.SpecifyInAndOutDataPage; import org.cishell.templates.wizards.pages.SpecifyTemplateStringPage; @@ -57,6 +56,8 @@ "specifyInAndOutDataPage"; public static final String SPECIFY_TEMPLATE_STRING_PAGE_ID = "specifyTemplateStringPage"; + public static final String CHOOSE_SOURCE_CODE_FILES_PAGE_ID = + "chooseSoureCodeFilesPage"; public static final String BUNDLE_NAME_ID = "bundleName"; public static final String BUNDLE_NAME_LABEL = "Bundle Name"; @@ -171,6 +172,10 @@ public static final String TEMPLATE_STRING_LABEL = ""; public static final String DEFAULT_TEMPLATE_STRING = ""; + public static final String CHOOSE_SOURCE_CODE_FILES_ID = "sourceCodeFiles"; + public static final String CHOOSE_SOURCE_CODE_FILES_LABEL = + "Choose an archive file that contains your source code files"; + public static final String[][] GROUP_CHOICES = new String[][] { { MENU_START_LABEL, MENU_START_DESCRIPTION }, { MENU_ADDITIONS_LABEL, MENU_ADDITIONS_DESCRIPTION }, @@ -178,19 +183,20 @@ }; private WizardNewProjectCreationPage createProjectPage; + private WizardPage bundlePropertiesPage; private ChooseExecutableFilesPage chooseExecutableFilesPage; - private WizardPage bundlePropertiesPage; private WizardPage projectPropertiesPage; private ParameterListBuilderPage projectParametersPage; private SpecifyInAndOutDataPage inputAndOutputDataPage; private SpecifyTemplateStringPage specifyTemplateStringPage; - private WizardPage sourceCodeFilesPage; + private ChooseSourceCodeFilesPage sourceCodeFilesPage; private TemplateOption executableNameOption; private Map platformExecutableOptions = new HashMap(); private MultiHashMapWithCounts relatedFileOptions = new MultiHashMapWithCounts(); private TemplateOption templateStringOption; + private TemplateOption sourceCodeFilesOption; public NewStaticExecutableAlgorithmTemplate() { super("static_executable"); @@ -207,19 +213,47 @@ setupSourceCodeFilesPage(); } + public TemplateOption getSourceCodeFilesTemplateOption() { + return this.sourceCodeFilesOption; + } + public void addPages(Wizard wizard) { - wizard.addPage(createCreateProjectPage()); - createBundlePropertiesPage(wizard); - createChooseExecutableFilesPage(wizard); - createProjectPropertiesPage(wizard); - createProjectParametersPage(wizard); - createInputAndOutputDataPage(wizard); - createTemplateStringPage(wizard); - createSourceCodeFilesPage(wizard); + this.createProjectPage = createCreateProjectPage(); + wizard.addPage(this.createProjectPage); + this.bundlePropertiesPage = createBundlePropertiesPage(); + wizard.addPage(this.bundlePropertiesPage); + + this.chooseExecutableFilesPage = createChooseExecutableFilesPage(); + wizard.addPage(this.chooseExecutableFilesPage); + + this.projectPropertiesPage = createProjectPropertiesPage(); + wizard.addPage(this.projectPropertiesPage); + + this.projectParametersPage = createProjectParametersPage(); + wizard.addPage(this.projectParametersPage); + + this.inputAndOutputDataPage = createInputAndOutputDataPage(); + wizard.addPage(this.inputAndOutputDataPage); + + this.specifyTemplateStringPage = createTemplateStringPage(); + wizard.addPage(this.specifyTemplateStringPage); + + this.sourceCodeFilesPage = createSourceCodeFilesPage(); + wizard.addPage(this.sourceCodeFilesPage); + markPagesAdded(); } + /* + * execute is basically called when the user clicks the Finish button in + * the wizard. This is where all of the template options should be + * processed and/or created. + * Template options are basically key/value string pairs. If a template + * option's key is found in the project template files (in the + * templates_3.0 directory), it is replaced with the template option's + * value. + */ public void execute(IProject project, IPluginModelBase model, IProgressMonitor monitor) throws CoreException { @@ -229,6 +263,7 @@ // Project Properties Page + // See comments on handleEmptyOption. handleEmptyOption(ON_MENU_ID, IS_ON_MENU_ID, Boolean.TRUE); handleEmptyOption(LABEL_ID, HAS_LABEL_ID, ""); handleEmptyOption(DESCRIPTION_ID, HAS_DESCRIPTION_ID, ""); @@ -264,7 +299,12 @@ this.projectParametersPage.toOutputString()); // In and Out Data Page - try{ + + /* + * These options are not tied directly to input fields on any of the + * pages. Their values are derviced from the input fields that ARE on + * the pages. + */ addOption(IN_DATA_ID, "", this.inputAndOutputDataPage. @@ -284,17 +324,7 @@ this.inputAndOutputDataPage. formConfigPropertiesOutFilesString(), SPECIFY_INPUT_AND_OUTPUT_DATA_PAGE_NUMBER); - } - catch (Exception e1) { - try { - FileWriter fstream = new FileWriter("C:/Documents and Settings/pataphil/Desktop/out.txt", true); - BufferedWriter out = new BufferedWriter(fstream); - out.write("exception: \'" + e1.toString() + "\'\n"); - out.close(); - } catch (Exception e) { - System.err.println("Error: " + e.getMessage()); - } - } + super.execute(project, model, monitor); } @@ -326,81 +356,93 @@ return createProjectPage.getProjectHandle(); } - private WizardPage createCreateProjectPage() { - this.createProjectPage = + private WizardNewProjectCreationPage createCreateProjectPage() { + WizardNewProjectCreationPage createProjectPage = new WizardNewProjectCreationPage(CREATE_PROJECT_PAGE_ID); - this.createProjectPage.setTitle( + createProjectPage.setTitle( "Create a New Static Executable Project"); - this.createProjectPage.setDescription("Enter the project name"); + createProjectPage.setDescription("Enter the project name"); return createProjectPage; } - private void createBundlePropertiesPage(Wizard wizard) { - this.bundlePropertiesPage = + private WizardPage createBundlePropertiesPage() { + WizardPage bundlePropertiesPage = createPage(PROJECT_BUNDLE_PROPERTIES_PAGE_NUMBER); - this.bundlePropertiesPage.setTitle("Bundle Properties"); - this.bundlePropertiesPage.setDescription( + bundlePropertiesPage.setTitle("Bundle Properties"); + bundlePropertiesPage.setDescription( "Enter the bundle name, and bundle version"); - wizard.addPage(this.bundlePropertiesPage); + + return bundlePropertiesPage; } - private void createChooseExecutableFilesPage(Wizard wizard) { - this.chooseExecutableFilesPage = new ChooseExecutableFilesPage( - CHOOSE_EXECUTABLE_FILES_PAGE_ID, this.executableNameOption, this); - this.chooseExecutableFilesPage.setTitle("Choose Executable Files"); - this.chooseExecutableFilesPage.setDescription( + private ChooseExecutableFilesPage createChooseExecutableFilesPage() { + ChooseExecutableFilesPage chooseExecutableFilesPage = + new ChooseExecutableFilesPage(CHOOSE_EXECUTABLE_FILES_PAGE_ID, + this.executableNameOption, + this); + chooseExecutableFilesPage.setTitle("Choose Executable Files"); + chooseExecutableFilesPage.setDescription( "Choose the executable files and any files they depend on"); - wizard.addPage(this.chooseExecutableFilesPage); + + return chooseExecutableFilesPage; } - private void createProjectPropertiesPage(Wizard wizard) { - this.projectPropertiesPage = + private WizardPage createProjectPropertiesPage() { + WizardPage projectPropertiesPage = createPage(PROJECT_PROPERTIES_PAGE_NUMBER); - this.projectPropertiesPage.setTitle("Project Properties"); - this.projectPropertiesPage.setDescription("Enter project properties"); - wizard.addPage(this.projectPropertiesPage); + projectPropertiesPage.setTitle("Project Properties"); + projectPropertiesPage.setDescription("Enter project properties"); + + return projectPropertiesPage; } - private void createProjectParametersPage(Wizard wizard) { - this.projectParametersPage = + private ParameterListBuilderPage createProjectParametersPage() { + ParameterListBuilderPage projectParametersPage = new ParameterListBuilderPage(SETUP_PARAMETERS_PAGE_ID); - this.projectParametersPage.setTitle("Project Parameters"); - this.projectParametersPage.setDescription("Enter project parameters"); - wizard.addPage(this.projectParametersPage); + projectParametersPage.setTitle("Project Parameters"); + projectParametersPage.setDescription("Enter project parameters"); + + return projectParametersPage; } - private void createInputAndOutputDataPage(Wizard wizard) { - this.inputAndOutputDataPage = + private SpecifyInAndOutDataPage createInputAndOutputDataPage() { + SpecifyInAndOutDataPage inputAndOutputDataPage = new SpecifyInAndOutDataPage(SPECIFY_IN_AND_OUT_DATA_PAGE_ID); - this.inputAndOutputDataPage.setTitle("Input and Output Data"); - this.inputAndOutputDataPage.setDescription( + inputAndOutputDataPage.setTitle("Input and Output Data"); + inputAndOutputDataPage.setDescription( "Enter the input and output data"); - wizard.addPage(this.inputAndOutputDataPage); + + return inputAndOutputDataPage; } - private void createTemplateStringPage(Wizard wizard) { - this.specifyTemplateStringPage = new SpecifyTemplateStringPage( - SPECIFY_TEMPLATE_STRING_PAGE_ID, - projectParametersPage, - inputAndOutputDataPage, - this.templateStringOption); - this.specifyTemplateStringPage.setTitle("Template String"); - this.specifyTemplateStringPage.setDescription( + private SpecifyTemplateStringPage createTemplateStringPage() { + SpecifyTemplateStringPage specifyTemplateStringPage = + new SpecifyTemplateStringPage( + SPECIFY_TEMPLATE_STRING_PAGE_ID, + projectParametersPage, + inputAndOutputDataPage, + this.templateStringOption); + specifyTemplateStringPage.setTitle("Template String"); + specifyTemplateStringPage.setDescription( "Enter the template string used to execute your program"); - wizard.addPage(this.specifyTemplateStringPage); + + return specifyTemplateStringPage; } - private void createSourceCodeFilesPage(Wizard wizard) { - this.sourceCodeFilesPage = createPage(SOURCE_CODE_FILES_PAGE_NUMBER); - this.sourceCodeFilesPage.setTitle("Source Code Files (Optional)"); - this.sourceCodeFilesPage.setDescription( + private ChooseSourceCodeFilesPage createSourceCodeFilesPage() { + ChooseSourceCodeFilesPage sourceCodeFilesPage = + new ChooseSourceCodeFilesPage( + CHOOSE_SOURCE_CODE_FILES_PAGE_ID, + this.sourceCodeFilesOption); + sourceCodeFilesPage.setTitle("Source Code Files (Optional)"); + sourceCodeFilesPage.setDescription( "Enter the source code files for your program"); - wizard.addPage(this.sourceCodeFilesPage); + + return sourceCodeFilesPage; } - private void setupCreateProjectPage() { - } + private void setupCreateProjectPage() { } private void setupBundlePropertiesPage() { addOption(BUNDLE_NAME_ID, @@ -491,11 +533,9 @@ PROJECT_PROPERTIES_PAGE_NUMBER).setRequired(true); } - private void setupProjectParametersPage() { - } + private void setupProjectParametersPage() { } - private void setupInputAndOutputDataPage() { - } + private void setupInputAndOutputDataPage() { } private void setupTemplateStringPage() { this.templateStringOption = addOption( @@ -507,8 +547,29 @@ } private void setupSourceCodeFilesPage() { + this.sourceCodeFilesOption = addOption( + CHOOSE_SOURCE_CODE_FILES_ID, + CHOOSE_SOURCE_CODE_FILES_LABEL + ":", + "", + SOURCE_CODE_FILES_PAGE_NUMBER); + this.sourceCodeFilesOption.setRequired(false); } + /* + * As far as I know, there are no conditionals in the templating langauge + * used when processing the new project templates (in the templates_3.0 + * directory). + * To avoid having empty values in the properties files, the templates must + * be setup to comment out key/value lines in case the values are empty. + * What handleEmptyOption does is check if the value of the option optionID + * is NOT equal to compareTo, and if so, it sets the "comment-out" + * template option isEmptyOptionID to have the value "#", which will + * comment out the line if it's placed accordingly in the template. + * For example, if there were the line + * $isOptionEmpty$key=$value$ + * the template option isOptionEmpty would be set to "#" if the template + * option value is empty. + */ private void handleEmptyOption( String optionID, String isEmptyOptionID, String compareTo) { if (getOption(optionID).getValue() == null || @@ -592,9 +653,15 @@ relatedFileOption.getPlatformName(), relatedFileOption); } - public void removeRelatedFileOption(PlatformOption relatedFileOption) { - this.relatedFileOptions.removeValue( - relatedFileOption.getPlatformName(), relatedFileOption); + public void removeRelatedFileOption(TemplateOption relatedFileOption) { + if (relatedFileOption instanceof PlatformOption) { + PlatformOption relatedFilePlatformOption = + (PlatformOption)relatedFileOption; + + this.relatedFileOptions.removeValue( + relatedFilePlatformOption.getPlatformName(), + relatedFilePlatformOption); + } } public PlatformOption createRelatedFileOption(String platformName, Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmWizard.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmWizard.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/NewStaticExecutableAlgorithmWizard.java 2009-08-13 18:42:24 UTC (rev 918) @@ -35,6 +35,7 @@ import org.eclipse.pde.internal.core.bundle.BundlePluginModelBase; import org.eclipse.pde.ui.templates.ITemplateSection; import org.eclipse.pde.ui.templates.NewPluginTemplateWizard; +import org.eclipse.pde.ui.templates.TemplateOption; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.MessageBox; @@ -53,7 +54,6 @@ public class NewStaticExecutableAlgorithmWizard extends NewPluginTemplateWizard implements IWorkbenchWizard { - // TODO: Different label string? public static final String DEFAULT_LABEL = "Common to All"; public static final String DEFAULT_PATH = "/default/"; @@ -75,25 +75,24 @@ public static final String WIN_32_LABEL = "Windows (32 bit)"; public static final String WIN_32_PATH = "/win32/"; - // TODO: This should be improved. public static final String[] PLATFORM_LABELS = new String[] { DEFAULT_LABEL, + WIN_32_LABEL, + MAC_OSX_X86_LABEL, + MAC_OSX_PPC_LABEL, LINUX_X86_32_LABEL, LINUX_X86_64_LABEL, - MAC_OSX_PPC_LABEL, - MAC_OSX_X86_LABEL, - SOLARIS_SPARC_LABEL, - WIN_32_LABEL + SOLARIS_SPARC_LABEL }; public static final String[] PLATFORM_PATHS = new String[] { DEFAULT_PATH, + WIN_32_PATH, + MAC_OSX_X86_PATH, + MAC_OSX_PPC_PATH, LINUX_X86_32_PATH, LINUX_X86_64_PATH, - MAC_OSX_PPC_PATH, - MAC_OSX_X86_PATH, - SOLARIS_SPARC_PATH, - WIN_32_PATH + SOLARIS_SPARC_PATH }; NewStaticExecutableAlgorithmTemplate template; @@ -148,7 +147,7 @@ PlatformOption executableFileOption = template.getExecutableFileOption( PLATFORM_LABELS[ii]); - copyPlatformOptionFile( + copyTemplateOptionFile( executableFileOption, directoryPath, project); } @@ -156,11 +155,18 @@ template.getRelatedFileOptions(PLATFORM_LABELS[ii]); for (int jj = 0; jj < relatedFileOptions.length; jj++) { - copyPlatformOptionFile( + copyTemplateOptionFile( relatedFileOptions[jj], directoryPath, project); } } + String sourceCodeDirectoryPath = "src/"; + TemplateOption sourceCodeFilesTemplateOption = + template.getSourceCodeFilesTemplateOption(); + copyTemplateOptionFile(sourceCodeFilesTemplateOption, + sourceCodeDirectoryPath, + project); + monitor.done(); } }; @@ -204,11 +210,11 @@ } - private void copyPlatformOptionFile(PlatformOption platformOption, + private void copyTemplateOptionFile(TemplateOption templateOption, String directoryPath, IProject project) throws CoreException { - String sourceFilePath = platformOption.getText(); + String sourceFilePath = templateOption.getValue().toString(); if (sourceFilePath == null || "".equals(sourceFilePath)) { return; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItem.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItem.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItem.java 2009-08-13 18:42:24 UTC (rev 918) @@ -1,5 +1,17 @@ package org.cishell.templates.wizards.staticexecutable; +/* + * For static executable algorithms, output data items are always files. It is + * up to the algorithm creators to make the names the output files their + * programs create and the names specified in the static executable algorithm + * match up, so CIShell can find the files. + * Labels can be specified for the output files. + * Output files for static executable algorithms also contain data types, which + * determine the icon CIShell uses for the associated data item in the Data + * Manager. + * Example data types are Network and Plot. + * Output files must also specify appropriate mime types. + */ public class OutputDataItem { private String fileName = ""; private String label = ""; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItemEditor.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItemEditor.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/OutputDataItemEditor.java 2009-08-13 18:42:24 UTC (rev 918) @@ -11,7 +11,6 @@ import org.eclipse.swt.widgets.Text; public class OutputDataItemEditor extends Dialog { - private Text idText; private Text fileNameText; private Text labelText; private Text dataTypeText; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableInputDataDelegate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableInputDataDelegate.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableInputDataDelegate.java 2009-08-13 18:42:24 UTC (rev 918) @@ -47,7 +47,7 @@ idToInputDataItemMap.put("" + this.lastID, inputDataItem); String[] item = new String[] { - "" + this.lastID, + Integer.toString(this.lastID), inputDataItem.getMimeType() }; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/staticexecutable/StaticExecutableOutputDataDelegate.java 2009-08-13 18:42:24 UTC (rev 918) @@ -53,7 +53,8 @@ boolean success = editOutputDataItem(outputDataItem); if (success) { - idToOutputDataItemMap.put("" + this.lastID, outputDataItem); + idToOutputDataItemMap.put(Integer.toString(this.lastID), + outputDataItem); String[] item = new String[] { "" + this.lastID, Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseExecutableFileWidget.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseExecutableFileWidget.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseExecutableFileWidget.java 2009-08-13 18:42:24 UTC (rev 918) @@ -9,6 +9,10 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Layout; +/* + * This widget allows the user to choose one file, which is intended to be the + * executable file for the provided platform (name and path). + */ public class ChooseExecutableFileWidget extends Composite { public static final String CHOOSE_EXECUTABLE_FILE_LABEL = "Choose Executable File"; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseFileWidget.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseFileWidget.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseFileWidget.java 2009-08-13 18:42:24 UTC (rev 918) @@ -1,6 +1,6 @@ package org.cishell.templates.wizards.widgets; -import org.cishell.templates.staticexecutable.providers.PlatformOption; +import org.eclipse.pde.ui.templates.TemplateOption; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; @@ -13,6 +13,14 @@ import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.Text; +/* + * This widget allows the user the choose a file off of his/her hard drive. + * It ties the chosen file's path to a provided TemplateOption so the chosen + * files can be processed upon the wizard's completion. + * This widget can optionally call back upon it being filled or its Remove + * button being selected to allow its parent component handle any appropriate + * actions. + */ public class ChooseFileWidget extends Composite implements SelectionListener { public static final String BROWSE_FILES_BUTTON_LABEL = "Browse"; public static final String REMOVE_FILE_LABEL_TEXT = "Remove?"; @@ -24,14 +32,15 @@ private Text filePathText; private Button browseFilesButton; + // TODO: Make these listeners of an interface. private ChooseRelatedFilesWidget fileChosenListener; private ChooseRelatedFilesWidget removeElementListener; - private PlatformOption platformOption; + private TemplateOption platformOption; public ChooseFileWidget(Composite parent, int style, int parentParentWidth, - PlatformOption stringOption) { + TemplateOption stringOption) { this(parent, style, true, parentParentWidth, stringOption); } @@ -39,7 +48,7 @@ int style, boolean hasRemoveButton, int parentParentWidth, - PlatformOption platformOption) { + TemplateOption platformOption) { super(parent, style); this.platformOption = platformOption; @@ -49,24 +58,20 @@ Composite container = createContainer(hasRemoveButton, parentParentWidth); this.platformOption.createControl(container, 2); -// this.filePathText = createFilePathText(); this.browseFilesButton = createBrowseFilesButton(); createRemoveElement(hasRemoveButton); - - // fixFilePathTextWidth(widthForFilePathText); } - public PlatformOption getPlatformOption() { + public TemplateOption getPlatformOption() { return this.platformOption; } public String getFilePath() { - return this.platformOption.getText(); - // return this.filePathText.getText(); + return this.platformOption.getValue().toString(); } public void setFilePath(String filePath) { - this.platformOption.setText(filePath); + this.platformOption.setValue(filePath); } public void widgetDefaultSelected(SelectionEvent selectionEvent) { @@ -133,13 +138,6 @@ return container; } - private Text createFilePathText() { - Text filePathText = new Text(this, SWT.BORDER); - filePathText.setEditable(true); - - return filePathText; - } - private Button createBrowseFilesButton() { Button browseFilesButton = new Button(this, SWT.PUSH); browseFilesButton.setLayoutData(createBrowseFilesButtonLayoutData()); @@ -163,11 +161,6 @@ } } - private void fixFilePathTextWidth(int widthForFilePathText) { - this.filePathText.setLayoutData( - createFilePathTextLayoutData(widthForFilePathText)); - } - private void browseButtonSelected(SelectionEvent selectionEvent) { FileDialog fileDialog = new FileDialog(getShell(), SWT.NULL); fileDialog.setFileName(getFilePath()); Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseRelatedFilesWidget.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseRelatedFilesWidget.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ChooseRelatedFilesWidget.java 2009-08-13 18:42:24 UTC (rev 918) @@ -11,6 +11,15 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Layout; +/* + * This widget the user to choose and remove one or more files related to the + * executable file for the provided platform (name and path). + * As soon as the last file selector is filled with a file path, this widget + * provides an additional file selector for the user to continue providing + * additional related files. + * All related file selectors besides the first one can be removed in this + * widget. + */ public class ChooseRelatedFilesWidget extends ResizeCompositeHackWidget { public static final String CHOOSE_RELATED_FILES_LABEL_TEXT = "Choose Related Files"; @@ -45,7 +54,6 @@ this.firstFileSelector = createAndSetupFileSelector(false); } - // TODO: How to get the file paths out? public ChooseFileWidget getFirstFileSelector() { return this.firstFileSelector; } Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupHeaderWidget.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupHeaderWidget.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupHeaderWidget.java 2009-08-13 18:42:24 UTC (rev 918) @@ -9,6 +9,10 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; +/* + * This widget contains any appropriate header widgets for a + * PlatformSetupWidget. + */ public class PlatformSetupHeaderWidget extends Composite { public static final String PLATFORM_LABEL = "Platform"; Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupWidget.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupWidget.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/PlatformSetupWidget.java 2009-08-13 18:42:24 UTC (rev 918) @@ -7,6 +7,15 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Layout; +/* + * This widget contains a header, which is a PlatformSetupHeaderWidget object, + * and it is associated with an operating system platform via its platformName + * and platformPath member variables. + * There is also optionally a widget for choosing an executable file for the + * associated platform, which is of type ChooseExecutableFileWidget. + * There is always a widget for choosing and removing one or more related + * files, which is of the type ChooseRelatedFilesWidget. + */ public class PlatformSetupWidget extends ResizeCompositeHackWidget { public static final int WIDGET_WIDTH = 454; public static final int WIDGET_HEIGHT = 317; @@ -101,8 +110,6 @@ GridData data = new GridData(); data.horizontalSpan = 2; data.grabExcessHorizontalSpace = true; -// data.horizontalAlignment = SWT.CENTER; -// data.verticalAlignment = SWT.CENTER; return data; } @@ -125,13 +132,11 @@ data.horizontalAlignment = GridData.FILL; data.verticalAlignment = GridData.FILL; - // data.widthHint = WIDGET_WIDTH; data.grabExcessHorizontalSpace = true; data.grabExcessVerticalSpace = true; if (!shouldSpanEntireWidth) { data.horizontalAlignment = GridData.FILL; - // data.widthHint = WIDGET_WIDTH; data.grabExcessHorizontalSpace = true; data.horizontalSpan = 2; } else { Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ResizeCompositeHackWidget.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ResizeCompositeHackWidget.java 2009-08-06 22:02:26 UTC (rev 917) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/widgets/ResizeCompositeHackWidget.java 2009-08-13 18:42:24 UTC (rev 918) @@ -5,6 +5,12 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Composite; +/* + * This "widget" ensures that both it and its parent component get resized + * appropriate when its size is set. + * It handles the case where its parent component is a ScrolledComposite, so + * scrolling happens properly. + */ public class ResizeCompositeHackWidget extends Composite { public ResizeCompositeHackWidget(Composite parent, int style) { super(parent, style); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-08-24 17:27:30
|
Revision: 936 http://cishell.svn.sourceforge.net/cishell/?rev=936&view=rev Author: pataphil Date: 2009-08-24 17:27:23 +0000 (Mon, 24 Aug 2009) Log Message: ----------- * Added workaround for crazy File.listFiles bug (where empty directories were not in the listing). Modified Paths: -------------- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/BasicTemplate.java Added Paths: ----------- trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/default/!PLACEHOLDER! trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/linux.x86/!PLACEHOLDER! trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/linux.x86_64/!PLACEHOLDER! trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/macosx.ppc/!PLACEHOLDER! trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/macosx.x86/!PLACEHOLDER! trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/solaris.sparc/!PLACEHOLDER! trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/ALGORITHM/win32/!PLACEHOLDER! trunk/templates/org.cishell.templates.wizards/templates_3.0/static_executable/src/!PLACEHOLDER! Modified: trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/BasicTemplate.java =================================================================== --- trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/BasicTemplate.java 2009-08-22 14:39:16 UTC (rev 935) +++ trunk/templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/BasicTemplate.java 2009-08-24 17:27:23 UTC (rev 936) @@ -48,6 +48,12 @@ // TODO Could we safely reduce some of the method visibilities here? public abstract class BasicTemplate extends OptionTemplateSection { + /* + * TODO: This is a hack to fix a bug where File seems to exclude empty + * directories from its list of sub files on certain platforms. + */ + public static final String HACK_PLACEHOLDER_FILE_NAME = "!PLACEHOLDER!"; + protected final String sectionID; protected Map valueMap; protected Map optionMap; @@ -145,7 +151,7 @@ } protected void generateFiles(IProgressMonitor progressMonitor, - URL locationURL) throws CoreException { + URL locationURL) throws CoreException { progressMonitor.setTaskName( PDEUIMessages.AbstractTemplateSection_generating); @@ -172,12 +178,12 @@ return; } - generateFiles(templateDirectory, - project, - true, - false, - true, - progressMonitor); + generateFilesFromDirectory(templateDirectory, + project, + true, + false, + true, + progressMonitor); } else if ("jar".equals(resolvedLocationURLProtocol)) { int exclamationIndex = resolvedLocationURLFileName.indexOf('!'); @@ -209,12 +215,12 @@ try { zipFile = new ZipFile(pluginJarFile); - generateFiles(zipFile, - templateDirectoryPath, - project, - true, - false, - progressMonitor); + generateFilesFromZipFile(zipFile, + templateDirectoryPath, + project, + true, + false, + progressMonitor); } catch (ZipException zipException) { } catch (IOException ioException1) { } finally { @@ -228,11 +234,11 @@ } - progressMonitor.subTask(""); //$NON-NLS-1$ + progressMonitor.subTask(""); progressMonitor.worked(1); } - protected void generateFiles( + protected void generateFilesFromDirectory( File sourceFile, IContainer destinationContainer, boolean isFirstLevel, @@ -244,6 +250,11 @@ for (int ii = 0; ii < sourceSubFiles.length; ii++) { File sourceSubFile = sourceSubFiles[ii]; + if (sourceSubFiles[ii].getName().equals( + HACK_PLACEHOLDER_FILE_NAME)) { + continue; + } + boolean shouldProcessSubFileAsTemplate = shouldProcessAsTemplate && shouldProcessFile(sourceSubFile); @@ -269,7 +280,7 @@ } if (subDestinationContainer == null) { - if (isOkToCreateFolder(sourceSubFile) == false) { + if (!isOkToCreateFolder(sourceSubFile)) { continue; } @@ -292,12 +303,12 @@ true, true, progressMonitor); } - generateFiles(sourceSubFile, - subDestinationContainer, - false, - isBinaryFile, - shouldProcessSubFileAsTemplate, - progressMonitor); + generateFilesFromDirectory(sourceSubFile, + subDestinationContainer, + false, + isBinaryFile, + shouldProcessSubFileAsTemplate, + progressMonitor); } else { if (isOkToCreateFile(sourceSubFile)) { if (isFirstLevel) { @@ -328,7 +339,7 @@ } } - protected void generateFiles( + protected void generateFilesFromZipFile( ZipFile zipFile, IPath filePath, IContainer destinationContainer, @@ -407,7 +418,7 @@ true, true, progressMonitor); } - generateFiles(zipFile, + generateFilesFromZipFile(zipFile, filePath.append(name), subDestinationContainer, false, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |