diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/StatAlgoImporter.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/StatAlgoImporter.java index 0c1f2a4..be5f139 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/StatAlgoImporter.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/StatAlgoImporter.java @@ -30,7 +30,7 @@ public class StatAlgoImporter implements EntryPoint { private static final String JSP_TAG_ID = "StatAlgoImporterPortlet"; - private static final int RIBBON_HEIGHT = 120; + private static final int RIBBON_HEIGHT = 110; @SuppressWarnings("unused") private final StatAlgoImporterServiceAsync statAlgoImporterService = GWT @@ -72,6 +72,7 @@ public class StatAlgoImporter implements EntryPoint { mainPanelLayout.setId("mainPanelLayout"); mainPanelLayout.setBorders(false); mainPanelLayout.setResize(true); + // mainPanelLayout.getElement().getStyle().setBackgroundColor("rgb(3, 126, 207)"); // Main @@ -93,19 +94,22 @@ public class StatAlgoImporter implements EntryPoint { // Right ToolsPanel toolsPanel = new ToolsPanel(eventBus); - BorderLayoutData eastData = new BorderLayoutData(310); - eastData.setCollapsible(false); + BorderLayoutData eastData = new BorderLayoutData(400); + eastData.setCollapsible(true); eastData.setSplit(false); eastData.setFloatable(false); - eastData.setCollapseMini(false); - eastData.setMargins(new Margins(2, 7, 2, 7)); - eastData.setCollapseHidden(true); + eastData.setCollapseMini(true); + eastData.setMargins(new Margins(0, 5, 0, 5)); + eastData.setCollapseHidden(false); + + // estData.setMaxSize(510); // estData.setMinSize(310); mainPanelLayout.setEastWidget(toolsPanel, eastData); // codeUploadPanel.expand(); toolsPanel.enable(); - + + bind(mainPanelLayout); controller.setMainPanelLayout(mainPanelLayout); controller.restoreUISession(); diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/maindata/CodeEditPanel.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/maindata/CodeEditPanel.java index 7db243e..037fd4c 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/maindata/CodeEditPanel.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/maindata/CodeEditPanel.java @@ -84,7 +84,7 @@ public class CodeEditPanel extends ContentPanel { Log.debug("loaded " + result.size() + " code lines"); String text = new String(); for (CodeData codeData : result) { - Log.debug("Read: " + codeData); + //Log.debug("Read: " + codeData); text+=codeData.getCodeLine()+"\r\n"; } diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/properties/EnvironmentVariablesProperties.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/properties/EnvironmentVariablesProperties.java new file mode 100644 index 0000000..4d42d20 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/properties/EnvironmentVariablesProperties.java @@ -0,0 +1,28 @@ +package org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties; + +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.EnvironmentVariables; +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType; + +import com.sencha.gxt.core.client.ValueProvider; +import com.sencha.gxt.data.shared.ModelKeyProvider; +import com.sencha.gxt.data.shared.PropertyAccess; + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public interface EnvironmentVariablesProperties extends + PropertyAccess { + + ModelKeyProvider id(); + + ValueProvider name(); + + ValueProvider description(); + + ValueProvider inputType(); + + ValueProvider defaultValue(); +} diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/properties/InputTypePropertiesCombo.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/properties/InputTypePropertiesCombo.java new file mode 100644 index 0000000..c80c3b8 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/properties/InputTypePropertiesCombo.java @@ -0,0 +1,24 @@ +package org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties; + +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType; + +import com.google.gwt.editor.client.Editor.Path; +import com.sencha.gxt.data.shared.LabelProvider; +import com.sencha.gxt.data.shared.ModelKeyProvider; +import com.sencha.gxt.data.shared.PropertyAccess; + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ + +public interface InputTypePropertiesCombo extends PropertyAccess { + + @Path("id") + ModelKeyProvider id(); + + LabelProvider label(); + +} diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/StatAlgoImporterResources.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/StatAlgoImporterResources.java index 87821b4..91ad7ef 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/StatAlgoImporterResources.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/StatAlgoImporterResources.java @@ -23,13 +23,19 @@ public interface StatAlgoImporterResources extends ClientBundle { @Source("help_32.png") ImageResource help32(); + + @Source("help_24.png") + ImageResource help24(); @Source("download_32.png") ImageResource download32(); @Source("upload_32.png") ImageResource upload32(); - + + @Source("upload_24.png") + ImageResource upload24(); + @Source("job_32.png") ImageResource job32(); @@ -47,13 +53,39 @@ public interface StatAlgoImporterResources extends ClientBundle { @Source("cancel_32.png") ImageResource cancel32(); + + @Source("cancel_24.png") + ImageResource cancel24(); @Source("algorithm_32.png") ImageResource algorithm32(); + @Source("algorithm_24.png") + ImageResource algorithm24(); + @Source("project-create_32.png") ImageResource projectCreate32(); + @Source("project-create_24.png") + ImageResource projectCreate24(); + @Source("project-open_32.png") ImageResource projectOpen32(); + + @Source("project-open_24.png") + ImageResource projectOpen24(); + + @Source("add_24.png") + ImageResource add24(); + + @Source("add_16.png") + ImageResource add16(); + + @Source("delete_24.png") + ImageResource delete24(); + + @Source("delete_16.png") + ImageResource delete16(); + + } diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_16.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_16.png new file mode 100644 index 0000000..9a17af8 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_16.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_24.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_24.png new file mode 100644 index 0000000..dd62ee8 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_24.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/algorithm_24.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/algorithm_24.png new file mode 100644 index 0000000..b2c39e7 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/algorithm_24.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/cancel_24.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/cancel_24.png new file mode 100644 index 0000000..9d95f89 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/cancel_24.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_16.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_16.png new file mode 100644 index 0000000..ea9d426 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_16.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_24.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_24.png new file mode 100644 index 0000000..4703d05 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_24.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/help_24.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/help_24.png new file mode 100644 index 0000000..819da89 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/help_24.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-create_24.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-create_24.png new file mode 100644 index 0000000..8a3f8ed Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-create_24.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-open_24.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-open_24.png new file mode 100644 index 0000000..b482ca2 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-open_24.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/upload_24.png b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/upload_24.png new file mode 100644 index 0000000..ec8bac0 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/upload_24.png differ diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/ribbon/HomeToolBar.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/ribbon/HomeToolBar.java index 9c26441..1331821 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/ribbon/HomeToolBar.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/ribbon/HomeToolBar.java @@ -33,7 +33,7 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar; * */ public class HomeToolBar { - private static final String GROUP_HEIGHT = "80px"; + private static final String GROUP_HEIGHT = "72px"; private HomeToolBarMessages msgs; private EventBus eventBus; private ToolBar toolBar; @@ -87,9 +87,9 @@ public class HomeToolBar { projectGroup.add(homeLayout); btnCreateProject = new TextButton(msgs.btnCreateProject(), - StatAlgoImporterResources.INSTANCE.projectCreate32()); + StatAlgoImporterResources.INSTANCE.projectCreate24()); btnCreateProject.setId("btnCreateProject"); - btnCreateProject.setScale(ButtonScale.MEDIUM); + btnCreateProject.setScale(ButtonScale.SMALL); btnCreateProject.setIconAlign(IconAlign.LEFT); btnCreateProject.setArrowAlign(ButtonArrowAlign.BOTTOM); btnCreateProject.setToolTip(msgs.btnCreateProjectToolTip()); @@ -106,9 +106,9 @@ public class HomeToolBar { homeLayout.getFlexCellFormatter().setRowSpan(0, 0, 2); btnOpenProject = new TextButton(msgs.btnOpenProject(), - StatAlgoImporterResources.INSTANCE.projectOpen32()); + StatAlgoImporterResources.INSTANCE.projectOpen24()); btnOpenProject.setId("btnOpenProject"); - btnOpenProject.setScale(ButtonScale.MEDIUM); + btnOpenProject.setScale(ButtonScale.SMALL); btnOpenProject.setIconAlign(IconAlign.LEFT); btnOpenProject.setArrowAlign(ButtonArrowAlign.BOTTOM); btnOpenProject.setToolTip(msgs.btnOpenProjectToolTip()); @@ -136,9 +136,9 @@ public class HomeToolBar { algorithmGroup.add(algorithmLayout); btnImportAlgorithm = new TextButton(msgs.importButton(), - StatAlgoImporterResources.INSTANCE.upload32()); + StatAlgoImporterResources.INSTANCE.upload24()); btnImportAlgorithm.setId("importButton"); - btnImportAlgorithm.setScale(ButtonScale.MEDIUM); + btnImportAlgorithm.setScale(ButtonScale.SMALL); btnImportAlgorithm.setIconAlign(IconAlign.LEFT); btnImportAlgorithm.setArrowAlign(ButtonArrowAlign.BOTTOM); btnImportAlgorithm.setToolTip(msgs.importButtonToolTip()); @@ -156,9 +156,9 @@ public class HomeToolBar { btnCreateAlgorithm = new TextButton(msgs.createAlgorithmButton(), - StatAlgoImporterResources.INSTANCE.algorithm32()); + StatAlgoImporterResources.INSTANCE.algorithm24()); btnCreateAlgorithm.setId("createAlgorithmButton"); - btnCreateAlgorithm.setScale(ButtonScale.MEDIUM); + btnCreateAlgorithm.setScale(ButtonScale.SMALL); btnCreateAlgorithm.setIconAlign(IconAlign.LEFT); btnCreateAlgorithm.setArrowAlign(ButtonArrowAlign.BOTTOM); btnCreateAlgorithm.setToolTip(msgs.createAlgorithmButtonToolTip()); @@ -198,10 +198,10 @@ public class HomeToolBar { */ btnHelp = new TextButton(msgs.helpButton(), - StatAlgoImporterResources.INSTANCE.help32()); + StatAlgoImporterResources.INSTANCE.help24()); btnHelp.enable(); btnHelp.setToolTip(msgs.helpButtonToolTip()); - btnHelp.setScale(ButtonScale.MEDIUM); + btnHelp.setScale(ButtonScale.SMALL); btnHelp.setIconAlign(IconAlign.LEFT); btnHelp.setArrowAlign(ButtonArrowAlign.BOTTOM); btnHelp.addSelectHandler(new SelectHandler() { diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/ribbon/StatAlgoImporterRibbon.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/ribbon/StatAlgoImporterRibbon.java index 8d99e2f..dc28246 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/ribbon/StatAlgoImporterRibbon.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/ribbon/StatAlgoImporterRibbon.java @@ -19,7 +19,7 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti */ public class StatAlgoImporterRibbon { - private static final String RIBBON_HEIGHT = "90px"; + private static final String RIBBON_HEIGHT = "76px"; private TabPanel ribbon; diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/ToolsPanel.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/ToolsPanel.java index bdfdaf1..4ce096c 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/ToolsPanel.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/ToolsPanel.java @@ -6,8 +6,8 @@ import org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input. import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.event.shared.EventBus; import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.ContentPanel; import com.sencha.gxt.widget.core.client.container.MarginData; -import com.sencha.gxt.widget.core.client.container.SimpleContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; @@ -17,7 +17,7 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it * */ -public class ToolsPanel extends SimpleContainer { +public class ToolsPanel extends ContentPanel { private EventBus eventBus; private InputVariablePanel inputVariablePanel; @@ -34,10 +34,13 @@ public class ToolsPanel extends SimpleContainer { protected void init() { forceLayoutOnResize = true; - // setBodyBorder(false); + setHeaderVisible(false); + setResize(true); + setBodyBorder(false); setBorders(false); - // setHeaderVisible(false); - + setHideCollapseTool(true); + + } protected void create() { @@ -71,8 +74,8 @@ public class ToolsPanel extends SimpleContainer { inputVariablePanel = new InputVariablePanel(eventBus); explorerProjectPanel = new ExplorerProjectPanel(eventBus); - v.add(inputVariablePanel, new VerticalLayoutData(1, -1, new Margins(0))); - v.add(explorerProjectPanel, new VerticalLayoutData(1, -1, + //v.add(inputVariablePanel, new VerticalLayoutData(1, 1, new Margins(0))); + v.add(inputVariablePanel, new VerticalLayoutData(1, 1, new Margins(0))); add(v, new MarginData(new Margins(0))); forceLayout(); diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/EnvironmentVariablesPanel.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/EnvironmentVariablesPanel.java index f42a780..34e9bf4 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/EnvironmentVariablesPanel.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/EnvironmentVariablesPanel.java @@ -1,19 +1,76 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input; +import java.util.ArrayList; + +import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.EnvironmentVariablesProperties; +import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.InputTypePropertiesCombo; +import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources; +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.EnvironmentVariables; +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType; + import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.cell.client.AbstractCell; +import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.shared.EventBus; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale; +import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign; +import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction; +import com.sencha.gxt.core.client.Style.SelectionMode; +import com.sencha.gxt.core.client.XTemplates; +import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.data.shared.LabelProvider; +import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.button.ButtonBar; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; +import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent; +import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent.BeforeStartEditHandler; +import com.sencha.gxt.widget.core.client.event.CancelEditEvent; +import com.sencha.gxt.widget.core.client.event.CancelEditEvent.CancelEditHandler; +import com.sencha.gxt.widget.core.client.event.CompleteEditEvent; +import com.sencha.gxt.widget.core.client.event.CompleteEditEvent.CompleteEditHandler; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; +import com.sencha.gxt.widget.core.client.form.ComboBox; +import com.sencha.gxt.widget.core.client.form.TextField; +import com.sencha.gxt.widget.core.client.grid.ColumnConfig; +import com.sencha.gxt.widget.core.client.grid.ColumnModel; +import com.sencha.gxt.widget.core.client.grid.Grid; +import com.sencha.gxt.widget.core.client.grid.Grid.GridCell; +import com.sencha.gxt.widget.core.client.grid.GridSelectionModel; +import com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing; +import com.sencha.gxt.widget.core.client.toolbar.ToolBar; /** * - * @author giancarlo - * email: g.panichi@isti.cnr.it + * @author giancarlo email: g.panichi@isti.cnr.it * */ public class EnvironmentVariablesPanel extends ContentPanel { private EventBus eventBus; - + private ListStore storeEnvironmentVariable; + private Grid gridEnvironmentVariable; + private ListStore storeComboInputType; + private ComboBox comboInputType; + private GridRowEditing gridEnvironmentVariableEditing; + private TextButton btnAdd; + private boolean addStatus; + private int seq = 0; + + interface InputTypeTemplates extends XTemplates { + @XTemplate("{value}") + SafeHtml format(String value); + } public EnvironmentVariablesPanel(EventBus eventBus) { super(); @@ -21,27 +78,264 @@ public class EnvironmentVariablesPanel extends ContentPanel { this.eventBus = eventBus; // msgs = GWT.create(ServiceCategoryMessages.class); - init(); - create(); - + try { + init(); + create(); + } catch (Throwable e) { + e.printStackTrace(); + } } private void init() { - forceLayoutOnResize = true; - setBodyBorder(false); - setBorders(false); setHeaderVisible(false); setResize(true); - + setBodyBorder(false); + setBorders(false); + forceLayoutOnResize = true; } private void create() { - + // Grid + EnvironmentVariablesProperties props = GWT + .create(EnvironmentVariablesProperties.class); - } + ColumnConfig nameColumn = new ColumnConfig( + props.name(), 100, "Name"); + // nameColumn.setMenuDisabled(true); + + ColumnConfig descriptionColumn = new ColumnConfig( + props.name(), 100, "Description"); + // descriptionColumn.setMenuDisabled(true); + + ColumnConfig inputTypeColumn = new ColumnConfig( + props.inputType(), 100, "Type"); + // inputTypeColumn.setMenuDisabled(true); + inputTypeColumn.setCell(new AbstractCell() { + + @Override + public void render(Context context, InputType inputType, + SafeHtmlBuilder sb) { + InputTypeTemplates inputTypeTemplates = GWT + .create(InputTypeTemplates.class); + sb.append(inputTypeTemplates.format(inputType.getLabel())); + } + }); + + ColumnConfig defaultValueColumn = new ColumnConfig( + props.defaultValue(), 100, "Default"); + // defaColumn.setMenuDisabled(true); + + ArrayList> l = new ArrayList>(); + l.add(nameColumn); + l.add(descriptionColumn); + l.add(inputTypeColumn); + l.add(defaultValueColumn); + + ColumnModel columns = new ColumnModel( + l); + + storeEnvironmentVariable = new ListStore( + props.id()); + + /*ArrayList list = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + list.add(new EnvironmentVariables(i, "Test" + i, "Desc", + "defaultValue", InputType.STRING)); + } + + storeEnvironmentVariable.addAll(list);*/ + + final GridSelectionModel sm = new GridSelectionModel(); + sm.setSelectionMode(SelectionMode.SINGLE); + + gridEnvironmentVariable = new Grid( + storeEnvironmentVariable, columns); + gridEnvironmentVariable.setSelectionModel(sm); + gridEnvironmentVariable.getView().setStripeRows(true); + gridEnvironmentVariable.getView().setColumnLines(true); + gridEnvironmentVariable.getView().setAutoExpandColumn(nameColumn); + gridEnvironmentVariable.getView().setAutoFill(true); + gridEnvironmentVariable.setBorders(false); + gridEnvironmentVariable.setColumnReordering(false); + + + /* + * GridDragSource ds = new + * GridDragSource( gridEnvironmentVariable); + * ds.addDragStartHandler(new DndDragStartHandler() { + * + * @Override public void onDragStart(DndDragStartEvent event) { + * + * @SuppressWarnings("unchecked") ArrayList + * draggingSelection = (ArrayList) event + * .getData(); Log.debug("Start Drag: " + draggingSelection); + * + * } }); GridDropTarget dt = new + * GridDropTarget( gridEnvironmentVariable); + * dt.setFeedback(Feedback.BOTH); dt.setAllowSelfAsSource(true); + */ + + // EDITING // + // Key + + InputTypePropertiesCombo inputTypePropertiesCombo = GWT + .create(InputTypePropertiesCombo.class); + + storeComboInputType = new ListStore( + inputTypePropertiesCombo.id()); + + comboInputType = new ComboBox(storeComboInputType, + inputTypePropertiesCombo.label()); + comboInputType.setClearValueOnParseError(false); + comboInputType.setEditable(false); + + comboInputType.setTriggerAction(TriggerAction.ALL); + addHandlersForComboInputType(inputTypePropertiesCombo.label()); + + gridEnvironmentVariableEditing = new GridRowEditing( + gridEnvironmentVariable); + gridEnvironmentVariableEditing.addEditor(nameColumn, new TextField()); + gridEnvironmentVariableEditing.addEditor(descriptionColumn, + new TextField()); + gridEnvironmentVariableEditing + .addEditor(inputTypeColumn, comboInputType); + gridEnvironmentVariableEditing.addEditor(defaultValueColumn, + new TextField()); + + btnAdd = new TextButton("Add"); + btnAdd.setIcon(StatAlgoImporterResources.INSTANCE.add16()); + btnAdd.setScale(ButtonScale.SMALL); + btnAdd.setIconAlign(IconAlign.LEFT); + btnAdd.setToolTip("Add Environment Variable"); + btnAdd.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + addEnvironmentVariable(event); + } + + }); + + TextButton btnDelete = new TextButton("Delete"); + btnDelete.addSelectHandler(new SelectEvent.SelectHandler() { + public void onSelect(SelectEvent event) { + GridCell cell = gridEnvironmentVariableEditing.getActiveCell(); + int rowIndex = cell.getRow(); + + gridEnvironmentVariableEditing.cancelEditing(); + + storeEnvironmentVariable.remove(rowIndex); + storeEnvironmentVariable.commitChanges(); + + gridEnvironmentVariableEditing.getCancelButton() + .setVisible(true); + btnAdd.setEnabled(true); + if (addStatus) { + addStatus = false; + } + } + }); + ButtonBar buttonBar = gridEnvironmentVariableEditing.getButtonBar(); + buttonBar.add(btnDelete); + + gridEnvironmentVariableEditing + .addBeforeStartEditHandler(new BeforeStartEditHandler() { + + @Override + public void onBeforeStartEdit( + BeforeStartEditEvent event) { + editingBeforeStart(event); + + } + }); + + gridEnvironmentVariableEditing + .addCancelEditHandler(new CancelEditHandler() { + + @Override + public void onCancelEdit( + CancelEditEvent event) { + storeEnvironmentVariable.rejectChanges(); + btnAdd.setEnabled(true); + + } + + }); + + gridEnvironmentVariableEditing + .addCompleteEditHandler(new CompleteEditHandler() { + + @Override + public void onCompleteEdit( + CompleteEditEvent event) { + try { + if (addStatus) { + addStatus = false; + } + storeEnvironmentVariable.commitChanges(); + + gridEnvironmentVariableEditing.getCancelButton() + .setVisible(true); + btnAdd.setEnabled(true); + + } catch (Throwable e) { + Log.error("Error in RuleOnTableNewDefinitionCard: " + + e.getLocalizedMessage()); + e.printStackTrace(); + } + } + }); + + ToolBar toolBar = new ToolBar(); + toolBar.add(btnAdd, new BoxLayoutData(new Margins(0))); + + VerticalLayoutContainer vlc = new VerticalLayoutContainer(); + vlc.setAdjustForScroll(false); + vlc.setScrollMode(ScrollMode.NONE); - public void update(){ + vlc.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0))); + vlc.add(gridEnvironmentVariable, new VerticalLayoutData(1, 1, + new Margins(0))); + + add(vlc, new MarginData(new Margins(0))); } - + + private void editingBeforeStart( + BeforeStartEditEvent event) { + // TODO Auto-generated method stub + + } + + private void addHandlersForComboInputType(LabelProvider idI18N) { + // TODO Auto-generated method stub + + } + + private void addEnvironmentVariable(SelectEvent event) { + try { + seq++; + EnvironmentVariables newEnvironmentVariable = new EnvironmentVariables( + seq, "", "", "", InputType.STRING); + Log.debug("New Environment Variable: " + newEnvironmentVariable); + gridEnvironmentVariableEditing.cancelEditing(); + addStatus = true; + gridEnvironmentVariableEditing.getCancelButton().setVisible(false); + storeEnvironmentVariable.add(newEnvironmentVariable); + int row = storeEnvironmentVariable.indexOf(newEnvironmentVariable); + + storeComboInputType.clear(); + storeComboInputType.addAll(InputType.asList()); + storeComboInputType.commitChanges(); + + gridEnvironmentVariableEditing.startEditing(new GridCell(row, 0)); + } catch (Throwable e) { + e.printStackTrace(); + } + } + + public void update() { + + } + } diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/InputTypeMessages.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/InputTypeMessages.java new file mode 100644 index 0000000..82aff87 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/InputTypeMessages.java @@ -0,0 +1,28 @@ +package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input; + +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType; + +import com.google.gwt.i18n.client.Messages; + +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ +public interface InputTypeMessages extends Messages { + + @DefaultMessage("") + @AlternateMessage({ "STRING", "String", + "NUMBER", "Number", + "ENUMERATED", "Enumerated", + "CONSTANT", "Constant", + "RANDOM", "Random", + "FILE", "File", + "MAP", "Map", + "BOOLEAN", "Boolean", + "IMAGES", "Images" }) + String inputType(@Select InputType inputType); + + +} diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/SelectedRowsPanel.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/SelectedRowsPanel.java index c5e5df4..722f739 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/SelectedRowsPanel.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/SelectedRowsPanel.java @@ -1,19 +1,74 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input; +import java.util.ArrayList; + +import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.EnvironmentVariablesProperties; +import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.InputTypePropertiesCombo; +import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources; +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.EnvironmentVariables; +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType; + import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.cell.client.AbstractCell; +import com.google.gwt.core.client.GWT; import com.google.gwt.event.shared.EventBus; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign; +import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction; +import com.sencha.gxt.core.client.Style.SelectionMode; +import com.sencha.gxt.core.client.XTemplates; +import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.data.shared.LabelProvider; +import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.button.ButtonBar; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; +import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent; +import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent.BeforeStartEditHandler; +import com.sencha.gxt.widget.core.client.event.CancelEditEvent; +import com.sencha.gxt.widget.core.client.event.CancelEditEvent.CancelEditHandler; +import com.sencha.gxt.widget.core.client.event.CompleteEditEvent; +import com.sencha.gxt.widget.core.client.event.CompleteEditEvent.CompleteEditHandler; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; +import com.sencha.gxt.widget.core.client.form.ComboBox; +import com.sencha.gxt.widget.core.client.form.TextField; +import com.sencha.gxt.widget.core.client.grid.ColumnConfig; +import com.sencha.gxt.widget.core.client.grid.ColumnModel; +import com.sencha.gxt.widget.core.client.grid.Grid; +import com.sencha.gxt.widget.core.client.grid.Grid.GridCell; +import com.sencha.gxt.widget.core.client.grid.GridSelectionModel; +import com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing; +import com.sencha.gxt.widget.core.client.toolbar.ToolBar; /** * - * @author giancarlo - * email: g.panichi@isti.cnr.it + * @author giancarlo email: g.panichi@isti.cnr.it * */ public class SelectedRowsPanel extends ContentPanel { private EventBus eventBus; - + private ListStore storeEnvironmentVariable; + private Grid gridEnvironmentVariable; + private ListStore storeComboInputType; + private ComboBox comboInputType; + private GridRowEditing gridEnvironmentVariableEditing; + private TextButton btnAdd; + private boolean addStatus; + private int seq = 0; + + interface InputTypeTemplates extends XTemplates { + @XTemplate("{value}") + SafeHtml format(String value); + } public SelectedRowsPanel(EventBus eventBus) { super(); @@ -21,27 +76,263 @@ public class SelectedRowsPanel extends ContentPanel { this.eventBus = eventBus; // msgs = GWT.create(ServiceCategoryMessages.class); - init(); - create(); - + try { + init(); + create(); + } catch (Throwable e) { + e.printStackTrace(); + } } private void init() { - forceLayoutOnResize = true; - setBodyBorder(false); - setBorders(false); setHeaderVisible(false); setResize(true); - + setBodyBorder(false); + setBorders(false); + forceLayoutOnResize = true; } private void create() { + // Grid + EnvironmentVariablesProperties props = GWT + .create(EnvironmentVariablesProperties.class); + + ColumnConfig nameColumn = new ColumnConfig( + props.name(), 100, "Name"); + // nameColumn.setMenuDisabled(true); + + ColumnConfig descriptionColumn = new ColumnConfig( + props.name(), 100, "Description"); + // descriptionColumn.setMenuDisabled(true); + + ColumnConfig inputTypeColumn = new ColumnConfig( + props.inputType(), 100, "Type"); + // inputTypeColumn.setMenuDisabled(true); + inputTypeColumn.setCell(new AbstractCell() { + + @Override + public void render(Context context, InputType inputType, + SafeHtmlBuilder sb) { + InputTypeTemplates inputTypeTemplates = GWT + .create(InputTypeTemplates.class); + sb.append(inputTypeTemplates.format(inputType.getLabel())); + } + }); + + ColumnConfig defaultValueColumn = new ColumnConfig( + props.defaultValue(), 100, "Default"); + // defaColumn.setMenuDisabled(true); + + ArrayList> l = new ArrayList>(); + l.add(nameColumn); + l.add(descriptionColumn); + l.add(inputTypeColumn); + l.add(defaultValueColumn); + + ColumnModel columns = new ColumnModel( + l); + + storeEnvironmentVariable = new ListStore( + props.id()); + + /*ArrayList list = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + list.add(new EnvironmentVariables(i, "Test" + i, "Desc", + "defaultValue", InputType.STRING)); + } + + storeEnvironmentVariable.addAll(list);*/ + + final GridSelectionModel sm = new GridSelectionModel(); + sm.setSelectionMode(SelectionMode.SINGLE); + + gridEnvironmentVariable = new Grid( + storeEnvironmentVariable, columns); + gridEnvironmentVariable.setSelectionModel(sm); + gridEnvironmentVariable.getView().setStripeRows(true); + gridEnvironmentVariable.getView().setColumnLines(true); + gridEnvironmentVariable.getView().setAutoExpandColumn(nameColumn); + gridEnvironmentVariable.getView().setAutoFill(true); + gridEnvironmentVariable.setBorders(false); + gridEnvironmentVariable.setColumnReordering(false); + + + /* + * GridDragSource ds = new + * GridDragSource( gridEnvironmentVariable); + * ds.addDragStartHandler(new DndDragStartHandler() { + * + * @Override public void onDragStart(DndDragStartEvent event) { + * + * @SuppressWarnings("unchecked") ArrayList + * draggingSelection = (ArrayList) event + * .getData(); Log.debug("Start Drag: " + draggingSelection); + * + * } }); GridDropTarget dt = new + * GridDropTarget( gridEnvironmentVariable); + * dt.setFeedback(Feedback.BOTH); dt.setAllowSelfAsSource(true); + */ + + // EDITING // + // Key + + InputTypePropertiesCombo inputTypePropertiesCombo = GWT + .create(InputTypePropertiesCombo.class); + + storeComboInputType = new ListStore( + inputTypePropertiesCombo.id()); + + comboInputType = new ComboBox(storeComboInputType, + inputTypePropertiesCombo.label()); + comboInputType.setClearValueOnParseError(false); + comboInputType.setEditable(false); + + comboInputType.setTriggerAction(TriggerAction.ALL); + addHandlersForComboInputType(inputTypePropertiesCombo.label()); + + gridEnvironmentVariableEditing = new GridRowEditing( + gridEnvironmentVariable); + gridEnvironmentVariableEditing.addEditor(nameColumn, new TextField()); + gridEnvironmentVariableEditing.addEditor(descriptionColumn, + new TextField()); + gridEnvironmentVariableEditing + .addEditor(inputTypeColumn, comboInputType); + gridEnvironmentVariableEditing.addEditor(defaultValueColumn, + new TextField()); + + btnAdd = new TextButton(); + btnAdd.setIcon(StatAlgoImporterResources.INSTANCE.add16()); + //btnAdd.setIconAlign(IconAlign.); + btnAdd.setToolTip("Add Environment Variable"); + btnAdd.addSelectHandler(new SelectHandler() { + + @Override + public void onSelect(SelectEvent event) { + addEnvironmentVariable(event); + } + + }); + + TextButton btnDelete = new TextButton("Delete"); + btnDelete.addSelectHandler(new SelectEvent.SelectHandler() { + public void onSelect(SelectEvent event) { + GridCell cell = gridEnvironmentVariableEditing.getActiveCell(); + int rowIndex = cell.getRow(); + + gridEnvironmentVariableEditing.cancelEditing(); + + storeEnvironmentVariable.remove(rowIndex); + storeEnvironmentVariable.commitChanges(); + + gridEnvironmentVariableEditing.getCancelButton() + .setVisible(true); + btnAdd.setEnabled(true); + if (addStatus) { + addStatus = false; + } + } + }); + ButtonBar buttonBar = gridEnvironmentVariableEditing.getButtonBar(); + buttonBar.add(btnDelete); + + gridEnvironmentVariableEditing + .addBeforeStartEditHandler(new BeforeStartEditHandler() { + + @Override + public void onBeforeStartEdit( + BeforeStartEditEvent event) { + editingBeforeStart(event); + + } + }); + + gridEnvironmentVariableEditing + .addCancelEditHandler(new CancelEditHandler() { + + @Override + public void onCancelEdit( + CancelEditEvent event) { + storeEnvironmentVariable.rejectChanges(); + btnAdd.setEnabled(true); + + } + + }); + + gridEnvironmentVariableEditing + .addCompleteEditHandler(new CompleteEditHandler() { + + @Override + public void onCompleteEdit( + CompleteEditEvent event) { + try { + if (addStatus) { + addStatus = false; + } + storeEnvironmentVariable.commitChanges(); + + gridEnvironmentVariableEditing.getCancelButton() + .setVisible(true); + btnAdd.setEnabled(true); + + } catch (Throwable e) { + Log.error("Error in RuleOnTableNewDefinitionCard: " + + e.getLocalizedMessage()); + e.printStackTrace(); + } + } + }); + + ToolBar toolBar = new ToolBar(); + toolBar.add(btnAdd, new BoxLayoutData(new Margins(0))); + + VerticalLayoutContainer vlc = new VerticalLayoutContainer(); + vlc.setAdjustForScroll(false); + vlc.setScrollMode(ScrollMode.NONE); + vlc.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0))); + vlc.add(gridEnvironmentVariable, new VerticalLayoutData(1, 1, + new Margins(0))); + + add(vlc, new MarginData(new Margins(0))); } - - public void update(){ - + + private void editingBeforeStart( + BeforeStartEditEvent event) { + // TODO Auto-generated method stub + } - + + private void addHandlersForComboInputType(LabelProvider idI18N) { + // TODO Auto-generated method stub + + } + + private void addEnvironmentVariable(SelectEvent event) { + try { + seq++; + EnvironmentVariables newEnvironmentVariable = new EnvironmentVariables( + seq, "", "", "", InputType.STRING); + Log.debug("New Environment Variable: " + newEnvironmentVariable); + gridEnvironmentVariableEditing.cancelEditing(); + addStatus = true; + gridEnvironmentVariableEditing.getCancelButton().setVisible(false); + storeEnvironmentVariable.add(newEnvironmentVariable); + int row = storeEnvironmentVariable.indexOf(newEnvironmentVariable); + + storeComboInputType.clear(); + storeComboInputType.addAll(InputType.asList()); + storeComboInputType.commitChanges(); + + gridEnvironmentVariableEditing.startEditing(new GridCell(row, 0)); + } catch (Throwable e) { + e.printStackTrace(); + } + } + + public void update() { + + } + } diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/upload/CodeUploadPanel.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/upload/CodeUploadPanel.java index 94fda16..876d111 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/upload/CodeUploadPanel.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/upload/CodeUploadPanel.java @@ -80,7 +80,7 @@ public class CodeUploadPanel extends FormPanel { setMethod(Method.POST); uploadCodeBtn = new TextButton("Upload"); - uploadCodeBtn.setIcon(StatAlgoImporterResources.INSTANCE.upload32()); + uploadCodeBtn.setIcon(StatAlgoImporterResources.INSTANCE.upload24()); uploadCodeBtn.setIconAlign(IconAlign.RIGHT); uploadCodeBtn.setToolTip("Upload Code"); @@ -106,7 +106,7 @@ public class CodeUploadPanel extends FormPanel { }); cancelBtn = new TextButton("Cancel"); - cancelBtn.setIcon(StatAlgoImporterResources.INSTANCE.cancel32()); + cancelBtn.setIcon(StatAlgoImporterResources.INSTANCE.cancel24()); cancelBtn.setIconAlign(IconAlign.RIGHT); cancelBtn.setEnabled(false); @@ -194,7 +194,7 @@ public class CodeUploadPanel extends FormPanel { fieldSet.add(vlc); - add(fieldSet, new MarginData(new Margins(5, 0, 0, 7))); + add(fieldSet, new MarginData(new Margins(5, 7, 2, 7))); } diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/EnvironmentVariables.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/EnvironmentVariables.java new file mode 100644 index 0000000..c7dba32 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/EnvironmentVariables.java @@ -0,0 +1,91 @@ +package org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input; + +import java.io.Serializable; + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public class EnvironmentVariables implements Serializable { + + private static final long serialVersionUID = -2519686355634242523L; + private int id; + private String name; + private String description; + private String defaultValue; + private InputType inputType; + + public EnvironmentVariables() { + super(); + } + + /** + * + * @param id + * @param name + * @param description + * @param defaultValue + * @param inputType + */ + public EnvironmentVariables(int id, String name, String description, + String defaultValue, InputType inputType) { + super(); + this.id = id; + this.name = name; + this.description = description; + this.defaultValue = defaultValue; + this.inputType = inputType; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + public InputType getInputType() { + return inputType; + } + + public void setInputType(InputType inputType) { + this.inputType = inputType; + } + + @Override + public String toString() { + return "EnvironmentVariables [id=" + id + ", name=" + name + + ", description=" + description + ", defaultValue=" + + defaultValue + ", inputType=" + inputType + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/InputType.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/InputType.java new file mode 100644 index 0000000..01031bb --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/InputType.java @@ -0,0 +1,64 @@ +package org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input; + +import java.util.Arrays; +import java.util.List; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public enum InputType { + STRING("String"), + NUMBER("Number"), + ENUMERATED("Enumerated"), + CONSTANT("Constant"), + RANDOM("Random"), + FILE("File"), + MAP("Map"), + BOOLEAN("Boolean"), + IMAGES("Images"); + + + //private static InputTypeMessages msgs=GWT.create(InputTypeMessages.class); + private String id; + + //private static List inputTypeI18NList; + + /*static { + inputTypeI18NList = new ArrayList(); + for (InputType itype : values()) { + inputTypeI18NList.add(msgs.inputType(itype)); + } + }*/ + + private InputType(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public String toString() { + return id; + } + + public String getLabel(){ + //return msgs.inputType(this); + return id; + } + + + public static List asList() { + List list = Arrays.asList(values()); + return list; + } + + /*public static List asI18NList() { + return inputTypeI18NList; + + }*/ + +} diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_16.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_16.png new file mode 100644 index 0000000..9a17af8 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_16.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_24.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_24.png new file mode 100644 index 0000000..dd62ee8 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/add_24.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/algorithm_24.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/algorithm_24.png new file mode 100644 index 0000000..b2c39e7 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/algorithm_24.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/cancel_24.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/cancel_24.png new file mode 100644 index 0000000..9d95f89 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/cancel_24.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_16.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_16.png new file mode 100644 index 0000000..ea9d426 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_16.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_24.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_24.png new file mode 100644 index 0000000..4703d05 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/delete_24.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/help_24.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/help_24.png new file mode 100644 index 0000000..819da89 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/help_24.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-create_24.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-create_24.png new file mode 100644 index 0000000..8a3f8ed Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-create_24.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-open_24.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-open_24.png new file mode 100644 index 0000000..b482ca2 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/project-open_24.png differ diff --git a/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/upload_24.png b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/upload_24.png new file mode 100644 index 0000000..ec8bac0 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/statisticalalgorithmsimporter/client/resource/upload_24.png differ