2521: Explore the possibility to port the StatMan interface onto Dataminer

https://support.d4science.org/issues/2521

Fixed Layout for FileFld

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@127017 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-04-12 16:01:14 +00:00
parent b7094db85a
commit 201fcbc59c
25 changed files with 252423 additions and 100093 deletions

View File

@ -80,9 +80,9 @@ public class ComputationExecutionPanel extends FramedPanel {
final ComputationStatusPanel statusPanel = new ComputationStatusPanel(
operator);
computationStatusPanels.add(statusPanel);
Log.debug("Added status bar ");
Log.debug("Added status bar");
v.insert(statusPanel, 0, new VerticalLayoutData(1, -1,
new Margins(0)));
new Margins(20)));
removeAllButton.setEnabled(true);
DataMinerManager.getService().startComputation(operator,
@ -135,22 +135,22 @@ public class ComputationExecutionPanel extends FramedPanel {
computationItem.getOperator());
computationStatusPanels.add(statusPanel);
v.insert(statusPanel, 0, new VerticalLayoutData(1, -1,
new Margins(0)));
new Margins(20)));
removeAllButton.setEnabled(true);
DataMinerManager.getService().resubmit(
computationItem.getComputationId(),
new AsyncCallback<ComputationId>() {
@Override
public void onSuccess(ComputationId id) {
if (id == null)
public void onSuccess(ComputationId computationId) {
if (computationId == null)
UtilsGXT3
.alert("ERROR",
"Failed to resubmit computation "
+ computationItem.getName()
+ ", the computation id is null (1)");
else {
statusPanel.computationStarted(id);
statusPanel.computationStarted(computationId);
EventBusProvider.INSTANCE
.fireEvent(new JobsGridGotDirtyEvent());
}

View File

@ -86,7 +86,9 @@ public class ComputationParametersPanel extends SimpleContainer {
}
private void init() {
addStyleName("workflow");
setStylePrimaryName("workflow");
setResize(true);
}
private void create() {
@ -107,7 +109,7 @@ public class ComputationParametersPanel extends SimpleContainer {
String descr = operator.getDescription();
descr = (descr == null || descr.contentEquals("")) ? "no-description"
: operator.getDescription();
HtmlLayoutContainer description = new HtmlLayoutContainer("<span>"
HtmlLayoutContainer description = new HtmlLayoutContainer("<span style='padding-right:10px;'>"
+ descr + "</span>");
description.addStyleName("workflow-description");
v.add(description, new VerticalLayoutData(-1, -1, new Margins(0, 5, 0,
@ -133,22 +135,22 @@ public class ComputationParametersPanel extends SimpleContainer {
};
//parametersPanel = new FramedPanel();
parametersPanel.setDeferHeight(false);
parametersPanel.setBorders(false);
// parametersPanel.getElement().getStyle().setMargin(20, px);
parametersPanel.getElement().getStyle().setPaddingBottom(20, Unit.PX);
parametersFieldSet = new FieldSet();
parametersFieldSet.setHeadingText("Parameters");
vParameters = new VerticalLayoutContainer();
Image imgLoading = new Image(PRELOAD_IMAGE);
vParameters.add(imgLoading, new VerticalLayoutData(1, -1, new Margins(5)));
vParameters.add(imgLoading, new VerticalLayoutData(1, -1, new Margins(0)));
parametersFieldSet.add(vParameters, new MarginData(0));
parametersFieldSet.add(vParameters, new MarginData(new Margins(0)));
parametersFieldSet.setCollapsible(false);
parametersPanel.add(parametersFieldSet, new MarginData(new Margins(5)));
v.add(parametersPanel, new VerticalLayoutData(1, -1, new Margins()));
parametersPanel.add(parametersFieldSet);
v.add(parametersPanel, new VerticalLayoutData(1, -1, new Margins(5)));
submit = new TextButton("Start Computation");
submit.setToolTip(START_BUTTON_TOOLTIP);
@ -177,8 +179,9 @@ public class ComputationParametersPanel extends SimpleContainer {
//, new VerticalLayoutData(-1, -1, new Margins(0, 0, 20, 20)));
submit.setVisible(false);
forceLayout();
loadOperatorParameters();
}
@ -274,7 +277,7 @@ public class ComputationParametersPanel extends SimpleContainer {
}
}
}
parametersPanel.getElement().getStyle().setPaddingBottom(0, Unit.PX);
submit.setVisible(true);
forceLayout();
} catch (Throwable e) {

View File

@ -18,33 +18,63 @@ import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.ClientBundle.Source;
import com.google.gwt.resources.client.ImageResource.ImageOptions;
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.sencha.gxt.cell.core.client.ProgressBarCell;
import com.sencha.gxt.cell.core.client.ProgressBarCell.ProgressBarAppearanceOptions;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.theme.base.client.progress.ProgressBarDefaultAppearance;
import com.sencha.gxt.theme.base.client.progress.ProgressBarDefaultAppearance.ProgressBarResources;
import com.sencha.gxt.theme.base.client.progress.ProgressBarDefaultAppearance.ProgressBarStyle;
import com.sencha.gxt.theme.base.client.progress.ProgressBarDefaultAppearance.ProgressBarTemplate;
import com.sencha.gxt.theme.blue.client.progress.BlueProgressBarAppearance.BlueProgressBarResources;
import com.sencha.gxt.widget.core.client.ProgressBar;
import com.sencha.gxt.widget.core.client.button.TextButton;
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.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.info.Info;
/**
* @author ceras
*
* @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ComputationStatusPanel extends SimpleContainer {
/*
private class ProgressBarColoredAppearance extends ProgressBarDefaultAppearance {
public ProgressBarColoredAppearance(ProgressBarResources resources,
ProgressBarTemplate template) {
super(resources, template);
// TODO Auto-generated constructor stub
}
}*/
private ProgressBar progressBar = new ProgressBar();
private ProgressBar progressBar;
private ComputationId computationId;
private Operator operator;
private boolean terminated=false;
private ComputationTimer timer = new ComputationTimer();
private TextButton cancelComputationButton;
private TextButton cancelComputationBtn;
private VerticalLayoutContainer vert;
/**
@ -52,53 +82,85 @@ public class ComputationStatusPanel extends SimpleContainer {
*/
public ComputationStatusPanel(Operator operator) {
super();
this.operator=operator;
this.operator=operator;
init();
create();
}
private void init(){
setStylePrimaryName("computationStatusPanel");
}
private void create(){
vert=new VerticalLayoutContainer();
HTML title = new HTML("<div class='computationTitle'>Computation of <b>" + operator.getName() + "</b></div>");
HTML date = new HTML("<div class='computationDate'>" + new Date().toString() + "</div>");
vert.add(title);
vert.add(date);
HtmlLayoutContainer title = new HtmlLayoutContainer("<div class='computationStatusTitle'><p>Computation of <b>" + operator.getName() + "</b></p></div>");
HtmlLayoutContainer date = new HtmlLayoutContainer("<div class='computationStatusDate'><p>" + new Date().toString() + "</p></div>");
vert.add(title, new VerticalLayoutData(-1, -1, new Margins(0)));
vert.add(date,new VerticalLayoutData(-1, -1, new Margins(0)));
add(vert);
forceLayout();
}
/* (non-Javadoc)
* @see com.extjs.gxt.ui.client.widget.Container#onAttach()
*/
@Override
protected void onAttach() {
super.onAttach();
progressBar.redraw();
/*
private void custom(){
ProgressBarCell cell=new ProgressBarCell(new GreenProgressBarAppearance());
}
public class GreenProgressBarAppearance extends ProgressBarDefaultAppearance {
public interface GreenProgressBarResources extends ProgressBarResources, ClientBundle {
@Source({"com/sencha/gxt/theme/base/client/progress/ProgressBar.css", "ProgressBar.css"})
@Override
ProgressBarStyle style();
@Source("progress-bg.gif")
@Override
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
ImageResource bar();
@Source("bg.gif")
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
ImageResource innerBar();
}
public GreenProgressBarAppearance() {
super(GWT.<ProgressBarResources> create(GreenProgressBarResources.class),
GWT.<ProgressBarTemplate> create(ProgressBarTemplate.class));
}
}
*/
/**
* @param computationId the computationId to set
*/
public void computationStarted(ComputationId computationId) {
this.computationId = computationId;
vert.add(new HTML("Created, the id is "+computationId.getId()+" [<a href='"+computationId.getUrlId()+"' >link</a>]"));
progressBar.getElement().getStyle().setMargin(20, Unit.PX);
vert.add(new HtmlLayoutContainer("<p>Created, the id is "+computationId.getId()+" [<a href='"+computationId.getUrlId()+"' >link</a>]</p>"));
//progressBar.getElement().getStyle().setMargin(20, Unit.PX);
progressBar = new ProgressBar();
progressBar.updateProgress(0, "Starting...");
vert.add(progressBar);
vert.add(progressBar,new VerticalLayoutData(1, -1, new Margins(20)));
cancelComputationBtn = new TextButton("Cancel");
cancelComputationButton = new TextButton("Cancel");
cancelComputationButton.addSelectHandler(new SelectHandler() {
cancelComputationBtn.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
cancelComputationButton.disable();
cancelComputationBtn.disable();
cancelComputation();
}
});
vert.add(cancelComputationButton);
cancelComputationBtn.getElement().getStyle().setMarginBottom(36, Unit.PX);
vert.add(cancelComputationBtn,new VerticalLayoutData(-1, -1, new Margins(0)));
forceLayout();
timer.scheduleRepeating(Constants.TIME_UPDATE_COMPUTATION_STATUS_PANEL);
}
@ -139,7 +201,7 @@ public class ComputationStatusPanel extends SimpleContainer {
Log.debug("Computation Status:"+computationStatus);
if (terminated == false) {
terminated = true;
cancelComputationButton.setVisible(false);
cancelComputationBtn.setVisible(false);
if (computationStatus.isComplete()) {
Log.debug("Computation is Complete");
Info.display("Terminated", "The computation "+computationId.getId()+" of "+operator.getName()+" is terminated correctly.");
@ -163,8 +225,8 @@ public class ComputationStatusPanel extends SimpleContainer {
UtilsGXT3.alert("Failed", "The computation "+computationId.getId()+" of "+operator.getName()+" has failed.</br>"
+"Message: "+errorMessage, null);
progressBar.updateProgress(1, "Computation Fail");
progressBar.getElement().getStyle().setMarginBottom(36, Unit.PX);
progressBar.addStyleName("progressBar-failed");
//
}
@ -177,9 +239,11 @@ public class ComputationStatusPanel extends SimpleContainer {
*
*/
private void showOutput() {
vert.add(new HTML(" The computation "+operator.getName()+" finished."));
HtmlLayoutContainer computationEndMessage=new HtmlLayoutContainer("<p>The computation "+operator.getName()+" finished.</p>");
vert.add(computationEndMessage, new VerticalLayoutData(-1, -1, new Margins(0)));
ComputationOutputPanel computationOutputPanel = new ComputationOutputPanel(computationId);
vert.add(computationOutputPanel);
computationOutputPanel.getElement().getStyle().setMarginBottom(36, Unit.PX);
vert.add(computationOutputPanel, new VerticalLayoutData(-1, -1, new Margins(0)));
}
@ -212,6 +276,7 @@ public class ComputationStatusPanel extends SimpleContainer {
@Override
public void onFailure(Throwable caught) {
progressBar.updateProgress(1, "Failed to get the status");
progressBar.getElement().getStyle().setMarginBottom(36, Unit.PX);
progressBar.addStyleName("progressBar-failed");
// MessageBox.alert("Error", ""+caught.getLocalizedMessage()+"\nCause: "+caught.getCause()+"\nStackTrace: "+caught.getStackTrace().toString(), null);
// computationTerminated(computationId, operator, TerminationMode.FAILED2);

View File

@ -42,11 +42,10 @@ public abstract class AbstractFld {
}
/**
*
* @return
*/
public boolean isValid() {
// is valid by dafault
// (for string, int, float, double and boolean) the built-in validation is enough
return true;
}

View File

@ -41,9 +41,10 @@ public class BooleanFld extends AbstractFld {
if (p.getDefaultValue() != null)
checkBox.setValue(!p.getDefaultValue().toUpperCase()
.equals("FALSE"));
else checkBox.setValue(false);
else
checkBox.setValue(false);
checkBox.setBoxLabel(p.getName());
HtmlLayoutContainer descr;
if (p.getDescription() == null) {

View File

@ -37,16 +37,12 @@ import com.sencha.gxt.widget.core.client.form.ComboBox;
public class ColumnFld extends AbstractFld implements
TabularFldChangeEventHandler {
//private VerticalLayoutContainer vp;
private String defaultColumn;
private ComboBox<ColumnItem> comboBox;
private ListStore<ColumnItem> store;
private String referredTabularParameterName;
private SimpleContainer fieldContainer;
private SimpleContainer vContainer;
/**
@ -54,19 +50,18 @@ public class ColumnFld extends AbstractFld implements
*/
public ColumnFld(Parameter parameter) {
super(parameter);
ColumnParameter p = (ColumnParameter) parameter;
referredTabularParameterName = p.getReferredTabularParameterName();
defaultColumn = p.getDefaultColumn();
ColumnParameter columnParameter = (ColumnParameter) parameter;
referredTabularParameterName = columnParameter
.getReferredTabularParameterName();
defaultColumn = columnParameter.getDefaultColumn();
fieldContainer = new SimpleContainer();
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
horiz.setPack(BoxLayoutPack.START);
horiz.setEnableOverflow(false);
ColumnItemPropertiesCombo props = GWT
.create(ColumnItemPropertiesCombo.class);
@ -81,73 +76,54 @@ public class ColumnFld extends AbstractFld implements
HtmlLayoutContainer descr;
if (p.getDescription() == null) {
if (columnParameter.getDescription() == null) {
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
descr.addStyleName("workflow-fieldDescription");
} else {
comboBox.setToolTip(p.getDescription());
comboBox.setToolTip(columnParameter.getDescription());
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
+ p.getDescription() + "</p>");
+ columnParameter.getDescription() + "</p>");
descr.addStyleName("workflow-fieldDescription");
}
vContainer=new SimpleContainer();
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(
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
"<div class='workflow-parameters-description'><p>Select table from parameter "
+ Format.ellipse(referredTabularParameterName,30) + "</p></div>");
+ 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)));
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(
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
"<div class='workflow-parameters-description'><p>Columns of Table "
+ Format.ellipse(tableItem.getName(),30) + "</p></div>");
+ 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)));
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() {
vp.clear();
vp.add(comboBox);
vp.add(new HTML(
"<div class='workflow-parameters-description'>Select table from parameter "
+ referredTabularParameterName + "</div>"));
vp.forceLayout();
}
private void showFieldWithSelection(TableItemSimple tableItem) {
vp.clear();
vp.add(comboBox);
vp.add(new HTML(
"<div class='workflow-parameters-description'>Columns of Table "
+ tableItem.getName() + "</div>"));
vp.forceLayout();
} */
/**
*
@ -166,6 +142,11 @@ public class ColumnFld extends AbstractFld implements
return fieldContainer;
}
@Override
public boolean isValid() {
return comboBox.isValid();
}
@Override
public void onChange(TabularFldChangeEvent event) {
TableItemSimple tableItemSimple = event.getTableItemSimple();

View File

@ -15,12 +15,19 @@ import org.gcube.portlets.user.dataminermanager.shared.data.ColumnItem;
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
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.sencha.gxt.core.client.IdentityValueProvider;
import com.sencha.gxt.core.client.Style.SelectionMode;
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.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.grid.CheckBoxSelectionModel;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
@ -35,11 +42,13 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
public class ColumnListFld extends AbstractFld implements
TabularFldChangeEventHandler {
private VerticalLayoutContainer vp;
// private VerticalLayoutContainer vp;
private ColumnListParameter columnListParameter;
private ListStore<ColumnItem> store;
private Grid<ColumnItem> grid;
private CheckBoxSelectionModel<ColumnItem> sm;
private SimpleContainer fieldContainer;
private SimpleContainer vContainer;
/**
*
@ -48,13 +57,40 @@ public class ColumnListFld extends AbstractFld implements
public ColumnListFld(Parameter parameter) {
super(parameter);
this.columnListParameter = (ColumnListParameter) parameter;
vp = new VerticalLayoutContainer();
init();
columnListParameter = (ColumnListParameter) parameter;
// vp = new VerticalLayoutContainer();
fieldContainer = new SimpleContainer();
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
horiz.setPack(BoxLayoutPack.START);
horiz.setEnableOverflow(false);
createGrid();
HtmlLayoutContainer descr;
if (columnListParameter.getDescription() == null) {
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
descr.addStyleName("workflow-fieldDescription");
} else {
grid.setToolTip(columnListParameter.getDescription());
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
+ columnListParameter.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 init() {
private void createGrid() {
ColumnItemProperties props = GWT.create(ColumnItemProperties.class);
ColumnConfig<ColumnItem, String> labelCol = new ColumnConfig<ColumnItem, String>(
@ -87,29 +123,33 @@ public class ColumnListFld extends AbstractFld implements
}
/**
*
*/
private void showNoSelectionField() {
vp.clear();
vp.add(grid);
vp.add(new HTML(
"<div class='workflow-parameters-description'>Select table from parameter "
+ this.columnListParameter
.getReferredTabularParameterName() + "</div>"));
vp.forceLayout();
vContainer.clear();
VerticalLayoutContainer vField = new VerticalLayoutContainer();
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
"<div class='workflow-parameters-description'><p>Select table from parameter "
+ Format.ellipse(columnListParameter
.getReferredTabularParameterName(), 30)
+ "</p></div>");
typeDescription.setStylePrimaryName("workflow-parameters-description");
vField.add(grid, 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) {
vp.clear();
vp.add(grid);
vp.add(new HTML(
"<div class='workflow-parameters-description'>Columns of Data Set "
+ tableItem.getName() + "</div>"));
vp.forceLayout();
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(grid, new VerticalLayoutData(1, -1, new Margins(0)));
vField.add(typeDescription, new VerticalLayoutData(-1, -1, new Margins(
0)));
vContainer.add(vField);
}
/**
@ -134,17 +174,15 @@ public class ColumnListFld extends AbstractFld implements
*/
@Override
public Widget getWidget() {
return vp;
return fieldContainer;
}
/**
*
*/
@Override
public boolean isValid() {
return store.size() > 0;
return (sm.getSelection() != null && sm.getSelection().size() > 0);
}
@Override
@ -163,7 +201,7 @@ public class ColumnListFld extends AbstractFld implements
grid.enable();
showFieldWithSelection(tableItemSimple);
}
}
}

View File

@ -41,8 +41,7 @@ public class DoubleFld extends AbstractFld {
if (p.getDefaultValue() != null)
numberField.setValue(Double.parseDouble(p.getDefaultValue()));
else
numberField.setAllowBlank(false);
numberField.setAllowBlank(false);
HtmlLayoutContainer descr;
@ -89,5 +88,14 @@ public class DoubleFld extends AbstractFld {
public Widget getWidget() {
return fieldContainer;
}
/**
*
*/
@Override
public boolean isValid() {
return numberField.isValid();
}
}

View File

@ -82,7 +82,12 @@ public class EnumFld extends AbstractFld {
*/
@Override
public Widget getWidget() {
return listBox;
return fieldContainer;
}
@Override
public boolean isValid() {
return listBox.isValid();
}
}

View File

@ -8,6 +8,7 @@ import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.FileParameter;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
@ -20,14 +21,19 @@ import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.allen_sauer.gwt.log.client.Log;
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.sencha.gxt.core.client.dom.XDOM;
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.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.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.form.TextField;
/**
*
@ -44,26 +50,58 @@ public class FileFld extends AbstractFld {
private TextButton selectButton, selectButton2, cancelButton;
private ItemDescription selectedFileItem = null;
private FileParameter fileParameter;
private SimpleContainer fieldContainer;
private HBoxLayoutContainer horiz;
/**
* @param parameter
*/
public FileFld(Parameter parameter) {
super(parameter);
super(parameter);
fileParameter = (FileParameter) parameter;
SimpleContainer tabContainer=new SimpleContainer();
vp=new VerticalLayoutContainer();
/*
* fileSelector = new FileSelector() {
*
* @Override public void fireSelection(TableItemSimple fileItem) {
* super.fireSelection(fileItem); selectedFileItem = fileItem;
* showFieldWithSelection(); } };
*/
init();
tabContainer.add(vp, new MarginData(new Margins(0)));
fieldContainer = new SimpleContainer();
horiz = new HBoxLayoutContainer();
horiz.setPack(BoxLayoutPack.START);
horiz.setEnableOverflow(false);
HtmlLayoutContainer descr;
if (fileParameter.getDescription() == null) {
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'></p>");
descr.addStyleName("workflow-fieldDescription");
} else {
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
+ fileParameter.getDescription() + "</p>");
descr.addStyleName("workflow-fieldDescription");
}
horiz.add(tabContainer, new BoxLayoutData(new Margins()));
horiz.add(descr, new BoxLayoutData(new Margins()));
fieldContainer.add(horiz);
showNoSelectionField();
}
private void init(){
List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE);
List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.addAll(Arrays.asList(ItemType.values()));
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV", false);
wselectDialog = new WorkspaceExplorerSelectDialog("Select File", false);
// filterCriteria, selectableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@ -72,7 +110,7 @@ public class FileFld extends AbstractFld {
public void onSelectedItem(Item item) {
if (item.isFolder() || item.isRoot()) {
UtilsGXT3.info("Attention", "Select a valid csv!");
UtilsGXT3.info("Attention", "Select a valid file!");
} else {
retrieveFileInformation(item);
@ -96,7 +134,7 @@ public class FileFld extends AbstractFld {
@Override
public void onNotValidSelection() {
UtilsGXT3.info("Attention", "Select a valid csv!");
UtilsGXT3.info("Attention", "Select a valid file!");
}
};
@ -138,8 +176,7 @@ public class FileFld extends AbstractFld {
showNoSelectionField();
}
});
showNoSelectionField();
}
private void retrieveFileInformation(final Item item) {
@ -157,7 +194,6 @@ public class FileFld extends AbstractFld {
+ caught.getMessage());
if (caught instanceof ExpiredSessionServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
// sessionExpiredShowDelayed();
} else {
UtilsGXT3.alert(
@ -182,24 +218,34 @@ public class FileFld extends AbstractFld {
}
private void showNoSelectionField() {
vp.clear();
vp.add(selectButton);
vp.forceLayout();
fieldContainer.forceLayout();
}
private void showFieldWithSelection() {
// final String fileId = selectedFileItem.getId();
final String fileName = selectedFileItem.getName();
String fileName = selectedFileItem.getName();
if(fileName==null|| fileName.isEmpty()){
fileName="NoName";
}
TextField tableDescription=new TextField();
tableDescription.setValue(fileName);
tableDescription.setReadOnly(true);
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();
HorizontalLayoutContainer hp = new HorizontalLayoutContainer();
hp.add(new HTML("<div class='workflow-parameters-tableDescription'>"
+ Format.ellipse(fileName, 30) + "</div>"));
hp.add(selectButton2);
hp.add(cancelButton);
vp.add(hp);
vp.add(h);
vp.forceLayout();
fieldContainer.forceLayout();
}
/**
@ -212,7 +258,7 @@ public class FileFld extends AbstractFld {
@Override
public Widget getWidget() {
return vp;
return fieldContainer;
}
@Override

View File

@ -16,12 +16,12 @@ import com.sencha.gxt.widget.core.client.form.FloatField;
/**
*
* @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class FloatFld extends AbstractFld {
private SimpleContainer fieldContainer;
private FloatField numberField;
@ -30,21 +30,18 @@ public class FloatFld extends AbstractFld {
*/
public FloatFld(Parameter parameter) {
super(parameter);
fieldContainer=new SimpleContainer();
fieldContainer = new SimpleContainer();
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
horiz.setPack(BoxLayoutPack.START);
horiz.setEnableOverflow(false);
ObjectParameter p = (ObjectParameter) parameter;
numberField = new FloatField();
if (p.getDefaultValue() != null)
numberField.setValue(Float.parseFloat(p.getDefaultValue()));
else
numberField.setAllowBlank(false);
numberField.setAllowBlank(false);
HtmlLayoutContainer descr;
@ -59,21 +56,22 @@ public class FloatFld extends AbstractFld {
descr.addStyleName("workflow-fieldDescription");
}
SimpleContainer vContainer=new SimpleContainer();
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)));
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();
}
/**
@ -92,4 +90,9 @@ public class FloatFld extends AbstractFld {
public Widget getWidget() {
return fieldContainer;
}
@Override
public boolean isValid() {
return numberField.isValid();
}
}

View File

@ -41,8 +41,7 @@ public class IntFld extends AbstractFld {
if (p.getDefaultValue() != null)
numberField.setValue(Integer.parseInt(p.getDefaultValue()));
else
numberField.setAllowBlank(false);
numberField.setAllowBlank(false);
HtmlLayoutContainer descr;
@ -90,5 +89,11 @@ public class IntFld extends AbstractFld {
public Widget getWidget() {
return fieldContainer;
}
@Override
public boolean isValid() {
return numberField.isValid();
}
}

View File

@ -12,14 +12,23 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectPar
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
import com.google.gwt.user.client.ui.Widget;
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.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.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.form.IntegerField;
/**
* @author ceras
*
* @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ListIntFld extends AbstractFld {
@ -28,6 +37,9 @@ public class ListIntFld extends AbstractFld {
private SimpleContainer simpleContainer;
private VerticalLayoutContainer vp;
private ListParameter listParameter;
private SimpleContainer listContainer;
private SimpleContainer fieldContainer;
private HBoxLayoutContainer horiz;
/**
* @param parameter
@ -35,11 +47,38 @@ public class ListIntFld extends AbstractFld {
public ListIntFld(Parameter parameter) {
super(parameter);
this.listParameter = (ListParameter) parameter;
simpleContainer=new SimpleContainer();
listContainer = new SimpleContainer();
vp = new VerticalLayoutContainer();
simpleContainer.add(vp);
items = new ArrayList<Item>();
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();
}
private void addField(Item upperItem) {
@ -50,7 +89,7 @@ public class ListIntFld extends AbstractFld {
if (upperItem == null) {
Item item = new Item(objPar, true);
items.add(item);
vp.add(item);
vp.add(item, new VerticalLayoutData(1, -1, new Margins()));
} else {
// search the position of the upper item
int pos = 0;
@ -66,7 +105,6 @@ public class ListIntFld extends AbstractFld {
vp.insert(item, pos + 1);
}
simpleContainer.forceLayout();
}
/**
@ -94,8 +132,8 @@ public class ListIntFld extends AbstractFld {
String value = "";
boolean first = true;
for (Item item : items) {
String itemValue = item.getValue();
if (itemValue != null && !itemValue.contentEquals("")) {
Integer itemValue = item.getValue();
if (itemValue != null) {
value += (first ? "" : separator) + itemValue;
first = false;
}
@ -108,7 +146,7 @@ public class ListIntFld extends AbstractFld {
*/
@Override
public Widget getWidget() {
return simpleContainer;
return fieldContainer;
}
/**
@ -116,75 +154,84 @@ public class ListIntFld extends AbstractFld {
*/
@Override
public boolean isValid() {
boolean valid = false;
for (Item item : items)
if (item.getField().getValue() != null) {
valid = true;
break;
if (!item.isValid()) {
return false;
}
return valid;
return true;
}
private class Item extends HorizontalLayoutContainer {
private class Item extends HBoxLayoutContainer {
private IntFld field;
private TextButton addButton;
private TextButton removeButton;
private IntegerField field;
private TextButton addBtn;
private TextButton removeBtn;
/**
* @param objPar
*/
public Item(ObjectParameter objectParameter, boolean first) {
super();
this.field = new IntFld(objectParameter);
this.add(field.getWidget());
field = new IntegerField();
field.setAllowBlank(false);
addBtn = new TextButton("");
addButton = new TextButton("");
addBtn.setIcon(DataMinerManager.resources.add());
addButton.setIcon(DataMinerManager.resources.add());
addButton.addSelectHandler(new SelectEvent.SelectHandler() {
addBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
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
public void onSelect(SelectEvent event) {
removeField(Item.this);
forceLayout();
vp.forceLayout();
fieldContainer.forceLayout();
}
});
removeButton.setVisible(!first);
removeBtn.setVisible(!first);
this.add(addButton);
this.add(removeButton);
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() {
removeButton.setVisible(true);
removeBtn.setVisible(true);
}
public void hideCancelButton() {
removeButton.setVisible(false);
removeBtn.setVisible(false);
}
public String getValue() {
return field.getValue();
public Integer getValue() {
return field.getCurrentValue();
}
public IntFld getField() {
return field;
public boolean isValid() {
return field.isValid();
}
}

View File

@ -11,12 +11,8 @@ 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.Parameter;
import com.google.gwt.editor.client.Editor.Path;
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.container.BoxLayoutContainer.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
@ -31,38 +27,39 @@ import com.sencha.gxt.widget.core.client.form.TextField;
/**
*
* @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ListStringFld extends AbstractFld {
private SimpleContainer fieldContainer;
private HBoxLayoutContainer horiz;
private SimpleContainer listContainer;
private VerticalLayoutContainer vp;
private List<Item> items;
private ListParameter listParameter;
/**
*
* @param parameter
*/
public ListStringFld(Parameter parameter) {
super(parameter);
listParameter = (ListParameter) parameter;
listParameter = (ListParameter) parameter;
listContainer = new SimpleContainer();
vp = new VerticalLayoutContainer();
items = new ArrayList<Item>();
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) {
@ -70,7 +67,7 @@ public class ListStringFld extends AbstractFld {
descr.addStyleName("workflow-fieldDescription");
} else {
listContainer.setToolTip(listParameter.getDescription());
/*listContainer.setToolTip(listParameter.getDescription());*/
descr = new HtmlLayoutContainer("<p style='margin-left:5px;'>"
+ listParameter.getDescription() + "</p>");
descr.addStyleName("workflow-fieldDescription");
@ -82,63 +79,6 @@ public class ListStringFld extends AbstractFld {
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) {
@ -148,7 +88,7 @@ public class ListStringFld extends AbstractFld {
if (upperItem == null) {
Item item = new Item(objPar, true);
items.add(item);
vp.add(item, new VerticalLayoutData(1,-1, new Margins()));
vp.add(item, new VerticalLayoutData(1, -1, new Margins()));
} else {
// search the position of the upper item
int pos = 0;
@ -163,7 +103,7 @@ public class ListStringFld extends AbstractFld {
items.add(pos + 1, item);
vp.insert(item, pos + 1);
}
}
/**
@ -177,8 +117,6 @@ public class ListStringFld extends AbstractFld {
if (items.size() == 1) {
items.get(0).hideCancelButton();
}
}
@ -233,10 +171,10 @@ public class ListStringFld extends AbstractFld {
*/
public Item(ObjectParameter objectParameter, boolean first) {
super();
field = new TextField();
field.setAllowBlank(false);
addBtn = new TextButton("");
addBtn.setIcon(DataMinerManager.resources.add());
@ -270,13 +208,13 @@ public class ListStringFld extends AbstractFld {
});
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()));
add(addBtn, new BoxLayoutData(new Margins()));
add(removeBtn, new BoxLayoutData(new Margins()));
forceLayout();
}
@ -291,12 +229,11 @@ public class ListStringFld extends AbstractFld {
public String getValue() {
return field.getCurrentValue();
}
public boolean isValid(){
public boolean isValid() {
return field.isValid();
}
}
}

View File

@ -1,84 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
/**
* @author ceras
*
*/
public abstract class OpenTableButton extends TextButton {
protected TableItemSimple tableItem=null;
protected boolean added = false;
public abstract void onOpenTable();
public abstract void onHideTable();
public OpenTableButton() {
super("Open Data Set", DataMinerManager.resources.table());
this.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
//TabularData tabularData = DataMinerManager.getTabularData();
//TabularDataGridPanel gridPanel = tabularData.getGridPanel();
Dialog dialog = new Dialog();
dialog.setMaximizable(true);
dialog.setBodyBorder(false);
dialog.setExpanded(true);
dialog.setHeadingText("Data Set "+tableItem.getName());
dialog.setWidth(700);
dialog.setHeight(500);
dialog.setHideOnButtonClick(true);
dialog.setModal(true);
//dialog.add(gridPanel);
dialog.show();
dialog.addHideHandler(new HideHandler() {
@Override
public void onHide(HideEvent event) {
onHideTable();
}
});
onOpenTable();
//tabularData.openTable(tableItem.getId());
//gridPanel.setHeaderVisible(false);
}
});
}
public void setTable(TableItemSimple tableItem) {
this.tableItem = tableItem;
}
/**
* @return the added
*/
public boolean isAdded() {
return added;
}
/**
* @param added the added to set
*/
public void setAdded(boolean added) {
this.added = added;
}
}

View File

@ -81,4 +81,9 @@ public class StringFld extends AbstractFld {
return fieldContainer;
}
@Override
public boolean isValid() {
return textField.isValid();
}
}

View File

@ -57,15 +57,16 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
private TextButton selectButton, selectButton2, cancelButton;
private HtmlLayoutContainer templatesList;
private TableItemSimple selectedTableItem = null;
//private List<AbstractFld> listeners = new ArrayList<AbstractFld>();
private TabularParameter tabularParameter;
/**
* @param parameter
*/
public TabularFld(Parameter parameter) {
super(parameter);
Log.debug("TabularField");
tabularParameter = (TabularParameter) parameter;
SimpleContainer tabContainer=new SimpleContainer();
vp=new VerticalLayoutContainer();
init();
@ -78,14 +79,13 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
HtmlLayoutContainer descr;
if (parameter.getDescription() == null) {
if (tabularParameter.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>");
+ tabularParameter.getDescription() + "</p>");
descr.addStyleName("workflow-fieldDescription");
}
@ -99,8 +99,7 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
private void init() {
TabularParameter p = (TabularParameter) parameter;
List<String> templates = p.getTemplates();
List<String> templates = tabularParameter.getTemplates();
List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE);
@ -253,6 +252,7 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
vp.clear();
vp.add(selectButton);
vp.add(templatesList);
vp.forceLayout();
fieldContainer.forceLayout();
}
@ -270,41 +270,6 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
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");
openTableButton.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
/*TabularData tabularData = DataMinerManager
.getTabularData();
TabularDataGridPanel gridPanel = tabularData
.getGridPanel();
gridPanel.setExpanded(true);
gridPanel.setBorders(true);
Dialog dialog = new Dialog();
dialog.setMaximizable(true);
dialog.setBodyBorder(false);
dialog.setExpanded(true);
dialog.setHeadingText("Data Set " + tableName);
dialog.setWidth(640);
dialog.setHeight(480);
dialog.setHideOnButtonClick(true);
dialog.setModal(true);
dialog.add(gridPanel);
dialog.show();
tabularData.openTable(tableId);
gridPanel.setHeaderVisible(false);*/
}
});
HBoxLayoutContainer h=new HBoxLayoutContainer();
h.add(tableDescription,new BoxLayoutData(new Margins()));
h.add(selectButton2,new BoxLayoutData(new Margins()));

View File

@ -32,8 +32,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent;
public class ComputationOutputPanel extends SimpleContainer {
private ComputationId computationId;
private final DataMinerPortletServiceAsync service = DataMinerManager
.getService();
private final DataMinerPortletServiceAsync service = DataMinerManager.getService();
private VerticalLayoutContainer v;
public ComputationOutputPanel(ComputationId computationId) {

View File

@ -280,9 +280,7 @@
margin-top: 4px;
}
.computationExcecutionPanel {
}
.workflow-parameters-tableDescription {
font-size: 12px;
@ -334,139 +332,6 @@
vertical-align: middle;
}
/* PENDING */
.progressBar-pending {
border: 1px solid #AAAAAA;
}
.progressBar-pending .x-progress-bar {
border: medium none;
background-image: url("images/progress-gray.gif");
}
/* FAILED */
.progressBar-failed {
border: 1px solid #AA0000;
}
.progressBar-failed .x-progress-bar {
border: medium none;
background-image: url("images/progress-red.gif");
}
/* COMPLETE */
.progressBar-complete {
border: 1px solid #00AA00;
}
.progressBar-complete .x-progress-bar {
border: medium none;
background-image: url("images/progress-green.gif");
}
/* JOB VIEWER */
.jobViewer-title {
font-size: 16px;
color: #000077;
margin-bottom: 10px;
margin-top: 10px;
}
.jobViewer-section {
box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
rgba(77, 77, 77, 1);
-moz-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
rgba(77, 77, 77, 1);
-webkit-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
rgba(77, 77, 77, 1);
-o-box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.11), 0 0 0
rgba(255, 255, 255, 1), 0 0 1px rgba(196, 196, 196, 1), inset 0 0 1px
rgba(77, 77, 77, 1);
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-o-border-radius: 5px;
margin: 0px 5px 5px 10px; /* top right bottom left*/
padding: 5px;
/* overflow: hidden;*/
}
.jobViewer-section-header {
border-bottom: 1px solid gray;
margin-bottom: 10px;
margin-left: 5px;
margin-top: 20px;
}
.jobViewer-section-header-title {
color: #333333;
font-size: 14px;
font-weight: bold;
margin-bottom: 5px;
}
.jobViewer-section-header-image {
margin-right: 5px;
}
.jobViewer-table {
line-height: 1.6em;
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 15px;
width: 480px;
text-align: left;
border-collapse: collapse;
}
.jobViewer-table th {
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
color: #039;
}
.jobViewer-table td {
padding: 3px 5px;
border-top: 1px solid #e8edff;
}
.jobViewer-table-oce-first {
background: #d0dafd;
border-right: 10px solid transparent;
border-left: 10px solid transparent;
}
.jobViewer-table tr:hover td {
color: #339;
background: #eff2ff;
}
.jobViewer-output-outputType {
background-color: #EEEEEE;
border: 1px solid #BDBDBD;
font-weight: bold;
margin-bottom: 20px;
margin-top: 10px;
padding: 5px;
text-align: center;
}
.jobViewer-output-groupTitle {
font-style: italic;
font-weight: bold;
margin-bottom: 5px;
}
.jobViewer-output-separator {
border-top: 2px solid #AAAAAA;
height: 30px;
margin: 8px auto auto;
width: 400px;
}
.menuImgLogo:HOVER {
/* cursor: pointer;*/
@ -490,164 +355,87 @@
cursor: auto;
}
/* TABLE IMPORTER AND UPLOAD MONITOR */
.tableImporter, .uploadMonitor {
margin: auto;
margin-top: 20px;
padding: 5px;
}
.tableImporter-title, .uploadMonitor-title {
text-align: center;
font-size: 16px;
font-weight: bold;
color: #000077;
margin-top: 5px;
}
.uploadMonitor-text {
margin-left: 5px;
}
.uploadMonitor-description, .tableImporter-description {
font-size: 12px;
color: #505050;
margin-top: 2px;
padding-left: 2px;
padding-right: 2px;
width: 380px;
}
.tableImporter-form {
border: none;
}
.tableImporter-form .x-panel-body {
border: none;
}
.tableImporter-templateDescriptionsButton {
font-size: 14px;
font-weight: bold;
border: 1px dotted #BBBBBB;
color: #555555;
text-align: center;
margin-top: 10px;
}
.tableImporter-templateDescriptionsButton:HOVER {
cursor: pointer;
color: #000077;
}
.tableImporter-templateDescriptions-textSelectTemplate {
/*
* Computation Execution
*/
.computationExcecutionPanel {
font-size: 13px;
margin: 10px;
color: black;
}
.tableImporter-templateDescriptorPanel {
text-align: left;
margin: auto;
margin-top: 10px;
padding: 5px;
.computationStatusPanel{
border: 1px solid black;
padding: 10px;
}
.tableImporter-templateDescriptorPanel-img {
float: left;
position: relative;
left: 10px;
top: -20px;
.computationStatusTitle {
}
.imgCursor:hover {
cursor: pointer;
opacity: 0.7;
margin: auto;
.computationStatusDate {
}
.tableImporter-fileName {
font-size: 10px;
color: #505050;
margin: auto;
/**
* ProgressBar
*/
.progressBar-pending {
border: 1px solid #AAAAAA;
}
.tableImporter-templateText {
font-size: 10px;
color: #505050;
height: 25px;
vertical-align: bottom;
.progressBar-pending .x-progress-bar {
border: medium none;
background-image: url("images/progress-gray.gif");
}
.tableImporter-templateIcon {
margin: auto;
margin-bottom: -10px;
margin-top: -5px;
.progressBar-failed {
border: 1px solid #AA0000;
}
.tableImporter-templateIcon:hover {
cursor: pointer;
opacity: 0.7;
.progressBar-failed .x-progress-bar {
border: medium none;
background-image: url("images/progress-red.gif");
}
.templateDescriptorPanel-description {
font-size: 13px;
color: #505050;
margin-top: 17px;
padding-left: 30px;
padding-right: 20px;
padding-top: 28px;
.progressBar-complete .progressWrap {
border-color:#00AA00;
}
.templateDescriptorPanel-tableTemplateItem {
border-bottom: 1px solid gray;
font-size: 13px;
font-weight: bold;
margin-left: 10px;
padding-top: 20px;
.progressBar-complete .progressInner {
background-color:#bdefbd;
background-image: url("images/bg-progress.gif");
height: auto;
}
.templateDescriptorPanel-table {
line-height: 1.6em;
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 15px;
width: 480px;
text-align: left;
border-collapse: collapse;
.progressBar-complete .progressBar {
background-color:#4ec14e;
background-image: url("images/green-progress.gif");
background-repeat: repeat-x;
background-position: left center;
height: 18px;
border-top-color:#d1fdda;
border-bottom-color:#7fe48a;
border-right-color:#7fe48a;
}
.templateDescriptorPanel-table th {
font-size: 13px;
font-weight: normal;
padding: 12px 15px;
color: #039;
}
/*
*
*.progressBar-complete {
* border: 1px solid #00AA00;
*}
*
*.progressBar-complete .x-progress-bar {
* border: medium none;
* background-image: url("images/progress-green.gif");
*}
*/
.templateDescriptorPanel-table td {
padding: 3px 5px;
color: #669;
border-top: 1px solid #e8edff;
}
.templateDescriptorPanel-table-oce-first {
background: #d0dafd;
border-right: 10px solid transparent;
border-left: 10px solid transparent;
}
.templateDescriptorPanel-table tr:hover td {
color: #339;
background: #eff2ff;
}
.gcube_DialogBox .Caption {
font-family: Arial Unicode !important;
}
.dataSpace-grid-templateImg {
display: inline;
}
.dataSpace-grid-tableName {
font-weight: bold;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

249922
test.log.1

File diff suppressed because one or more lines are too long

101397
test.log.2 Normal file

File diff suppressed because one or more lines are too long