2521: Explore the possibility to port the StatMan interface onto Dataminer
https://support.d4science.org/issues/2521 Fixed Layout on Fields Parameters git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@127004 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
98f8c1859d
commit
b7094db85a
|
@ -0,0 +1,66 @@
|
||||||
|
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
|
import com.google.gwt.event.shared.HasHandlers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start Computation Event
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi" <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class TabularFldChangeEvent extends
|
||||||
|
GwtEvent<TabularFldChangeEvent.TabularFldChangeEventHandler> {
|
||||||
|
|
||||||
|
public static Type<TabularFldChangeEventHandler> TYPE = new Type<TabularFldChangeEventHandler>();
|
||||||
|
private TableItemSimple tableItemSimple;
|
||||||
|
|
||||||
|
public interface TabularFldChangeEventHandler extends EventHandler {
|
||||||
|
void onChange(TabularFldChangeEvent event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface HasTabularFldChangeEventHandler extends HasHandlers {
|
||||||
|
public HandlerRegistration addTabularFldChangeEventHandler(
|
||||||
|
TabularFldChangeEventHandler handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TabularFldChangeEvent(TableItemSimple tableItemSimple) {
|
||||||
|
this.tableItemSimple = tableItemSimple;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(TabularFldChangeEventHandler handler) {
|
||||||
|
handler.onChange(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<TabularFldChangeEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Type<TabularFldChangeEventHandler> getType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fire(HasHandlers source, TabularFldChangeEvent event) {
|
||||||
|
source.fireEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TableItemSimple getTableItemSimple() {
|
||||||
|
return tableItemSimple;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TabularFldChangeEvent [tableItemSimple=" + tableItemSimple
|
||||||
|
+ "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,11 +2,9 @@ package org.gcube.portlets.user.dataminermanager.client.experimentArea;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent;
|
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent.ComponentRefreshLayoutEventHandler;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent.StartComputationEventHandler;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent.HasStartComputationEventHandler;
|
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent.HasStartComputationEventHandler;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.StartComputationEvent.StartComputationEventHandler;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.experimentArea.ComputationParametersPanel.ComputationParametersPanelHandler;
|
import org.gcube.portlets.user.dataminermanager.client.experimentArea.ComputationParametersPanel.ComputationParametersPanelHandler;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.HandlerRegistration;
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
|
@ -93,7 +91,7 @@ public class ComputationPanel extends FramedPanel implements
|
||||||
v.clear();
|
v.clear();
|
||||||
CenterLayoutContainer centerContainer = new CenterLayoutContainer();
|
CenterLayoutContainer centerContainer = new CenterLayoutContainer();
|
||||||
centerContainer.add(new HTML(
|
centerContainer.add(new HTML(
|
||||||
"<p align='center'>Select an operator.</p>"));
|
"<span align='center'>Select an operator.</span>"));
|
||||||
v.add(centerContainer, new VerticalLayoutData(1, 1, new Margins(0)));
|
v.add(centerContainer, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||||
forceLayout();
|
forceLayout();
|
||||||
|
|
||||||
|
@ -111,6 +109,7 @@ public class ComputationPanel extends FramedPanel implements
|
||||||
v.add(computationParametersPanel, new VerticalLayoutData(1, -1,
|
v.add(computationParametersPanel, new VerticalLayoutData(1, -1,
|
||||||
new Margins(0,5,5,5)));
|
new Margins(0,5,5,5)));
|
||||||
removeAllButton.setEnabled(true);
|
removeAllButton.setEnabled(true);
|
||||||
|
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,9 @@ import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent.ComponentRefreshLayoutEventHandler;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.ComponentRefreshLayoutEvent.HasComponentRefreshLayoutEventHandler;
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.AbstractFld;
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.AbstractFld;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.ColumnFld;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.ColumnListFld;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.OperatorFieldWidget;
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.OperatorFieldWidget;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.parametersfield.TabularFld;
|
import org.gcube.portlets.user.dataminermanager.client.parametersfield.TabularFld;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||||
|
@ -24,12 +23,10 @@ import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.event.shared.HandlerRegistration;
|
|
||||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||||
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
||||||
import com.google.gwt.resources.client.ImageResource;
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||||
|
@ -73,11 +70,7 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
private TextField titleField;
|
private TextField titleField;
|
||||||
private String defaultComputationTitle;
|
private String defaultComputationTitle;
|
||||||
|
|
||||||
/*
|
private TextButton submit;
|
||||||
* public ComputationParametersPanel(DataMinerPortletServiceAsync service,
|
|
||||||
* Operator operator, ComputationParametersPanelHandler handler) {
|
|
||||||
* this(operator); this.setHandler(handler); }
|
|
||||||
*/
|
|
||||||
|
|
||||||
public ComputationParametersPanel(Operator operator) {
|
public ComputationParametersPanel(Operator operator) {
|
||||||
super();
|
super();
|
||||||
|
@ -92,7 +85,6 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
addStyleName("workflow");
|
addStyleName("workflow");
|
||||||
}
|
}
|
||||||
|
@ -107,19 +99,23 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
img.setStylePrimaryName("workflow-icon");
|
img.setStylePrimaryName("workflow-icon");
|
||||||
v.add(img, new VerticalLayoutData(-1, -1, new Margins(-10, 0, 0, 5)));
|
v.add(img, new VerticalLayoutData(-1, -1, new Margins(-10, 0, 0, 5)));
|
||||||
|
|
||||||
HtmlLayoutContainer title = new HtmlLayoutContainer(operator.getName());
|
HtmlLayoutContainer title = new HtmlLayoutContainer("<span>"
|
||||||
|
+ operator.getName() + "</span>");
|
||||||
title.addStyleName("workflow-title");
|
title.addStyleName("workflow-title");
|
||||||
v.add(title, new VerticalLayoutData(-1, -1, new Margins(15, 0, 0, -25)));
|
v.add(title, new VerticalLayoutData(-1, -1, new Margins(15, 0, 0, -25)));
|
||||||
|
|
||||||
String descr = operator.getDescription();
|
String descr = operator.getDescription();
|
||||||
descr = (descr == null || descr.contentEquals("")) ? "no-description"
|
descr = (descr == null || descr.contentEquals("")) ? "no-description"
|
||||||
: operator.getDescription();
|
: operator.getDescription();
|
||||||
HtmlLayoutContainer description = new HtmlLayoutContainer(descr);
|
HtmlLayoutContainer description = new HtmlLayoutContainer("<span>"
|
||||||
|
+ descr + "</span>");
|
||||||
description.addStyleName("workflow-description");
|
description.addStyleName("workflow-description");
|
||||||
v.add(description, new VerticalLayoutData(-1, -1, new Margins(0,0,0,5)));
|
v.add(description, new VerticalLayoutData(-1, -1, new Margins(0, 5, 0,
|
||||||
|
10)));
|
||||||
|
|
||||||
addTitleField();
|
addTitleField();
|
||||||
|
|
||||||
|
|
||||||
parametersPanel = new FormPanel() {
|
parametersPanel = new FormPanel() {
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid(boolean preventMark) {
|
public boolean isValid(boolean preventMark) {
|
||||||
|
@ -136,21 +132,55 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
//parametersPanel = new FramedPanel();
|
||||||
|
parametersPanel.setDeferHeight(false);
|
||||||
parametersPanel.setBorders(false);
|
parametersPanel.setBorders(false);
|
||||||
|
|
||||||
// parametersPanel.getElement().getStyle().setMargin(20, px);
|
// parametersPanel.getElement().getStyle().setMargin(20, px);
|
||||||
parametersFieldSet = new FieldSet();
|
parametersFieldSet = new FieldSet();
|
||||||
parametersFieldSet.setHeadingText("Parameters");
|
parametersFieldSet.setHeadingText("Parameters");
|
||||||
|
|
||||||
vParameters = new VerticalLayoutContainer();
|
vParameters = new VerticalLayoutContainer();
|
||||||
|
|
||||||
|
Image imgLoading = new Image(PRELOAD_IMAGE);
|
||||||
|
vParameters.add(imgLoading, new VerticalLayoutData(1, -1, new Margins(5)));
|
||||||
|
|
||||||
parametersFieldSet.add(vParameters, new MarginData(0));
|
parametersFieldSet.add(vParameters, new MarginData(0));
|
||||||
parametersFieldSet.setCollapsible(false);
|
parametersFieldSet.setCollapsible(false);
|
||||||
parametersPanel.add(parametersFieldSet, new MarginData(new Margins(5,5, 5, 5)));
|
parametersPanel.add(parametersFieldSet, new MarginData(new Margins(5)));
|
||||||
|
|
||||||
v.add(parametersPanel, new VerticalLayoutData(1, -1, new Margins()));
|
v.add(parametersPanel, new VerticalLayoutData(1, -1, new Margins()));
|
||||||
|
|
||||||
|
submit = new TextButton("Start Computation");
|
||||||
|
submit.setToolTip(START_BUTTON_TOOLTIP);
|
||||||
|
submit.setIcon(DataMinerManager.resources.startComputation());
|
||||||
|
|
||||||
|
|
||||||
|
submit.getElement().getStyle().setMarginLeft(20, Unit.PX);
|
||||||
|
submit.getElement().getStyle().setMarginBottom(20, Unit.PX);
|
||||||
|
|
||||||
|
submit.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
if (handler != null && parametersPanel.isValid()) {
|
||||||
|
String value = titleField.getValue();
|
||||||
|
String title = (value == null || value.contentEquals("")) ? defaultComputationTitle
|
||||||
|
: value;
|
||||||
|
handler.startComputation(title, title); // TODO insert
|
||||||
|
// description
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
v.add(submit);
|
||||||
|
//, new VerticalLayoutData(-1, -1, new Margins(0, 0, 20, 20)));
|
||||||
|
submit.setVisible(false);
|
||||||
|
|
||||||
|
forceLayout();
|
||||||
|
|
||||||
loadOperatorParameters();
|
loadOperatorParameters();
|
||||||
|
|
||||||
fireEvent(new ComponentRefreshLayoutEvent());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -162,7 +192,7 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
titleField.setValue(defaultComputationTitle);
|
titleField.setValue(defaultComputationTitle);
|
||||||
FieldLabel titleLabel = new FieldLabel(titleField, "Computation Title");
|
FieldLabel titleLabel = new FieldLabel(titleField, "Computation Title");
|
||||||
v.add(titleLabel, new VerticalLayoutData(-1, -1,
|
v.add(titleLabel, new VerticalLayoutData(-1, -1,
|
||||||
new Margins(0,0,0,5)));
|
new Margins(5, 0, 0, 5)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -185,10 +215,8 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
"Impossible to retrieve parameters.");
|
"Impossible to retrieve parameters.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Image img = new Image(PRELOAD_IMAGE);
|
|
||||||
img.setStyleName("workflow-parameters-preload");
|
|
||||||
vParameters.add(img, new VerticalLayoutData(-1, -1, new Margins()));
|
|
||||||
forceLayout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -220,7 +248,20 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
if (tabularField != null) {
|
if (tabularField != null) {
|
||||||
AbstractFld field = fieldWidgetsMap
|
AbstractFld field = fieldWidgetsMap
|
||||||
.get(p.getName()).getField();
|
.get(p.getName()).getField();
|
||||||
tabularField.addChangeListener(field);
|
if (field instanceof ColumnFld) {
|
||||||
|
ColumnFld columnField = (ColumnFld) field;
|
||||||
|
tabularField
|
||||||
|
.addTabularFldChangeEventHandler(columnField);
|
||||||
|
} else {
|
||||||
|
if (field instanceof ColumnListFld) {
|
||||||
|
ColumnListFld columnListField = (ColumnListFld) field;
|
||||||
|
tabularField
|
||||||
|
.addTabularFldChangeEventHandler(columnListField);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -234,31 +275,7 @@ public class ComputationParametersPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final TextButton submit = new TextButton("Start Computation");
|
submit.setVisible(true);
|
||||||
submit.setToolTip(START_BUTTON_TOOLTIP);
|
|
||||||
submit.setIcon(DataMinerManager.resources.startComputation());
|
|
||||||
submit.getElement().getStyle().setMarginLeft(20, Unit.PX);
|
|
||||||
submit.getElement().getStyle().setMarginBottom(20, Unit.PX);
|
|
||||||
|
|
||||||
submit.addSelectHandler(new SelectHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelect(SelectEvent event) {
|
|
||||||
if (handler != null && parametersPanel.isValid()) {
|
|
||||||
String value = titleField.getValue();
|
|
||||||
String title = (value == null || value
|
|
||||||
.contentEquals("")) ? defaultComputationTitle
|
|
||||||
: value;
|
|
||||||
handler.startComputation(title, title); // TODO insert
|
|
||||||
// description
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//new VerticalLayoutData(-1, -1, new Margins(0, 0, 20,20))
|
|
||||||
v.add(submit);
|
|
||||||
|
|
||||||
forceLayout();
|
forceLayout();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Log.error("Error in show form:" + e.getLocalizedMessage());
|
Log.error("Error in show form:" + e.getLocalizedMessage());
|
||||||
|
|
|
@ -19,6 +19,7 @@ public abstract class AbstractFld {
|
||||||
public abstract String getValue();
|
public abstract String getValue();
|
||||||
public abstract Widget getWidget();
|
public abstract Widget getWidget();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -48,9 +49,6 @@ public abstract class AbstractFld {
|
||||||
// (for string, int, float, double and boolean) the built-in validation is enough
|
// (for string, int, float, double and boolean) the built-in validation is enough
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @param tableItem
|
|
||||||
*/
|
|
||||||
public void fireEvent(Object message) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,23 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectPar
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
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.SimpleContainer;
|
||||||
import com.sencha.gxt.widget.core.client.form.CheckBox;
|
import com.sencha.gxt.widget.core.client.form.CheckBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ceras
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class BooleanFld extends AbstractFld {
|
public class BooleanFld extends AbstractFld {
|
||||||
|
|
||||||
|
private SimpleContainer fieldContainer;
|
||||||
private CheckBox checkBox = new CheckBox();
|
private CheckBox checkBox = new CheckBox();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,14 +31,38 @@ public class BooleanFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
public BooleanFld(Parameter parameter) {
|
public BooleanFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
|
fieldContainer = new SimpleContainer();
|
||||||
|
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
ObjectParameter p = (ObjectParameter) parameter;
|
ObjectParameter p = (ObjectParameter) parameter;
|
||||||
checkBox.setValue(!p.getDefaultValue().toUpperCase().equals("FALSE"));
|
|
||||||
if (p.getDescription()!=null)
|
if (p.getDefaultValue() != null)
|
||||||
checkBox.setTitle(p.getDescription());
|
checkBox.setValue(!p.getDefaultValue().toUpperCase()
|
||||||
|
.equals("FALSE"));
|
||||||
|
else checkBox.setValue(false);
|
||||||
checkBox.setBoxLabel(p.getName());
|
checkBox.setBoxLabel(p.getName());
|
||||||
|
|
||||||
|
HtmlLayoutContainer descr;
|
||||||
|
|
||||||
|
if (p.getDescription() == null) {
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
checkBox.setToolTip(p.getDescription());
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
|
||||||
|
+ p.getDescription() + "</p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
horiz.add(checkBox, new BoxLayoutData(new Margins()));
|
||||||
|
horiz.add(descr, new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
fieldContainer.add(horiz);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
|
@ -38,7 +71,7 @@ public class BooleanFld extends AbstractFld {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidget() {
|
public Widget getWidget() {
|
||||||
return checkBox;
|
return fieldContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,16 +7,25 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent.TabularFldChangeEventHandler;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.properties.ColumnItemPropertiesCombo;
|
import org.gcube.portlets.user.dataminermanager.client.properties.ColumnItemPropertiesCombo;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem;
|
import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||||
|
import com.sencha.gxt.core.client.util.Format;
|
||||||
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.data.shared.ListStore;
|
import com.sencha.gxt.data.shared.ListStore;
|
||||||
|
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.SimpleContainer;
|
||||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
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.form.ComboBox;
|
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,9 +34,10 @@ import com.sencha.gxt.widget.core.client.form.ComboBox;
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ColumnFld extends AbstractFld {
|
public class ColumnFld extends AbstractFld implements
|
||||||
|
TabularFldChangeEventHandler {
|
||||||
|
|
||||||
private VerticalLayoutContainer vp;
|
//private VerticalLayoutContainer vp;
|
||||||
|
|
||||||
private String defaultColumn;
|
private String defaultColumn;
|
||||||
|
|
||||||
|
@ -35,16 +45,27 @@ public class ColumnFld extends AbstractFld {
|
||||||
private ListStore<ColumnItem> store;
|
private ListStore<ColumnItem> store;
|
||||||
private String referredTabularParameterName;
|
private String referredTabularParameterName;
|
||||||
|
|
||||||
|
private SimpleContainer fieldContainer;
|
||||||
|
|
||||||
|
private SimpleContainer vContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parameter
|
* @param parameter
|
||||||
*/
|
*/
|
||||||
public ColumnFld(Parameter parameter) {
|
public ColumnFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
vp = new VerticalLayoutContainer();
|
|
||||||
|
|
||||||
ColumnParameter p = (ColumnParameter) parameter;
|
ColumnParameter p = (ColumnParameter) parameter;
|
||||||
this.referredTabularParameterName = p.getReferredTabularParameterName();
|
|
||||||
this.defaultColumn = p.getDefaultColumn();
|
referredTabularParameterName = p.getReferredTabularParameterName();
|
||||||
|
defaultColumn = p.getDefaultColumn();
|
||||||
|
|
||||||
|
fieldContainer = new SimpleContainer();
|
||||||
|
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
|
|
||||||
ColumnItemPropertiesCombo props = GWT
|
ColumnItemPropertiesCombo props = GWT
|
||||||
.create(ColumnItemPropertiesCombo.class);
|
.create(ColumnItemPropertiesCombo.class);
|
||||||
|
@ -56,18 +77,62 @@ public class ColumnFld extends AbstractFld {
|
||||||
comboBox.setForceSelection(true);
|
comboBox.setForceSelection(true);
|
||||||
comboBox.setEditable(false);
|
comboBox.setEditable(false);
|
||||||
comboBox.setTriggerAction(TriggerAction.ALL);
|
comboBox.setTriggerAction(TriggerAction.ALL);
|
||||||
if (p.getDescription() != null)
|
|
||||||
comboBox.setTitle(p.getDescription());
|
|
||||||
comboBox.setEnabled(false);
|
comboBox.setEnabled(false);
|
||||||
showNoSelectionField();
|
|
||||||
|
HtmlLayoutContainer descr;
|
||||||
|
|
||||||
|
if (p.getDescription() == null) {
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
comboBox.setToolTip(p.getDescription());
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
|
||||||
|
+ p.getDescription() + "</p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vContainer=new SimpleContainer();
|
||||||
|
showNoSelectionField();
|
||||||
|
horiz.add(vContainer, new BoxLayoutData(new Margins()));
|
||||||
|
horiz.add(descr, new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
fieldContainer.add(horiz);
|
||||||
|
fieldContainer.forceLayout();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showNoSelectionField() {
|
||||||
|
vContainer.clear();
|
||||||
|
VerticalLayoutContainer vField = new VerticalLayoutContainer();
|
||||||
|
HtmlLayoutContainer typeDescription= new HtmlLayoutContainer(
|
||||||
|
"<div class='workflow-parameters-description'><p>Select table from parameter "
|
||||||
|
+ Format.ellipse(referredTabularParameterName,30) + "</p></div>");
|
||||||
|
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||||
|
vField.add(comboBox, new VerticalLayoutData(1,-1,new Margins(0)));
|
||||||
|
vField.add(typeDescription, new VerticalLayoutData(-1,-1,new Margins(0)));
|
||||||
|
vContainer.add(vField);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showFieldWithSelection(TableItemSimple tableItem) {
|
||||||
|
vContainer.clear();
|
||||||
|
VerticalLayoutContainer vField = new VerticalLayoutContainer();
|
||||||
|
HtmlLayoutContainer typeDescription= new HtmlLayoutContainer(
|
||||||
|
"<div class='workflow-parameters-description'><p>Columns of Table "
|
||||||
|
+ Format.ellipse(tableItem.getName(),30) + "</p></div>");
|
||||||
|
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||||
|
vField.add(comboBox, new VerticalLayoutData(1,-1,new Margins(0)));
|
||||||
|
vField.add(typeDescription, new VerticalLayoutData(-1,-1,new Margins(0)));
|
||||||
|
vContainer.add(vField);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
|
||||||
private void showNoSelectionField() {
|
private void showNoSelectionField() {
|
||||||
vp.clear();
|
vp.clear();
|
||||||
;
|
|
||||||
vp.add(comboBox);
|
vp.add(comboBox);
|
||||||
vp.add(new HTML(
|
vp.add(new HTML(
|
||||||
"<div class='workflow-parameters-description'>Select table from parameter "
|
"<div class='workflow-parameters-description'>Select table from parameter "
|
||||||
|
@ -75,9 +140,6 @@ public class ColumnFld extends AbstractFld {
|
||||||
vp.forceLayout();
|
vp.forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private void showFieldWithSelection(TableItemSimple tableItem) {
|
private void showFieldWithSelection(TableItemSimple tableItem) {
|
||||||
vp.clear();
|
vp.clear();
|
||||||
vp.add(comboBox);
|
vp.add(comboBox);
|
||||||
|
@ -85,7 +147,7 @@ public class ColumnFld extends AbstractFld {
|
||||||
"<div class='workflow-parameters-description'>Columns of Table "
|
"<div class='workflow-parameters-description'>Columns of Table "
|
||||||
+ tableItem.getName() + "</div>"));
|
+ tableItem.getName() + "</div>"));
|
||||||
vp.forceLayout();
|
vp.forceLayout();
|
||||||
}
|
} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -101,23 +163,22 @@ public class ColumnFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidget() {
|
public Widget getWidget() {
|
||||||
return vp;
|
return fieldContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fireEvent(Object message) {
|
public void onChange(TabularFldChangeEvent event) {
|
||||||
if (message == null) {
|
TableItemSimple tableItemSimple = event.getTableItemSimple();
|
||||||
|
if (tableItemSimple == null) {
|
||||||
store.clear();
|
store.clear();
|
||||||
store.commitChanges();
|
store.commitChanges();
|
||||||
comboBox.clear();
|
comboBox.clear();
|
||||||
comboBox.setEnabled(false);
|
comboBox.setEnabled(false);
|
||||||
showNoSelectionField();
|
showNoSelectionField();
|
||||||
} else {
|
} else {
|
||||||
TableItemSimple tableItem = (TableItemSimple) message;
|
|
||||||
store.clear();
|
store.clear();
|
||||||
store.commitChanges();
|
store.commitChanges();
|
||||||
ArrayList<ColumnItem> columns = tableItem.getColumns();
|
ArrayList<ColumnItem> columns = tableItemSimple.getColumns();
|
||||||
if (columns != null) {
|
if (columns != null) {
|
||||||
store.addAll(columns);
|
store.addAll(columns);
|
||||||
for (ColumnItem columnItem : columns) {
|
for (ColumnItem columnItem : columns) {
|
||||||
|
@ -130,8 +191,9 @@ public class ColumnFld extends AbstractFld {
|
||||||
}
|
}
|
||||||
comboBox.clear();
|
comboBox.clear();
|
||||||
comboBox.setEnabled(true);
|
comboBox.setEnabled(true);
|
||||||
showFieldWithSelection(tableItem);
|
showFieldWithSelection(tableItemSimple);
|
||||||
}
|
}
|
||||||
|
fieldContainer.forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ColumnListParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent.TabularFldChangeEventHandler;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.properties.ColumnItemProperties;
|
import org.gcube.portlets.user.dataminermanager.client.properties.ColumnItemProperties;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem;
|
import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||||
|
@ -30,8 +32,8 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ColumnListFld extends AbstractFld {
|
public class ColumnListFld extends AbstractFld implements
|
||||||
|
TabularFldChangeEventHandler {
|
||||||
|
|
||||||
private VerticalLayoutContainer vp;
|
private VerticalLayoutContainer vp;
|
||||||
private ColumnListParameter columnListParameter;
|
private ColumnListParameter columnListParameter;
|
||||||
|
@ -110,7 +112,6 @@ public class ColumnListFld extends AbstractFld {
|
||||||
vp.forceLayout();
|
vp.forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -136,26 +137,7 @@ public class ColumnListFld extends AbstractFld {
|
||||||
return vp;
|
return vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void fireEvent(Object message) {
|
|
||||||
if (message == null) {
|
|
||||||
store.clear();
|
|
||||||
store.commitChanges();
|
|
||||||
grid.disable();
|
|
||||||
showNoSelectionField();
|
|
||||||
} else {
|
|
||||||
TableItemSimple tableItem = (TableItemSimple) message;
|
|
||||||
store.clear();
|
|
||||||
store.commitChanges();
|
|
||||||
store.addAll(tableItem.getColumns());
|
|
||||||
store.commitChanges();
|
|
||||||
grid.enable();
|
|
||||||
showFieldWithSelection(tableItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -165,4 +147,23 @@ public class ColumnListFld extends AbstractFld {
|
||||||
return store.size() > 0;
|
return store.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChange(TabularFldChangeEvent event) {
|
||||||
|
TableItemSimple tableItemSimple = event.getTableItemSimple();
|
||||||
|
if (tableItemSimple == null) {
|
||||||
|
store.clear();
|
||||||
|
store.commitChanges();
|
||||||
|
grid.disable();
|
||||||
|
showNoSelectionField();
|
||||||
|
} else {
|
||||||
|
store.clear();
|
||||||
|
store.commitChanges();
|
||||||
|
store.addAll(tableItemSimple.getColumns());
|
||||||
|
store.commitChanges();
|
||||||
|
grid.enable();
|
||||||
|
showFieldWithSelection(tableItemSimple);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,14 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectPar
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
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.SimpleContainer;
|
||||||
|
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.form.DoubleField;
|
import com.sencha.gxt.widget.core.client.form.DoubleField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,6 +22,7 @@ import com.sencha.gxt.widget.core.client.form.DoubleField;
|
||||||
*/
|
*/
|
||||||
public class DoubleFld extends AbstractFld {
|
public class DoubleFld extends AbstractFld {
|
||||||
|
|
||||||
|
private SimpleContainer fieldContainer;
|
||||||
private DoubleField numberField;
|
private DoubleField numberField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,6 +30,10 @@ public class DoubleFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
public DoubleFld(Parameter parameter) {
|
public DoubleFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
|
fieldContainer=new SimpleContainer();
|
||||||
|
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
ObjectParameter p = (ObjectParameter) parameter;
|
ObjectParameter p = (ObjectParameter) parameter;
|
||||||
|
|
||||||
|
@ -28,10 +41,37 @@ public class DoubleFld extends AbstractFld {
|
||||||
|
|
||||||
if (p.getDefaultValue() != null)
|
if (p.getDefaultValue() != null)
|
||||||
numberField.setValue(Double.parseDouble(p.getDefaultValue()));
|
numberField.setValue(Double.parseDouble(p.getDefaultValue()));
|
||||||
|
else
|
||||||
|
numberField.setAllowBlank(false);
|
||||||
|
|
||||||
if (p.getDescription() != null)
|
HtmlLayoutContainer descr;
|
||||||
numberField.setTitle(p.getDescription());
|
|
||||||
|
|
||||||
|
if (p.getDescription() == null) {
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
numberField.setToolTip(p.getDescription());
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
|
||||||
|
+ p.getDescription() + "</p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleContainer vContainer=new SimpleContainer();
|
||||||
|
VerticalLayoutContainer vField = new VerticalLayoutContainer();
|
||||||
|
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
|
||||||
|
"Double Value");
|
||||||
|
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||||
|
vField.add(numberField, new VerticalLayoutData(1,-1,new Margins(0)));
|
||||||
|
vField.add(typeDescription, new VerticalLayoutData(-1,-1,new Margins(0)));
|
||||||
|
vContainer.add(vField);
|
||||||
|
|
||||||
|
horiz.add(vContainer, new BoxLayoutData(new Margins()));
|
||||||
|
horiz.add(descr, new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
fieldContainer.add(horiz);
|
||||||
|
|
||||||
|
fieldContainer.forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +87,7 @@ public class DoubleFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidget() {
|
public Widget getWidget() {
|
||||||
return numberField;
|
return fieldContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,17 +8,24 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter
|
||||||
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||||
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.data.shared.StringLabelProvider;
|
import com.sencha.gxt.data.shared.StringLabelProvider;
|
||||||
|
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.SimpleContainer;
|
||||||
|
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.form.SimpleComboBox;
|
import com.sencha.gxt.widget.core.client.form.SimpleComboBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Giancarlo Panichi
|
* @author Giancarlo Panichi email: <a
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EnumFld extends AbstractFld {
|
public class EnumFld extends AbstractFld {
|
||||||
|
|
||||||
|
private SimpleContainer fieldContainer;
|
||||||
private SimpleComboBox<String> listBox;
|
private SimpleComboBox<String> listBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,6 +33,10 @@ public class EnumFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
public EnumFld(Parameter parameter) {
|
public EnumFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
|
fieldContainer = new SimpleContainer();
|
||||||
|
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
EnumParameter p = (EnumParameter) parameter;
|
EnumParameter p = (EnumParameter) parameter;
|
||||||
|
|
||||||
|
@ -35,11 +46,27 @@ public class EnumFld extends AbstractFld {
|
||||||
listBox.setForceSelection(true);
|
listBox.setForceSelection(true);
|
||||||
listBox.setEditable(false);
|
listBox.setEditable(false);
|
||||||
listBox.setTriggerAction(TriggerAction.ALL);
|
listBox.setTriggerAction(TriggerAction.ALL);
|
||||||
if (p.getDescription() != null)
|
|
||||||
listBox.setTitle(p.getDescription());
|
|
||||||
if (p.getDefaultValue() != null)
|
if (p.getDefaultValue() != null)
|
||||||
listBox.setValue(p.getDefaultValue());
|
listBox.setValue(p.getDefaultValue());
|
||||||
|
|
||||||
|
HtmlLayoutContainer descr;
|
||||||
|
|
||||||
|
if (p.getDescription() == null) {
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
listBox.setToolTip(p.getDescription());
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
|
||||||
|
+ p.getDescription() + "</p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
}
|
||||||
|
horiz.add(listBox, new BoxLayoutData(new Margins()));
|
||||||
|
horiz.add(descr, new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
fieldContainer.add(horiz);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,6 +4,14 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectPar
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
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.SimpleContainer;
|
||||||
|
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.form.FloatField;
|
import com.sencha.gxt.widget.core.client.form.FloatField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,6 +22,7 @@ import com.sencha.gxt.widget.core.client.form.FloatField;
|
||||||
*/
|
*/
|
||||||
public class FloatFld extends AbstractFld {
|
public class FloatFld extends AbstractFld {
|
||||||
|
|
||||||
|
private SimpleContainer fieldContainer;
|
||||||
private FloatField numberField;
|
private FloatField numberField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,16 +30,49 @@ public class FloatFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
public FloatFld(Parameter parameter) {
|
public FloatFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
|
fieldContainer=new SimpleContainer();
|
||||||
|
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
ObjectParameter p = (ObjectParameter) parameter;
|
ObjectParameter p = (ObjectParameter) parameter;
|
||||||
|
|
||||||
|
|
||||||
numberField = new FloatField();
|
numberField = new FloatField();
|
||||||
|
|
||||||
if (p.getDefaultValue() != null)
|
if (p.getDefaultValue() != null)
|
||||||
numberField.setValue(Float.parseFloat(p.getDefaultValue()));
|
numberField.setValue(Float.parseFloat(p.getDefaultValue()));
|
||||||
|
else
|
||||||
|
numberField.setAllowBlank(false);
|
||||||
|
|
||||||
if (p.getDescription() != null)
|
|
||||||
numberField.setTitle(p.getDescription());
|
HtmlLayoutContainer descr;
|
||||||
|
|
||||||
|
if (p.getDescription() == null) {
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
numberField.setToolTip(p.getDescription());
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
|
||||||
|
+ p.getDescription() + "</p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleContainer vContainer=new SimpleContainer();
|
||||||
|
VerticalLayoutContainer vField = new VerticalLayoutContainer();
|
||||||
|
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
|
||||||
|
"Float Value");
|
||||||
|
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||||
|
vField.add(numberField, new VerticalLayoutData(1,-1,new Margins(0)));
|
||||||
|
vField.add(typeDescription, new VerticalLayoutData(-1,-1,new Margins(0)));
|
||||||
|
vContainer.add(vField);
|
||||||
|
|
||||||
|
horiz.add(vContainer, new BoxLayoutData(new Margins()));
|
||||||
|
horiz.add(descr, new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
fieldContainer.add(horiz);
|
||||||
|
fieldContainer.forceLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +90,6 @@ public class FloatFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidget() {
|
public Widget getWidget() {
|
||||||
return numberField;
|
return fieldContainer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,28 @@
|
||||||
|
|
||||||
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
|
||||||
|
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
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.SimpleContainer;
|
||||||
|
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.form.IntegerField;
|
import com.sencha.gxt.widget.core.client.form.IntegerField;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Giancarlo Panichi
|
* @author Giancarlo Panichi email: <a
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IntFld extends AbstractFld {
|
public class IntFld extends AbstractFld {
|
||||||
|
|
||||||
|
private SimpleContainer fieldContainer;
|
||||||
private IntegerField numberField;
|
private IntegerField numberField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,19 +30,48 @@ public class IntFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
public IntFld(Parameter parameter) {
|
public IntFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
|
fieldContainer = new SimpleContainer();
|
||||||
|
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
ObjectParameter p = (ObjectParameter) parameter;
|
ObjectParameter p = (ObjectParameter) parameter;
|
||||||
|
|
||||||
|
|
||||||
numberField = new IntegerField();
|
numberField = new IntegerField();
|
||||||
|
|
||||||
if (p.getDefaultValue() != null)
|
if (p.getDefaultValue() != null)
|
||||||
numberField.setValue(Integer.parseInt(p.getDefaultValue()));
|
numberField.setValue(Integer.parseInt(p.getDefaultValue()));
|
||||||
|
else
|
||||||
if (p.getDescription() != null)
|
|
||||||
numberField.setTitle(p.getDescription());
|
|
||||||
numberField.setAllowBlank(false);
|
numberField.setAllowBlank(false);
|
||||||
|
|
||||||
|
HtmlLayoutContainer descr;
|
||||||
|
|
||||||
|
if (p.getDescription() == null) {
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
numberField.setToolTip(p.getDescription());
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
|
||||||
|
+ p.getDescription() + "</p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleContainer vContainer=new SimpleContainer();
|
||||||
|
VerticalLayoutContainer vField = new VerticalLayoutContainer();
|
||||||
|
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
|
||||||
|
"Integer Value");
|
||||||
|
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||||
|
vField.add(numberField, new VerticalLayoutData(1,-1,new Margins(0)));
|
||||||
|
vField.add(typeDescription, new VerticalLayoutData(-1,-1,new Margins(0)));
|
||||||
|
vContainer.add(vField);
|
||||||
|
|
||||||
|
horiz.add(vContainer, new BoxLayoutData(new Margins()));
|
||||||
|
horiz.add(descr, new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
fieldContainer.add(horiz);
|
||||||
|
fieldContainer.forceLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,7 +88,7 @@ public class IntFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidget() {
|
public Widget getWidget() {
|
||||||
return numberField;
|
return fieldContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,37 +11,135 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParam
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
|
|
||||||
|
import com.google.gwt.editor.client.Editor.Path;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
import com.sencha.gxt.core.client.ValueProvider;
|
||||||
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
|
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||||
|
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||||
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
|
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.SimpleContainer;
|
||||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
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.SelectEvent;
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ceras
|
*
|
||||||
|
* @author Giancarlo Panichi
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ListStringFld extends AbstractFld {
|
public class ListStringFld extends AbstractFld {
|
||||||
|
|
||||||
private List<Item> items;
|
private SimpleContainer fieldContainer;
|
||||||
private SimpleContainer simpleContainer;
|
private HBoxLayoutContainer horiz;
|
||||||
|
private SimpleContainer listContainer;
|
||||||
private VerticalLayoutContainer vp;
|
private VerticalLayoutContainer vp;
|
||||||
|
private List<Item> items;
|
||||||
private ListParameter listParameter;
|
private ListParameter listParameter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @param parameter
|
* @param parameter
|
||||||
*/
|
*/
|
||||||
public ListStringFld(Parameter parameter) {
|
public ListStringFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
this.listParameter = (ListParameter) parameter;
|
|
||||||
simpleContainer = new SimpleContainer();
|
listParameter = (ListParameter) parameter;
|
||||||
|
|
||||||
|
listContainer = new SimpleContainer();
|
||||||
vp = new VerticalLayoutContainer();
|
vp = new VerticalLayoutContainer();
|
||||||
simpleContainer.add(vp);
|
|
||||||
items = new ArrayList<Item>();
|
items = new ArrayList<Item>();
|
||||||
addField(null);
|
addField(null);
|
||||||
|
listContainer.add(vp, new MarginData(new Margins()));
|
||||||
|
|
||||||
|
fieldContainer = new SimpleContainer();
|
||||||
|
horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
|
HtmlLayoutContainer descr;
|
||||||
|
|
||||||
|
if (listParameter.getDescription() == null) {
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
listContainer.setToolTip(listParameter.getDescription());
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
|
||||||
|
+ 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ItemStringProperties extends PropertyAccess<ItemString> {
|
||||||
|
|
||||||
|
@Path("id")
|
||||||
|
ModelKeyProvider<ItemString> id();
|
||||||
|
ValueProvider<ItemString, String> label();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ItemString{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
private void gridDef(){
|
||||||
|
ColumnConfig<Stock, String> nameCol = new ColumnConfig<Stock, String>(props.name(), 50, "Company");
|
||||||
|
ColumnConfig<Stock, String> symbolCol = new ColumnConfig<Stock, String>(props.symbol(), 75, "Symbol");
|
||||||
|
ColumnConfig<Stock, Double> lastCol = new ColumnConfig<Stock, Double>(props.last(), 75, "Last");
|
||||||
|
ColumnConfig<Stock, Double> changeCol = new ColumnConfig<Stock, Double>(props.change(), 75, "Change");
|
||||||
|
ColumnConfig<Stock, Date> lastTransCol = new ColumnConfig<Stock, Date>(props.lastTrans(), 100, "Last Updated");
|
||||||
|
|
||||||
|
final NumberFormat number = NumberFormat.getFormat("0.00");
|
||||||
|
changeCol.setCell(new AbstractCell<Double>() {
|
||||||
|
@Override
|
||||||
|
public void render(Context context, Double value, SafeHtmlBuilder sb) {
|
||||||
|
String style = "style='color: " + (value < 0 ? "red" : "green") + "'";
|
||||||
|
String v = number.format(value);
|
||||||
|
sb.appendHtmlConstant("<span " + style + ">" + v + "</span>");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
lastTransCol.setCell(new DateCell(DateTimeFormat.getFormat("MM/dd/yyyy")));
|
||||||
|
|
||||||
|
List<ColumnConfig<Stock, ?>> columns = new ArrayList<ColumnConfig<Stock, ?>>();
|
||||||
|
columns.add(nameCol);
|
||||||
|
columns.add(symbolCol);
|
||||||
|
columns.add(lastCol);
|
||||||
|
columns.add(changeCol);
|
||||||
|
columns.add(lastTransCol);
|
||||||
|
|
||||||
|
ColumnModel<Stock> cm = new ColumnModel<Stock>(columns);
|
||||||
|
|
||||||
|
ListStore<Stock> store = new ListStore<Stock>(props.key());
|
||||||
|
store.addAll(TestData.getStocks());
|
||||||
|
|
||||||
|
final Grid<Stock> grid = new Grid<Stock>(store, cm);
|
||||||
|
grid.setAllowTextSelection(true);
|
||||||
|
grid.getView().setAutoExpandColumn(nameCol);
|
||||||
|
grid.getView().setStripeRows(true);
|
||||||
|
grid.getView().setColumnLines(true);
|
||||||
|
grid.setBorders(false);
|
||||||
|
grid.setColumnReordering(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
private void addField(Item upperItem) {
|
private void addField(Item upperItem) {
|
||||||
|
|
||||||
ObjectParameter objPar = new ObjectParameter(listParameter.getName(),
|
ObjectParameter objPar = new ObjectParameter(listParameter.getName(),
|
||||||
|
@ -50,7 +148,7 @@ public class ListStringFld extends AbstractFld {
|
||||||
if (upperItem == null) {
|
if (upperItem == null) {
|
||||||
Item item = new Item(objPar, true);
|
Item item = new Item(objPar, true);
|
||||||
items.add(item);
|
items.add(item);
|
||||||
vp.add(item);
|
vp.add(item, new VerticalLayoutData(1,-1, new Margins()));
|
||||||
} else {
|
} else {
|
||||||
// search the position of the upper item
|
// search the position of the upper item
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
@ -66,7 +164,6 @@ public class ListStringFld extends AbstractFld {
|
||||||
vp.insert(item, pos + 1);
|
vp.insert(item, pos + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
simpleContainer.forceLayout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,7 +178,7 @@ public class ListStringFld extends AbstractFld {
|
||||||
items.get(0).hideCancelButton();
|
items.get(0).hideCancelButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
simpleContainer.forceLayout();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +205,7 @@ public class ListStringFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidget() {
|
public Widget getWidget() {
|
||||||
return simpleContainer;
|
return fieldContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,74 +215,88 @@ public class ListStringFld extends AbstractFld {
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
boolean valid = false;
|
boolean valid = false;
|
||||||
for (Item item : items)
|
for (Item item : items)
|
||||||
if (item.getField().getValue() != null) {
|
if (item.isValid()) {
|
||||||
valid = true;
|
valid = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Item extends HorizontalLayoutContainer {
|
private class Item extends HBoxLayoutContainer {
|
||||||
|
|
||||||
private StringFld field;
|
private TextField field;
|
||||||
private TextButton addButton;
|
private TextButton addBtn;
|
||||||
private TextButton removeButton;
|
private TextButton removeBtn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param objPar
|
* @param objPar
|
||||||
*/
|
*/
|
||||||
public Item(ObjectParameter objectParameter, boolean first) {
|
public Item(ObjectParameter objectParameter, boolean first) {
|
||||||
super();
|
super();
|
||||||
this.field = new StringFld(objectParameter);
|
|
||||||
this.add(field.getWidget());
|
|
||||||
|
|
||||||
addButton = new TextButton("");
|
field = new TextField();
|
||||||
|
field.setAllowBlank(false);
|
||||||
|
|
||||||
addButton.setIcon(DataMinerManager.resources.add());
|
addBtn = new TextButton("");
|
||||||
|
|
||||||
addButton.addSelectHandler(new SelectEvent.SelectHandler() {
|
addBtn.setIcon(DataMinerManager.resources.add());
|
||||||
|
|
||||||
|
addBtn.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
addField(Item.this);
|
addField(Item.this);
|
||||||
|
forceLayout();
|
||||||
|
vp.forceLayout();
|
||||||
|
fieldContainer.forceLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
removeButton = new TextButton("");
|
removeBtn = new TextButton("");
|
||||||
|
|
||||||
removeButton.setIcon(DataMinerManager.resources.cancel());
|
removeBtn.setIcon(DataMinerManager.resources.cancel());
|
||||||
|
|
||||||
removeButton.addSelectHandler(new SelectEvent.SelectHandler() {
|
removeBtn.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
removeField(Item.this);
|
removeField(Item.this);
|
||||||
|
forceLayout();
|
||||||
|
vp.forceLayout();
|
||||||
|
fieldContainer.forceLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
removeButton.setVisible(!first);
|
removeBtn.setVisible(!first);
|
||||||
|
|
||||||
this.add(addButton);
|
setPack(BoxLayoutPack.START);
|
||||||
this.add(removeButton);
|
setEnableOverflow(false);
|
||||||
|
add(field, new BoxLayoutData(new Margins()));
|
||||||
|
add(addBtn,new BoxLayoutData(new Margins()));
|
||||||
|
add(removeBtn,new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showCancelButton() {
|
public void showCancelButton() {
|
||||||
removeButton.setVisible(true);
|
removeBtn.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideCancelButton() {
|
public void hideCancelButton() {
|
||||||
removeButton.setVisible(false);
|
removeBtn.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return field.getValue();
|
return field.getCurrentValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringFld getField() {
|
public boolean isValid(){
|
||||||
return field;
|
return field.isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,13 +8,11 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter
|
||||||
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.core.client.util.Padding;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
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.BoxLayoutContainer.BoxLayoutPack;
|
||||||
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
||||||
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData;
|
|
||||||
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
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.SimpleContainer;
|
||||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
|
|
||||||
|
@ -26,8 +24,7 @@ import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
*/
|
*/
|
||||||
public class StringFld extends AbstractFld {
|
public class StringFld extends AbstractFld {
|
||||||
|
|
||||||
private SimpleContainer simpleContainer;
|
private SimpleContainer fieldContainer;
|
||||||
private HorizontalLayoutContainer horiz;
|
|
||||||
private TextField textField;
|
private TextField textField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,10 +32,6 @@ public class StringFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
public StringFld(Parameter parameter) {
|
public StringFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
simpleContainer=new SimpleContainer();
|
|
||||||
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
|
||||||
horiz.setPack(BoxLayoutPack.START);
|
|
||||||
horiz.setEnableOverflow(false);
|
|
||||||
|
|
||||||
ObjectParameter p = (ObjectParameter) parameter;
|
ObjectParameter p = (ObjectParameter) parameter;
|
||||||
|
|
||||||
|
@ -60,12 +53,16 @@ public class StringFld extends AbstractFld {
|
||||||
descr.addStyleName("workflow-fieldDescription");
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fieldContainer=new SimpleContainer();
|
||||||
|
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
horiz.add(textField,new BoxLayoutData(new Margins()));
|
horiz.add(textField,new BoxLayoutData(new Margins()));
|
||||||
horiz.add(descr,new BoxLayoutData(new Margins()));
|
horiz.add(descr,new BoxLayoutData(new Margins()));
|
||||||
|
fieldContainer.add(horiz,new MarginData(new Margins()));
|
||||||
|
|
||||||
/*horiz.add(textField, new HorizontalLayoutData(-1,-1,new Margins()));
|
fieldContainer.forceLayout();
|
||||||
horiz.add(descr,new HorizontalLayoutData(1,-1,new Margins()));*/
|
|
||||||
simpleContainer.add(horiz);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,7 +78,7 @@ public class StringFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidget() {
|
public Widget getWidget() {
|
||||||
return simpleContainer;
|
return fieldContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,9 @@ import java.util.List;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter;
|
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent.HasTabularFldChangeEventHandler;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.TabularFldChangeEvent.TabularFldChangeEventHandler;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
||||||
|
@ -20,17 +23,23 @@ import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
import com.sencha.gxt.core.client.dom.XDOM;
|
import com.sencha.gxt.core.client.dom.XDOM;
|
||||||
import com.sencha.gxt.core.client.util.Format;
|
import com.sencha.gxt.core.client.util.Format;
|
||||||
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||||
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
|
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.MarginData;
|
||||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
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;
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -38,17 +47,17 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TabularFld extends AbstractFld {
|
public class TabularFld extends AbstractFld implements HasTabularFldChangeEventHandler {
|
||||||
|
|
||||||
private SimpleContainer sc;
|
private SimpleContainer fieldContainer;
|
||||||
|
private HBoxLayoutContainer horiz;
|
||||||
private VerticalLayoutContainer vp;
|
private VerticalLayoutContainer vp;
|
||||||
|
|
||||||
// TableSelector tableSelector;
|
|
||||||
private WorkspaceExplorerSelectDialog wselectDialog;
|
private WorkspaceExplorerSelectDialog wselectDialog;
|
||||||
private TextButton selectButton, selectButton2, cancelButton;
|
private TextButton selectButton, selectButton2, cancelButton;
|
||||||
private HTML templatesList;
|
private HtmlLayoutContainer templatesList;
|
||||||
private TableItemSimple selectedTableItem = null;
|
private TableItemSimple selectedTableItem = null;
|
||||||
private List<AbstractFld> listeners = new ArrayList<AbstractFld>();
|
//private List<AbstractFld> listeners = new ArrayList<AbstractFld>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parameter
|
* @param parameter
|
||||||
|
@ -56,11 +65,36 @@ public class TabularFld extends AbstractFld {
|
||||||
public TabularFld(Parameter parameter) {
|
public TabularFld(Parameter parameter) {
|
||||||
super(parameter);
|
super(parameter);
|
||||||
Log.debug("TabularField");
|
Log.debug("TabularField");
|
||||||
|
|
||||||
|
SimpleContainer tabContainer=new SimpleContainer();
|
||||||
vp=new VerticalLayoutContainer();
|
vp=new VerticalLayoutContainer();
|
||||||
init();
|
init();
|
||||||
sc=new SimpleContainer();
|
tabContainer.add(vp, new MarginData(new Margins(0)));
|
||||||
sc.add(vp, new MarginData(0));
|
|
||||||
|
fieldContainer = new SimpleContainer();
|
||||||
|
horiz = new HBoxLayoutContainer();
|
||||||
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
horiz.setEnableOverflow(false);
|
||||||
|
|
||||||
|
HtmlLayoutContainer descr;
|
||||||
|
|
||||||
|
if (parameter.getDescription() == null) {
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
tabContainer.setToolTip(parameter.getDescription());
|
||||||
|
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
|
||||||
|
+ parameter.getDescription() + "</p>");
|
||||||
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
|
}
|
||||||
|
|
||||||
|
horiz.add(tabContainer, new BoxLayoutData(new Margins()));
|
||||||
|
horiz.add(descr, new BoxLayoutData(new Margins()));
|
||||||
|
|
||||||
|
fieldContainer.add(horiz);
|
||||||
showNoSelectionField();
|
showNoSelectionField();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,17 +102,6 @@ public class TabularFld extends AbstractFld {
|
||||||
TabularParameter p = (TabularParameter) parameter;
|
TabularParameter p = (TabularParameter) parameter;
|
||||||
List<String> templates = p.getTemplates();
|
List<String> templates = p.getTemplates();
|
||||||
|
|
||||||
/*
|
|
||||||
* tableSelector = new TableSelector(templates) {
|
|
||||||
*
|
|
||||||
* @Override public void fireSelection(TableItemSimple tableItem) {
|
|
||||||
* super.fireSelection(tableItem); selectedTableItem = tableItem;
|
|
||||||
* showFieldWithSelection();
|
|
||||||
*
|
|
||||||
* loadTableMetadata(tableItem); // send change message to all listeners
|
|
||||||
* // it will be managed by all columnFields and columnListField that
|
|
||||||
* depends by tabular field } };
|
|
||||||
*/
|
|
||||||
List<ItemType> selectableTypes = new ArrayList<ItemType>();
|
List<ItemType> selectableTypes = new ArrayList<ItemType>();
|
||||||
selectableTypes.add(ItemType.EXTERNAL_FILE);
|
selectableTypes.add(ItemType.EXTERNAL_FILE);
|
||||||
List<ItemType> showableTypes = new ArrayList<ItemType>();
|
List<ItemType> showableTypes = new ArrayList<ItemType>();
|
||||||
|
@ -183,11 +206,11 @@ public class TabularFld extends AbstractFld {
|
||||||
String list = "";
|
String list = "";
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (String template : templates) {
|
for (String template : templates) {
|
||||||
list += (first ? "" : ", ") + template;
|
list += (first ? "" : ", ") + Format.ellipse(template,50);
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
templatesList = new HTML("Suitable Data Set Templates: <br>" + list);
|
templatesList = new HtmlLayoutContainer("<p>Suitable Data Set Templates: <br>" + list+"</p>");
|
||||||
templatesList.addStyleName("workflow-templatesList");
|
templatesList.addStyleName("workflow-parameters-description");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -200,7 +223,6 @@ public class TabularFld extends AbstractFld {
|
||||||
Log.error("Error in retrieveTableInformation " + caught.getMessage());
|
Log.error("Error in retrieveTableInformation " + caught.getMessage());
|
||||||
if (caught instanceof ExpiredSessionServiceException) {
|
if (caught instanceof ExpiredSessionServiceException) {
|
||||||
UtilsGXT3.alert("Error", "Expired Session");
|
UtilsGXT3.alert("Error", "Expired Session");
|
||||||
//sessionExpiredShowDelayed();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
UtilsGXT3.alert(
|
UtilsGXT3.alert(
|
||||||
|
@ -216,53 +238,13 @@ public class TabularFld extends AbstractFld {
|
||||||
Log.debug("Retrieved: "+result);
|
Log.debug("Retrieved: "+result);
|
||||||
selectedTableItem=result;
|
selectedTableItem=result;
|
||||||
showFieldWithSelection();
|
showFieldWithSelection();
|
||||||
//loadTableMetadata(selectedTableItem);
|
|
||||||
updateListeners(selectedTableItem);
|
updateListeners(selectedTableItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param tableItem
|
|
||||||
|
|
||||||
protected void loadTableMetadata(final TableItemSimple tableItem) {
|
|
||||||
//TabularData tabularData = DataMinerManager.getTabularData();
|
|
||||||
String tableId = tableItem.getId();
|
|
||||||
|
|
||||||
tabularData.getTableDefinition(tableId,
|
|
||||||
new AsyncCallback<TableDefinition>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
vp.unmask();
|
|
||||||
Info.display("ERROR", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(TableDefinition tableDefinition) {
|
|
||||||
vp.unmask();
|
|
||||||
List<ColumnDefinition> columns = tableDefinition
|
|
||||||
.getColumnsAsList();
|
|
||||||
Collections.sort(columns, new ColumnPositionComparator(
|
|
||||||
false));
|
|
||||||
for (ColumnDefinition column : columns)
|
|
||||||
tableItem.addColumnName(column.getLabel());
|
|
||||||
updateListeners(tableItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
vp.mask("Load Data Set Metadata...", Constants.maskLoadingStyle);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
protected void updateListeners(TableItemSimple tableItem) {
|
|
||||||
for (AbstractFld abstractField : listeners) {
|
|
||||||
abstractField.fireEvent(tableItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -271,22 +253,25 @@ public class TabularFld extends AbstractFld {
|
||||||
vp.clear();
|
vp.clear();
|
||||||
vp.add(selectButton);
|
vp.add(selectButton);
|
||||||
vp.add(templatesList);
|
vp.add(templatesList);
|
||||||
sc.forceLayout();
|
fieldContainer.forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private void showFieldWithSelection() {
|
private void showFieldWithSelection() {
|
||||||
//final String tableId = selectedTableItem.getId();
|
String tableName = selectedTableItem.getName();
|
||||||
final String tableName = selectedTableItem.getName();
|
|
||||||
|
|
||||||
vp.clear();
|
if(tableName==null|| tableName.isEmpty()){
|
||||||
HorizontalLayoutContainer hp = new HorizontalLayoutContainer();
|
tableName="NoName";
|
||||||
hp.add(new HTML("<div class='workflow-parameters-tableDescription'>"
|
}
|
||||||
+ Format.ellipse(tableName, 30) + "</div>"));
|
|
||||||
hp.add(selectButton2);
|
TextField tableDescription=new TextField();
|
||||||
hp.add(cancelButton);
|
tableDescription.setValue(tableName);
|
||||||
|
tableDescription.setReadOnly(true);
|
||||||
|
|
||||||
|
/*HTML tableDescription=new HTML("<div class='workflow-parameters-tableDescription'>"
|
||||||
|
+ Format.ellipse(tableName, 30) + "</div>");*/
|
||||||
|
|
||||||
TextButton openTableButton = new TextButton("Open Data Set");
|
TextButton openTableButton = new TextButton("Open Data Set");
|
||||||
openTableButton.addSelectHandler(new SelectEvent.SelectHandler() {
|
openTableButton.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||||
|
@ -319,10 +304,16 @@ public class TabularFld extends AbstractFld {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
hp.add(openTableButton);
|
|
||||||
vp.add(hp);
|
HBoxLayoutContainer h=new HBoxLayoutContainer();
|
||||||
|
h.add(tableDescription,new BoxLayoutData(new Margins()));
|
||||||
|
h.add(selectButton2,new BoxLayoutData(new Margins()));
|
||||||
|
h.add(cancelButton,new BoxLayoutData(new Margins()));
|
||||||
|
vp.clear();
|
||||||
|
vp.add(h);
|
||||||
vp.add(templatesList);
|
vp.add(templatesList);
|
||||||
sc.forceLayout();
|
vp.forceLayout();
|
||||||
|
fieldContainer.forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -338,7 +329,7 @@ public class TabularFld extends AbstractFld {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidget() {
|
public Widget getWidget() {
|
||||||
return sc;
|
return fieldContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -349,7 +340,25 @@ public class TabularFld extends AbstractFld {
|
||||||
return (selectedTableItem != null);
|
return (selectedTableItem != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addChangeListener(AbstractFld abstractField) {
|
|
||||||
this.listeners.add(abstractField);
|
|
||||||
|
@Override
|
||||||
|
public HandlerRegistration addTabularFldChangeEventHandler(
|
||||||
|
TabularFldChangeEventHandler handler) {
|
||||||
|
return fieldContainer.addHandler(handler, TabularFldChangeEvent.getType());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void updateListeners(TableItemSimple tableItemSimple) {
|
||||||
|
TabularFldChangeEvent event=new TabularFldChangeEvent(tableItemSimple);
|
||||||
|
fireEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fireEvent(GwtEvent<?> event) {
|
||||||
|
fieldContainer.fireEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,9 +296,9 @@
|
||||||
|
|
||||||
.workflow-parameters-preload {
|
.workflow-parameters-preload {
|
||||||
display: block;
|
display: block;
|
||||||
margin: auto;
|
background: url('ajax-loader-big.gif') no-repeat;
|
||||||
margin-left: auto;
|
width: 400px;
|
||||||
margin-right: auto;
|
height: 180px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TOOLTIP */
|
/* TOOLTIP */
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue