refs 2521: Explore the possibility to port the StatMan interface onto Dataminer
https://support.d4science.org/issues/2521 Fixed default value selected for columns field git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@129061 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
87fc6763bd
commit
032a574d84
|
@ -14,10 +14,14 @@ import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
|
|||
import org.gcube.portlets.user.dataminermanager.shared.parameters.ColumnListParameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.parameters.Parameter;
|
||||
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
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.XTemplates;
|
||||
import com.sencha.gxt.core.client.util.Format;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.data.shared.ListStore;
|
||||
|
@ -42,6 +46,11 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
|
|||
public class ColumnListFld extends AbstractFld implements
|
||||
TabularFldChangeEventHandler {
|
||||
|
||||
interface LabelTemplates extends XTemplates {
|
||||
@XTemplate("<span title=\"{value}\">{value}</span>")
|
||||
SafeHtml format(String value);
|
||||
}
|
||||
|
||||
// private VerticalLayoutContainer vp;
|
||||
private ColumnListParameter columnListParameter;
|
||||
private ListStore<ColumnItem> store;
|
||||
|
@ -95,6 +104,17 @@ public class ColumnListFld extends AbstractFld implements
|
|||
|
||||
ColumnConfig<ColumnItem, String> labelCol = new ColumnConfig<ColumnItem, String>(
|
||||
props.label());
|
||||
|
||||
labelCol.setCell(new AbstractCell<String>() {
|
||||
|
||||
@Override
|
||||
public void render(Context context, String value, SafeHtmlBuilder sb) {
|
||||
LabelTemplates labelTemplates = GWT
|
||||
.create(LabelTemplates.class);
|
||||
sb.append(labelTemplates.format(value));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
IdentityValueProvider<ColumnItem> identity = new IdentityValueProvider<ColumnItem>();
|
||||
sm = new CheckBoxSelectionModel<ColumnItem>(identity);
|
||||
|
@ -111,7 +131,7 @@ public class ColumnListFld extends AbstractFld implements
|
|||
sm.setSelectionMode(SelectionMode.MULTI);
|
||||
grid.setSelectionModel(sm);
|
||||
// grid.getView().setAutoExpandColumn(labelCol);
|
||||
grid.setSize("150px", "150px");
|
||||
grid.setSize("180px", "150px");
|
||||
grid.getView().setStripeRows(true);
|
||||
grid.getView().setColumnLines(true);
|
||||
grid.getView().setAutoFill(true);
|
||||
|
@ -132,7 +152,7 @@ public class ColumnListFld extends AbstractFld implements
|
|||
.getReferredTabularParameterName(), 30)
|
||||
+ "</p></div>");
|
||||
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||
vField.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vField.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
vField.add(typeDescription, new VerticalLayoutData(-1, -1, new Margins(
|
||||
0)));
|
||||
vContainer.add(vField);
|
||||
|
@ -146,7 +166,7 @@ public class ColumnListFld extends AbstractFld implements
|
|||
+ Format.ellipse(tableItem.getName(), 30)
|
||||
+ "</p></div>");
|
||||
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||
vField.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vField.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
vField.add(typeDescription, new VerticalLayoutData(-1, -1, new Margins(
|
||||
0)));
|
||||
vContainer.add(vField);
|
||||
|
|
|
@ -61,7 +61,7 @@ public class DoubleFld extends AbstractFld {
|
|||
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
|
||||
"Double Value");
|
||||
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||
vField.add(numberField, 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);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public class FloatFld extends AbstractFld {
|
|||
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
|
||||
"Float Value");
|
||||
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||
vField.add(numberField, 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);
|
||||
|
|
|
@ -61,7 +61,7 @@ public class IntFld extends AbstractFld {
|
|||
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
|
||||
"Integer Value");
|
||||
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||
vField.add(numberField, 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);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class StringFld extends AbstractFld {
|
|||
HtmlLayoutContainer typeDescription = new HtmlLayoutContainer(
|
||||
"String Value");
|
||||
typeDescription.setStylePrimaryName("workflow-parameters-description");
|
||||
vField.add(textField, new VerticalLayoutData(1,-1,new Margins(0)));
|
||||
vField.add(textField, new VerticalLayoutData(-1,-1,new Margins(0)));
|
||||
vField.add(typeDescription, new VerticalLayoutData(-1,-1,new Margins(0)));
|
||||
vContainer.add(vField);
|
||||
|
||||
|
|
|
@ -40,18 +40,19 @@
|
|||
|
||||
<entry-point
|
||||
class='org.gcube.portlets.user.dataminermanager.client.DataMinerManager' />
|
||||
<!-- <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
|
||||
<!--
|
||||
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
|
||||
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
||||
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
||||
/> -->
|
||||
/> -->
|
||||
|
||||
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
|
||||
/> -->
|
||||
|
||||
|
||||
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
||||
<set-property name="log_DivLogger" value="DISABLED" />
|
||||
<set-property name="log_GWTLogger" value="DISABLED" />
|
||||
<set-property name="log_SystemLogger" value="DISABLED" />
|
||||
<set-property name="log_SystemLogger" value="DISABLED" />
|
||||
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED"
|
||||
/> -->
|
||||
|
||||
|
|
Loading…
Reference in New Issue