|
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;
+...
[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;
+ }...
[truncated message content] |
|
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.
|