diff --git a/.gwt/.gwt-log b/.gwt/.gwt-log new file mode 100644 index 0000000..82e18aa --- /dev/null +++ b/.gwt/.gwt-log @@ -0,0 +1,20 @@ +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... +Public resources found in... +Translatable source found in... +Found 0 cached/archived units. Used 0 / 3925 units from cache. +Compiling... diff --git a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/ChartSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/ChartSelectionCard.java index a6fc2a4..808ca1c 100644 --- a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/ChartSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/ChartSelectionCard.java @@ -1,5 +1,6 @@ package org.gcube.portlets.user.td.chartswidget.client; +import org.gcube.portlets.user.td.chartswidget.client.help.ChartHelp; import org.gcube.portlets.user.td.chartswidget.client.properties.ChartTypePropertiesCombo; import org.gcube.portlets.user.td.chartswidget.client.store.ChartTypeElement; import org.gcube.portlets.user.td.chartswidget.client.store.ChartTypeStore; @@ -44,7 +45,7 @@ public class ChartSelectionCard extends WizardCard { private ChartType chartTypeSelected; private ComboBox comboChartType; private FieldLabel comboChartTypeLabel; - + private ChartHelp chartHelp; public ChartSelectionCard(final ChartSession chartSession) { @@ -87,10 +88,12 @@ public class ChartSelectionCard extends WizardCard { comboChartType.setTriggerAction(TriggerAction.ALL); comboChartTypeLabel = new FieldLabel(comboChartType, "Chart Type"); + + chartHelp=new ChartHelp(); content.add(comboChartTypeLabel, new VerticalLayoutData(1, -1, new Margins(0))); - + content.add(chartHelp, new VerticalLayoutData(1,-1, new Margins(0))); return panel; } @@ -119,6 +122,7 @@ public class ChartSelectionCard extends WizardCard { private void updateChartType(ChartType type) { chartTypeSelected = type; + chartHelp.updateChartType(type); } @Override diff --git a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/help/ChartHelp.java b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/help/ChartHelp.java new file mode 100644 index 0000000..ade6b66 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/help/ChartHelp.java @@ -0,0 +1,48 @@ +package org.gcube.portlets.user.td.chartswidget.client.help; + +import org.gcube.portlets.user.td.widgetcommonevent.shared.charts.ChartType; + +import com.google.gwt.user.client.ui.HTML; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public class ChartHelp extends SimpleContainer { + + public ChartHelp() { + super(); + init(); + } + + public void init() { + HTML suggestion = new HTML( + "

"); + add(suggestion); + } + + public void updateChartType(ChartType type) { + HTML suggestion; + clear(); + switch (type) { + case TopRating: + suggestion = new HTML( + "

Top Rating: given a dataset, " + + "crete a chart that has dimension values, with aggregate measure on y-axis and a time-dimension on x-axis

"); + add(suggestion); + break; + default: + suggestion = new HTML( + "

"); + add(suggestion); + break; + + } + + forceLayout(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionCard.java index 863f58a..11fe69f 100644 --- a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionCard.java @@ -32,7 +32,7 @@ public class TopRatingColumnSelectionCard extends WizardCard { public TopRatingColumnSelectionCard(final ChartSession chartSession, final ChartTopRatingSession chartTopRatingSession) { - super("Column Selection", ""); + super("Dimension Column Selection", ""); this.thisCard=this; if (chartTopRatingSession == null) { Log.error("ChartTopRatingSession is null"); diff --git a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionGridPanel.java b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionGridPanel.java index ec42395..7a05e10 100644 --- a/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionGridPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/chartswidget/client/toprating/TopRatingColumnSelectionGridPanel.java @@ -6,6 +6,7 @@ import java.util.List; import org.gcube.portlets.user.td.chartswidget.client.grid.ColumnDataProperties; import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode; import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.core.client.GWT; @@ -51,7 +52,7 @@ public class TopRatingColumnSelectionGridPanel extends ContentPanel implements public TopRatingColumnSelectionGridPanel(TopRatingColumnSelectionCard parent, ChartSession chartSession) { this.parent=parent; Log.debug("TopRatingColumnSelectionGridPanel"); - setHeadingText("Colums"); + setHeadingText("Dimension Colums"); ColumnConfig labelCol = new ColumnConfig( props.label()); @@ -66,7 +67,12 @@ public class TopRatingColumnSelectionGridPanel extends ContentPanel implements ColumnModel cm = new ColumnModel(l); ListStore store = new ListStore(props.id()); - store.addAll(chartSession.getColumns()); + ArrayList coloumns=chartSession.getColumns(); + for(ColumnData col:coloumns){ + if(col.getTypeCode().compareTo(ColumnTypeCode.DIMENSION.toString())==0){ + store.add(col); + } + } grid = new Grid(store, cm); sm.setSelectionMode(SelectionMode.SINGLE);