From a5a9eec7dc31fe19bb4b6dda2b52e1080e3f28b0 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 5 Feb 2015 14:47:07 +0000 Subject: [PATCH] Updated PeriodDataType git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@111727 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/ChangeColumnTypePanel.java | 86 +++++++++---------- ...es.java => ValueDataFormatProperties.java} | 10 +-- 2 files changed, 48 insertions(+), 48 deletions(-) rename src/main/java/org/gcube/portlets/user/td/columnwidget/client/properties/{TimeDataFormatProperties.java => ValueDataFormatProperties.java} (61%) diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ChangeColumnTypePanel.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ChangeColumnTypePanel.java index aaa2df8..94fb483 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ChangeColumnTypePanel.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/ChangeColumnTypePanel.java @@ -13,7 +13,7 @@ import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnTypeCodeP import org.gcube.portlets.user.td.columnwidget.client.properties.LocaleTypeProperties; import org.gcube.portlets.user.td.columnwidget.client.properties.PeriodDataTypeProperties; import org.gcube.portlets.user.td.columnwidget.client.properties.TabResourceProperties; -import org.gcube.portlets.user.td.columnwidget.client.properties.TimeDataFormatProperties; +import org.gcube.portlets.user.td.columnwidget.client.properties.ValueDataFormatProperties; import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle; import org.gcube.portlets.user.td.columnwidget.client.store.ColumnDataTypeElement; import org.gcube.portlets.user.td.columnwidget.client.store.ColumnDataTypeStore; @@ -29,7 +29,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.gwtservice.shared.tr.PeriodDataType; import org.gcube.portlets.user.td.gwtservice.shared.tr.RefColumn; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; -import org.gcube.portlets.user.td.gwtservice.shared.tr.TimeDataFormat; +import org.gcube.portlets.user.td.gwtservice.shared.tr.ValueDataFormat; import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMappingList; import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeSession; import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog; @@ -124,10 +124,10 @@ public class ChangeColumnTypePanel extends FramedPanel implements private FieldLabel comboPeriodTypeLabel; private ListStore storeComboPeriodType; - private ListStore storeComboTimeDataFormat; - private ComboBox comboTimeDataFormat; - private FieldLabel comboTimeDataFormatLabel; - + private ListStore storeComboValueDataFormat; + private ComboBox comboValueDataFormat; + private FieldLabel comboValueDataFormatLabel; + private ComboBox comboLocaleType = null; private FieldLabel comboLocaleTypeLabel; private ListStore storeComboLocaleType; @@ -444,23 +444,23 @@ public class ChangeColumnTypePanel extends FramedPanel implements comboPeriodTypeLabel = new FieldLabel(comboPeriodType, "Period Type"); // comboTimeDataFormat - TimeDataFormatProperties propsTimeDataFormat = GWT - .create(TimeDataFormatProperties.class); - storeComboTimeDataFormat = new ListStore( + ValueDataFormatProperties propsTimeDataFormat = GWT + .create(ValueDataFormatProperties.class); + storeComboValueDataFormat = new ListStore( propsTimeDataFormat.id()); - comboTimeDataFormat = new ComboBox( - storeComboTimeDataFormat, propsTimeDataFormat.example()); + comboValueDataFormat = new ComboBox( + storeComboValueDataFormat, propsTimeDataFormat.example()); Log.trace("ComboTimeDataFormat created"); addHandlersForComboTimeDataFormat(propsTimeDataFormat.example()); - comboTimeDataFormat.setEmptyText("Select a time format..."); - comboTimeDataFormat.setWidth(191); - comboTimeDataFormat.setTypeAhead(true); - comboTimeDataFormat.setTriggerAction(TriggerAction.ALL); - comboTimeDataFormatLabel = new FieldLabel(comboTimeDataFormat, + comboValueDataFormat.setEmptyText("Select a time format..."); + comboValueDataFormat.setWidth(191); + comboValueDataFormat.setTypeAhead(true); + comboValueDataFormat.setTriggerAction(TriggerAction.ALL); + comboValueDataFormatLabel = new FieldLabel(comboValueDataFormat, "Time Format"); // Change @@ -499,7 +499,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements */ v.add(comboPeriodTypeLabel, new VerticalLayoutData(1, -1, new Margins(1))); - v.add(comboTimeDataFormatLabel, new VerticalLayoutData(1, -1, + v.add(comboValueDataFormatLabel, new VerticalLayoutData(1, -1, new Margins(1))); v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0))); add(v, new VerticalLayoutData(1, 1, new Margins(0))); @@ -516,7 +516,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements comboColumnReferenceTypeLabel.setVisible(false); comboColumnMappingLabel.setVisible(false); comboPeriodTypeLabel.setVisible(false); - comboTimeDataFormat.setValidateOnBlur(false); + comboValueDataFormat.setValidateOnBlur(false); comboLocaleTypeLabel.setVisible(false); } @@ -708,10 +708,10 @@ public class ChangeColumnTypePanel extends FramedPanel implements } protected void addHandlersForComboTimeDataFormat( - final LabelProvider labelProvider) { - comboTimeDataFormat - .addSelectionHandler(new SelectionHandler() { - public void onSelection(SelectionEvent event) { + final LabelProvider labelProvider) { + comboValueDataFormat + .addSelectionHandler(new SelectionHandler() { + public void onSelection(SelectionEvent event) { Info.display( "Time Format Selected", "You selected " @@ -721,7 +721,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements + "!")); Log.debug("ComboTimeDataFormat selected: " + event.getSelectedItem()); - TimeDataFormat timeDataFormat = event.getSelectedItem(); + ValueDataFormat timeDataFormat = event.getSelectedItem(); updateTimeDataFormat(timeDataFormat); } @@ -739,7 +739,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements comboColumnReferenceTypeLabel.setVisible(false); comboColumnMappingLabel.setVisible(false); comboPeriodTypeLabel.setVisible(false); - comboTimeDataFormatLabel.setVisible(false); + comboValueDataFormatLabel.setVisible(false); break; case ATTRIBUTE: comboLocaleTypeLabel.setVisible(false); @@ -749,7 +749,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements comboColumnReferenceTypeLabel.setVisible(false); comboColumnMappingLabel.setVisible(false); comboPeriodTypeLabel.setVisible(false); - comboTimeDataFormatLabel.setVisible(false); + comboValueDataFormatLabel.setVisible(false); break; case DIMENSION: comboLocaleTypeLabel.setVisible(false); @@ -759,7 +759,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements comboColumnReferenceTypeLabel.setVisible(false); comboColumnMappingLabel.setVisible(false); comboPeriodTypeLabel.setVisible(false); - comboTimeDataFormatLabel.setVisible(false); + comboValueDataFormatLabel.setVisible(false); break; case MEASURE: comboLocaleTypeLabel.setVisible(false); @@ -769,7 +769,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements comboColumnReferenceTypeLabel.setVisible(false); comboColumnMappingLabel.setVisible(false); comboPeriodTypeLabel.setVisible(false); - comboTimeDataFormatLabel.setVisible(false); + comboValueDataFormatLabel.setVisible(false); break; case TIMEDIMENSION: comboLocaleTypeLabel.setVisible(false); @@ -779,7 +779,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements comboColumnReferenceTypeLabel.setVisible(false); comboColumnMappingLabel.setVisible(false); comboPeriodTypeLabel.setVisible(true); - comboTimeDataFormatLabel.setVisible(true); + comboValueDataFormatLabel.setVisible(true); break; default: comboLocaleTypeLabel.setVisible(false); @@ -789,7 +789,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements comboColumnReferenceTypeLabel.setVisible(false); comboColumnMappingLabel.setVisible(false); comboPeriodTypeLabel.setVisible(false); - comboTimeDataFormatLabel.setVisible(false); + comboValueDataFormatLabel.setVisible(false); break; } @@ -813,17 +813,17 @@ public class ChangeColumnTypePanel extends FramedPanel implements } protected void updatePeriodType(PeriodDataType periodDataType) { - ArrayList timeDataFormats = periodDataType + ArrayList timeDataFormats = periodDataType .getTimeDataFormats(); - comboTimeDataFormat.clear(); - comboTimeDataFormat.reset(); - comboTimeDataFormat.getStore().clear(); - comboTimeDataFormat.getStore().addAll(timeDataFormats); - comboTimeDataFormat.redraw(); + comboValueDataFormat.clear(); + comboValueDataFormat.reset(); + comboValueDataFormat.getStore().clear(); + comboValueDataFormat.getStore().addAll(timeDataFormats); + comboValueDataFormat.redraw(); } - protected void updateTimeDataFormat(TimeDataFormat type) { + protected void updateTimeDataFormat(ValueDataFormat type) { } @@ -928,13 +928,13 @@ public class ChangeColumnTypePanel extends FramedPanel implements changeColumnTypeSession.setPeriodDataType(cd .getPeriodDataType()); comboPeriodType.setValue(cd.getPeriodDataType()); - ArrayList timeDataFormats = cd + ArrayList timeDataFormats = cd .getPeriodDataType().getTimeDataFormats(); - comboTimeDataFormat.clear(); - comboTimeDataFormat.reset(); - comboTimeDataFormat.getStore().clear(); - comboTimeDataFormat.getStore().addAll(timeDataFormats); - comboTimeDataFormat.redraw(); + comboValueDataFormat.clear(); + comboValueDataFormat.reset(); + comboValueDataFormat.getStore().clear(); + comboValueDataFormat.getStore().addAll(timeDataFormats); + comboValueDataFormat.redraw(); } else { // TODO if (type == ColumnTypeCode.DIMENSION) { @@ -1202,7 +1202,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements if (periodDataType != null) { changeColumnTypeSession .setPeriodDataType(periodDataType); - TimeDataFormat timeDataFormat = comboTimeDataFormat + ValueDataFormat timeDataFormat = comboValueDataFormat .getCurrentValue(); if (timeDataFormat != null) { changeColumnTypeSession diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/properties/TimeDataFormatProperties.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/properties/ValueDataFormatProperties.java similarity index 61% rename from src/main/java/org/gcube/portlets/user/td/columnwidget/client/properties/TimeDataFormatProperties.java rename to src/main/java/org/gcube/portlets/user/td/columnwidget/client/properties/ValueDataFormatProperties.java index 272b610..71e529e 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/properties/TimeDataFormatProperties.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/properties/ValueDataFormatProperties.java @@ -1,6 +1,6 @@ package org.gcube.portlets.user.td.columnwidget.client.properties; -import org.gcube.portlets.user.td.gwtservice.shared.tr.TimeDataFormat; +import org.gcube.portlets.user.td.gwtservice.shared.tr.ValueDataFormat; import com.google.gwt.editor.client.Editor.Path; import com.sencha.gxt.data.shared.LabelProvider; @@ -13,12 +13,12 @@ import com.sencha.gxt.data.shared.PropertyAccess; * email: g.panichi@isti.cnr.it * */ -public interface TimeDataFormatProperties extends - PropertyAccess { +public interface ValueDataFormatProperties extends + PropertyAccess { @Path("id") - ModelKeyProvider id(); + ModelKeyProvider id(); - LabelProvider example(); + LabelProvider example(); } \ No newline at end of file