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
This commit is contained in:
Giancarlo Panichi 2015-02-05 14:47:07 +00:00
parent c8b2e4c86a
commit a5a9eec7dc
2 changed files with 48 additions and 48 deletions

View File

@ -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<PeriodDataType> storeComboPeriodType;
private ListStore<TimeDataFormat> storeComboTimeDataFormat;
private ComboBox<TimeDataFormat> comboTimeDataFormat;
private FieldLabel comboTimeDataFormatLabel;
private ListStore<ValueDataFormat> storeComboValueDataFormat;
private ComboBox<ValueDataFormat> comboValueDataFormat;
private FieldLabel comboValueDataFormatLabel;
private ComboBox<LocaleTypeElement> comboLocaleType = null;
private FieldLabel comboLocaleTypeLabel;
private ListStore<LocaleTypeElement> 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<TimeDataFormat>(
ValueDataFormatProperties propsTimeDataFormat = GWT
.create(ValueDataFormatProperties.class);
storeComboValueDataFormat = new ListStore<ValueDataFormat>(
propsTimeDataFormat.id());
comboTimeDataFormat = new ComboBox<TimeDataFormat>(
storeComboTimeDataFormat, propsTimeDataFormat.example());
comboValueDataFormat = new ComboBox<ValueDataFormat>(
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<TimeDataFormat> labelProvider) {
comboTimeDataFormat
.addSelectionHandler(new SelectionHandler<TimeDataFormat>() {
public void onSelection(SelectionEvent<TimeDataFormat> event) {
final LabelProvider<ValueDataFormat> labelProvider) {
comboValueDataFormat
.addSelectionHandler(new SelectionHandler<ValueDataFormat>() {
public void onSelection(SelectionEvent<ValueDataFormat> 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<TimeDataFormat> timeDataFormats = periodDataType
ArrayList<ValueDataFormat> 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<TimeDataFormat> timeDataFormats = cd
ArrayList<ValueDataFormat> 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

View File

@ -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: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface TimeDataFormatProperties extends
PropertyAccess<TimeDataFormat> {
public interface ValueDataFormatProperties extends
PropertyAccess<ValueDataFormat> {
@Path("id")
ModelKeyProvider<TimeDataFormat> id();
ModelKeyProvider<ValueDataFormat> id();
LabelProvider<TimeDataFormat> example();
LabelProvider<ValueDataFormat> example();
}