Added support to default value for ListParameter [#24026]
|
@ -4,6 +4,9 @@
|
|||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="data-miner-manager-cl-1.10.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/data-miner-manager-cl/data-miner-manager-cl">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="java-output-path" value="/data-miner-manager/target/data-miner-executor-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<property name="context-root" value="data-miner-executor"/>
|
||||
</wb-module>
|
||||
|
|
|
@ -3,19 +3,19 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
# Changelog for "data-miner-executor"
|
||||
|
||||
|
||||
## [v1.4.0-SNAPSHOT]
|
||||
|
||||
- Updated to maven-portal-bom-3.7.0 [#22732]
|
||||
- Added support to default value for ListParameter [#24026]
|
||||
|
||||
|
||||
## [v1.3.0] - 2021-10-06
|
||||
|
||||
### Features
|
||||
|
||||
- Added cluster description in Service Info [#19213]
|
||||
|
||||
- Added cluster description in Service Info [#19213]
|
||||
|
||||
|
||||
## [v1.2.0] - 2019-10-02
|
||||
|
||||
### Features
|
||||
|
||||
- Added service info [#12594]
|
||||
- Added support to show log information [#11711]
|
||||
- Added support to show files html, json, pdf, txt [#17106]
|
||||
|
@ -23,21 +23,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
- Added Item Id support [#16503]
|
||||
|
||||
|
||||
|
||||
## [v1.1.0] - 2019-03-13
|
||||
|
||||
### Features
|
||||
|
||||
- Added automatic run [#16155]
|
||||
|
||||
|
||||
|
||||
## [v1.0.0] - 2019-01-31
|
||||
|
||||
### Features
|
||||
|
||||
- First release
|
||||
|
||||
|
||||
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets.user.data-miner-executor.1-3-0" date="2021-10-06">
|
||||
<Changeset
|
||||
component="org.gcube.portlets.user.data-miner-executor.1-4-0"
|
||||
date="2022-12-14">
|
||||
<Change>Updated to maven-portal-bom-3.7.0 [#22732]</Change>
|
||||
<Change>Added support to default value for ListParameter [#24026]
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.user.data-miner-executor.1-3-0"
|
||||
date="2021-10-06">
|
||||
<Change>Updated to Git and Jenkins</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets.user.data-miner-executor.1-2-0" date="2019-10-02">
|
||||
<Changeset
|
||||
component="org.gcube.portlets.user.data-miner-executor.1-2-0"
|
||||
date="2019-10-02">
|
||||
<Change>Added service info [#12594]</Change>
|
||||
<Change>Added support to show log information [#11711]</Change>
|
||||
<Change>Added support to show files html, json, pdf, txt [#17106]
|
||||
|
@ -12,10 +23,14 @@
|
|||
</Change>
|
||||
<Change>Added Item Id support [#16503]</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets.user.data-miner-executor.1-1-0" date="2019-03-13">
|
||||
<Changeset
|
||||
component="org.gcube.portlets.user.data-miner-executor.1-1-0"
|
||||
date="2019-03-13">
|
||||
<Change>Added automatic run [#16155]</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets.user.data-miner-executor.1-0-0" date="2019-01-31">
|
||||
<Changeset
|
||||
component="org.gcube.portlets.user.data-miner-executor.1-0-0"
|
||||
date="2019-01-31">
|
||||
<Change>First release</Change>
|
||||
</Changeset>
|
||||
</ReleaseNotes>
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>data-miner-executor</artifactId>
|
||||
<version>1.3.0</version>
|
||||
<version>1.4.0-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>data-miner-executor</name>
|
||||
|
@ -285,7 +285,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<version>3.7.0-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/DataMinerExecutor.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/DataMinerExecutorController.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/Header.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/HomePanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/PortalViewport.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/common/EventBusProvider.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/Gxt2ZIndexXDOM.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/GreenProgressBar.css
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/GreenProgressBar.html
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/GreenProgressBar.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/GreenProgressBarAppearance.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/OrangeProgressBar.css
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/OrangeProgressBar.html
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/OrangeProgressBar.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/OrangeProgressBarAppearance.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/RedProgressBar.css
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/RedProgressBar.html
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/RedProgressBar.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/RedProgressBarAppearance.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/green-bg.gif
Normal file → Executable file
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 496 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/green-progress-bg.gif
Normal file → Executable file
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/orange-bg.gif
Normal file → Executable file
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 462 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/orange-progress-bg.gif
Normal file → Executable file
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/red-bg.gif
Normal file → Executable file
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 492 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/custom/progress/red-progress-bg.gif
Normal file → Executable file
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/CancelComputationExecutionRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/CancelExecutionFromComputationsRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/ComputationDataEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/ComputationDataRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/ComputationReadyEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/DeleteItemRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/InvocationModelEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/InvocationModelRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/MenuEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/MenuSwitchEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/OutputDataEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/OutputDataRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/RemoveSelectedOperatorEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/ResubmitComputationExecutionEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/ResubmitComputationExecutionRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/ServiceInfoEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/ServiceInfoRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/SessionExpiredEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/StartComputationExecutionEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/StartComputationExecutionRequestEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/SyncRefreshUploadDataSpaceEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/TabularFldChangeEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/UIStateEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/events/WPSMenuEvent.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/ComputationExecutionPanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/ComputationOutputPanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/ComputationPanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/ComputationParametersPanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/ComputationStatusPanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/EquivalentRequestDialog.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/ExperimentPanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/LinkToMonitorComputationDialog.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/experiments/WorkflowPanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/info/ServiceInfoDataProperties.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/info/ServiceInfoPanel.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/monitor/StatusMonitor.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/parametersfield/AbstractFld.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/parametersfield/ColumnListFld.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/parametersfield/FileFld.java
Normal file → Executable file
196
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/parametersfield/ListStringFld.java
Normal file → Executable file
|
@ -3,20 +3,22 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.dataminerexecutor.client.parametersfield;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ListParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
|
||||
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -27,75 +29,132 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
|
|||
public class ListStringFld extends AbstractFld {
|
||||
|
||||
private SimpleContainer fieldContainer;
|
||||
// private TextField textField;
|
||||
private String value;
|
||||
private HBoxLayoutContainer horiz;
|
||||
private SimpleContainer listContainer;
|
||||
private VerticalLayoutContainer vp;
|
||||
private List<StringItem> items;
|
||||
private ListParameter listParameter;
|
||||
|
||||
/**
|
||||
* @param parameter
|
||||
* parameter
|
||||
*
|
||||
* @param parameter parameter
|
||||
*/
|
||||
public ListStringFld(Parameter parameter) {
|
||||
super(parameter);
|
||||
|
||||
// ObjectParameter p = (ObjectParameter) parameter;
|
||||
Log.debug("Create String List field: " + parameter.getName());
|
||||
value = parameter.getValue();
|
||||
listParameter = (ListParameter) parameter;
|
||||
|
||||
ListParameter listParameter = (ListParameter) parameter;
|
||||
|
||||
StringBuilder columnListHtml = new StringBuilder();
|
||||
String tempValue = new String(value);
|
||||
int pos = tempValue.indexOf(listParameter.getSeparator());
|
||||
while (pos > -1) {
|
||||
SafeHtmlBuilder safeValue = new SafeHtmlBuilder();
|
||||
safeValue.appendEscaped(tempValue.substring(0, pos));
|
||||
columnListHtml.append("<span style='display:block;overflow-wrap: break-word;'>"
|
||||
+ safeValue.toSafeHtml().asString() + "</span>");
|
||||
tempValue = tempValue.substring(pos + 1, tempValue.length());
|
||||
pos = tempValue.indexOf(listParameter.getSeparator());
|
||||
}
|
||||
if (tempValue != null && !tempValue.isEmpty()) {
|
||||
SafeHtmlBuilder safeValue = new SafeHtmlBuilder();
|
||||
safeValue.appendEscaped(tempValue);
|
||||
columnListHtml.append("<span style='display:block;overflow-wrap: break-word;'>"
|
||||
+ safeValue.toSafeHtml().asString() + "</span>");
|
||||
} else {
|
||||
columnListHtml.append("<span style='display:block;overflow-wrap: break-word;'></span>");
|
||||
}
|
||||
|
||||
HtmlLayoutContainer descr;
|
||||
|
||||
descr = new HtmlLayoutContainer("<p style='margin-left:5px !important;'></p>");
|
||||
descr.addStyleName("workflow-fieldDescription");
|
||||
|
||||
descr = new HtmlLayoutContainer(
|
||||
"<p style='margin-left:5px !important;'>" + parameter.getDescription() + "</p>");
|
||||
descr.addStyleName("workflow-fieldDescription");
|
||||
|
||||
SimpleContainer vContainer = new SimpleContainer();
|
||||
VerticalLayoutContainer vField = new VerticalLayoutContainer();
|
||||
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer("");
|
||||
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||
|
||||
HtmlLayoutContainer val = new HtmlLayoutContainer(columnListHtml.toString());
|
||||
val.addStyleName("workflow-fieldValue");
|
||||
|
||||
vField.add(val, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
|
||||
vField.add(typeDescription, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
vContainer.add(vField);
|
||||
listContainer = new SimpleContainer();
|
||||
vp = new VerticalLayoutContainer();
|
||||
items = new ArrayList<StringItem>();
|
||||
listContainer.add(vp, new MarginData(new Margins()));
|
||||
|
||||
fieldContainer = new SimpleContainer();
|
||||
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||
horiz = new HBoxLayoutContainer();
|
||||
horiz.setPack(BoxLayoutPack.START);
|
||||
horiz.setEnableOverflow(false);
|
||||
|
||||
horiz.add(vContainer, new BoxLayoutData(new Margins()));
|
||||
horiz.add(descr, new BoxLayoutData(new Margins()));
|
||||
HtmlLayoutContainer descr;
|
||||
|
||||
if (listParameter.getDescription() == null) {
|
||||
descr = new HtmlLayoutContainer("<p style='margin-left:5px !important;'></p>");
|
||||
descr.addStyleName("workflow-fieldDescription");
|
||||
|
||||
} else {
|
||||
/* listContainer.setToolTip(listParameter.getDescription()); */
|
||||
descr = new HtmlLayoutContainer(
|
||||
"<p style='margin-left:5px !important;'>" + listParameter.getDescription() + "</p>");
|
||||
descr.addStyleName("workflow-fieldDescription");
|
||||
}
|
||||
|
||||
horiz.add(listContainer, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(descr, new BoxLayoutData(new Margins(0)));
|
||||
|
||||
fieldContainer.add(horiz);
|
||||
fieldContainer.forceLayout();
|
||||
addField(null);
|
||||
}
|
||||
|
||||
protected void addField(StringItem upperItem) {
|
||||
|
||||
if (upperItem == null) {
|
||||
if (listParameter.getDefaultValue() == null || listParameter.getDefaultValue().isEmpty()) {
|
||||
ObjectParameter objPar = new ObjectParameter(listParameter.getName(), listParameter.getDescription(),
|
||||
listParameter.getType(), listParameter.getDefaultValue());
|
||||
StringItem item = new StringItem(this, objPar, true);
|
||||
items.add(item);
|
||||
vp.add(item);
|
||||
} else {
|
||||
String separator=listParameter.getSeparator();
|
||||
String tmpDefault=listParameter.getDefaultValue();
|
||||
int firstSharp=tmpDefault.indexOf(separator);
|
||||
if(firstSharp>-1) {
|
||||
String[] defaultValues=tmpDefault.split(separator);
|
||||
int pos=0;
|
||||
for(String dv:defaultValues) {
|
||||
ObjectParameter objPar = new ObjectParameter(listParameter.getName(), listParameter.getDescription(),
|
||||
listParameter.getType(), dv);
|
||||
StringItem item=null;
|
||||
if(pos==0) {
|
||||
item = new StringItem(this, objPar, true);
|
||||
} else {
|
||||
item = new StringItem(this, objPar, false);
|
||||
}
|
||||
items.add(pos,item);
|
||||
vp.insert(item,pos);
|
||||
pos+=1;
|
||||
item.showCancelButton();
|
||||
item.forceLayout();
|
||||
}
|
||||
} else {
|
||||
ObjectParameter objPar = new ObjectParameter(listParameter.getName(), listParameter.getDescription(),
|
||||
listParameter.getType(), listParameter.getDefaultValue());
|
||||
StringItem item = new StringItem(this, objPar, true);
|
||||
items.add(item);
|
||||
vp.add(item);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ObjectParameter objPar = new ObjectParameter(listParameter.getName(), listParameter.getDescription(),
|
||||
listParameter.getType(), null);
|
||||
// search the position of the upper item
|
||||
int pos = items.indexOf(upperItem);
|
||||
if (pos > -1) {
|
||||
upperItem.showCancelButton();
|
||||
upperItem.forceLayout();
|
||||
StringItem item = new StringItem(this, objPar, false);
|
||||
items.add(pos + 1, item);
|
||||
vp.insert(item, pos + 1);// don't use new VerticalLayoutData(1,
|
||||
// -1,new Margins(0))
|
||||
} else {
|
||||
upperItem.forceLayout();
|
||||
StringItem item = new StringItem(this, objPar, true);
|
||||
items.add(item);
|
||||
vp.add(item);// don't use new VerticalLayoutData(-1, -1, new
|
||||
// Margins(0))
|
||||
}
|
||||
}
|
||||
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
||||
protected void forceLayout() {
|
||||
vp.forceLayout();
|
||||
horiz.forceLayout();
|
||||
fieldContainer.forceLayout();
|
||||
}
|
||||
|
||||
protected void removeField(StringItem item) {
|
||||
items.remove(item);
|
||||
|
||||
vp.remove(item);
|
||||
|
||||
if (items.size() == 1) {
|
||||
items.get(0).hideCancelButton();
|
||||
items.get(0).forceLayout();
|
||||
}
|
||||
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,6 +162,16 @@ public class ListStringFld extends AbstractFld {
|
|||
*/
|
||||
@Override
|
||||
public String getValue() {
|
||||
String separator = listParameter.getSeparator();
|
||||
String value = "";
|
||||
boolean first = true;
|
||||
for (StringItem item : items) {
|
||||
String itemValue = item.getValue();
|
||||
if (itemValue != null && !itemValue.contentEquals("")) {
|
||||
value += (first ? "" : separator) + itemValue;
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@ -114,13 +183,18 @@ public class ListStringFld extends AbstractFld {
|
|||
return fieldContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
if (value != null && !value.isEmpty()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
boolean valid = false;
|
||||
for (StringItem item : items)
|
||||
if (item.isValid()) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/parametersfield/OperatorFieldWidget.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/parametersfield/StringFld.java
Normal file → Executable file
|
@ -0,0 +1,100 @@
|
|||
package org.gcube.portlets.user.dataminerexecutor.client.parametersfield;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.portlets.user.dataminerexecutor.client.DataMinerExecutor;
|
||||
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class StringItem extends HBoxLayoutContainer {
|
||||
private ListStringFld parent;
|
||||
private TextField field;
|
||||
private TextButton addBtn;
|
||||
private TextButton removeBtn;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parent parend
|
||||
* @param objectParameter object parameter
|
||||
* @param first true if is first
|
||||
*/
|
||||
public StringItem(ListStringFld parent, ObjectParameter objectParameter, boolean first) {
|
||||
super();
|
||||
this.parent=parent;
|
||||
create(objectParameter,first);
|
||||
}
|
||||
|
||||
private void create( ObjectParameter objectParameter, boolean first){
|
||||
field = new TextField();
|
||||
field.setAllowBlank(false);
|
||||
|
||||
if(objectParameter!=null && objectParameter.getDefaultValue()!=null &&
|
||||
!objectParameter.getDefaultValue().isEmpty()) {
|
||||
field.setValue(objectParameter.getDefaultValue());
|
||||
}
|
||||
|
||||
addBtn = new TextButton("");
|
||||
|
||||
addBtn.setIcon(DataMinerExecutor.resources.add());
|
||||
|
||||
addBtn.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
parent.addField(StringItem.this);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
removeBtn = new TextButton("");
|
||||
|
||||
removeBtn.setIcon(DataMinerExecutor.resources.cancel());
|
||||
|
||||
removeBtn.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
parent.removeField(StringItem.this);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
removeBtn.setVisible(!first);
|
||||
|
||||
setPack(BoxLayoutPack.START);
|
||||
setEnableOverflow(false);
|
||||
add(field, new BoxLayoutData(new Margins()));
|
||||
add(addBtn, new BoxLayoutData(new Margins()));
|
||||
add(removeBtn, new BoxLayoutData(new Margins()));
|
||||
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
public void showCancelButton() {
|
||||
removeBtn.setVisible(true);
|
||||
}
|
||||
|
||||
public void hideCancelButton() {
|
||||
removeBtn.setVisible(false);
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return field.getCurrentValue();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return field.isValid();
|
||||
}
|
||||
|
||||
}
|
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/parametersfield/TabularFld.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/parametersfield/TabularListFld.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/properties/ColumnItemProperties.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/properties/ColumnItemPropertiesCombo.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/Resources.java
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/WikiLink.txt
Normal file → Executable file
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/add.png
Normal file → Executable file
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 733 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/ajax-complete.gif
Normal file → Executable file
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 137 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/ajax-error.gif
Normal file → Executable file
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 293 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/ajax-loader-big.gif
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/ajax-loader.gif
Normal file → Executable file
Before Width: | Height: | Size: 723 B After Width: | Height: | Size: 723 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/alert.gif
Normal file → Executable file
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/arrow_right.png
Normal file → Executable file
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
0
src/main/java/org/gcube/portlets/user/dataminerexecutor/client/resources/cancel.png
Normal file → Executable file
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |