Updated PeriodDataType
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@111677 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
28f2cefd80
commit
c8b2e4c86a
|
@ -13,6 +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.LocaleTypeProperties;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.properties.PeriodDataTypeProperties;
|
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.TabResourceProperties;
|
||||||
|
import org.gcube.portlets.user.td.columnwidget.client.properties.TimeDataFormatProperties;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
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.ColumnDataTypeElement;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.store.ColumnDataTypeStore;
|
import org.gcube.portlets.user.td.columnwidget.client.store.ColumnDataTypeStore;
|
||||||
|
@ -28,6 +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.PeriodDataType;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.RefColumn;
|
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.TabResource;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TimeDataFormat;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMappingList;
|
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.gwtservice.shared.tr.column.type.ChangeColumnTypeSession;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
||||||
|
@ -118,10 +120,14 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
private FieldLabel comboColumnMappingLabel;
|
private FieldLabel comboColumnMappingLabel;
|
||||||
private ListStore<ColumnMappingList> storeComboColumnMapping;
|
private ListStore<ColumnMappingList> storeComboColumnMapping;
|
||||||
|
|
||||||
private ComboBox<PeriodDataType> comboTimeDimensionType = null;
|
private ComboBox<PeriodDataType> comboPeriodType = null;
|
||||||
private FieldLabel comboTimeDimensionTypeLabel;
|
private FieldLabel comboPeriodTypeLabel;
|
||||||
private ListStore<PeriodDataType> storeComboTimeDimensionType;
|
private ListStore<PeriodDataType> storeComboPeriodType;
|
||||||
|
|
||||||
|
private ListStore<TimeDataFormat> storeComboTimeDataFormat;
|
||||||
|
private ComboBox<TimeDataFormat> comboTimeDataFormat;
|
||||||
|
private FieldLabel comboTimeDataFormatLabel;
|
||||||
|
|
||||||
private ComboBox<LocaleTypeElement> comboLocaleType = null;
|
private ComboBox<LocaleTypeElement> comboLocaleType = null;
|
||||||
private FieldLabel comboLocaleTypeLabel;
|
private FieldLabel comboLocaleTypeLabel;
|
||||||
private ListStore<LocaleTypeElement> storeComboLocaleType;
|
private ListStore<LocaleTypeElement> storeComboLocaleType;
|
||||||
|
@ -132,7 +138,6 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
|
|
||||||
private ChangeColumnTypeSession changeColumnTypeSession;
|
private ChangeColumnTypeSession changeColumnTypeSession;
|
||||||
private boolean panelCreated;
|
private boolean panelCreated;
|
||||||
|
|
||||||
|
|
||||||
public ChangeColumnTypePanel(TRId trId, String columnName, EventBus eventBus) {
|
public ChangeColumnTypePanel(TRId trId, String columnName, EventBus eventBus) {
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
|
@ -410,14 +415,14 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
|
|
||||||
comboColumnMappingLabel = new FieldLabel(comboColumnMapping, "Mapping");
|
comboColumnMappingLabel = new FieldLabel(comboColumnMapping, "Mapping");
|
||||||
|
|
||||||
// comboTimeDimensionType
|
// comboPeriodType
|
||||||
PeriodDataTypeProperties propsTimeDimensionType = GWT
|
PeriodDataTypeProperties propsPeriodDataType = GWT
|
||||||
.create(PeriodDataTypeProperties.class);
|
.create(PeriodDataTypeProperties.class);
|
||||||
storeComboTimeDimensionType = new ListStore<PeriodDataType>(
|
storeComboPeriodType = new ListStore<PeriodDataType>(
|
||||||
propsTimeDimensionType.name());
|
propsPeriodDataType.name());
|
||||||
|
|
||||||
comboTimeDimensionType = new ComboBox<PeriodDataType>(
|
comboPeriodType = new ComboBox<PeriodDataType>(storeComboPeriodType,
|
||||||
storeComboTimeDimensionType, propsTimeDimensionType.label()){
|
propsPeriodDataType.label()) {
|
||||||
protected void onAfterFirstAttach() {
|
protected void onAfterFirstAttach() {
|
||||||
super.onAfterFirstAttach();
|
super.onAfterFirstAttach();
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
|
@ -427,19 +432,36 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Log.trace("ComboTimeDimensionType created");
|
|
||||||
|
|
||||||
addHandlersForComboTimeDimensionType(propsTimeDimensionType.label());
|
Log.trace("ComboPeriodType created");
|
||||||
|
|
||||||
comboTimeDimensionType.setEmptyText("Select a time dimension type...");
|
addHandlersForComboPeriodType(propsPeriodDataType.label());
|
||||||
comboTimeDimensionType.setWidth(191);
|
|
||||||
comboTimeDimensionType.setTypeAhead(true);
|
|
||||||
comboTimeDimensionType.setTriggerAction(TriggerAction.ALL);
|
|
||||||
// comboTimeDimensionType.getListView().getElement().applyStyles("width:170px;");
|
|
||||||
|
|
||||||
comboTimeDimensionTypeLabel = new FieldLabel(comboTimeDimensionType,
|
comboPeriodType.setEmptyText("Select a period type...");
|
||||||
"Time Type");
|
comboPeriodType.setWidth(191);
|
||||||
|
comboPeriodType.setTypeAhead(true);
|
||||||
|
comboPeriodType.setTriggerAction(TriggerAction.ALL);
|
||||||
|
comboPeriodTypeLabel = new FieldLabel(comboPeriodType, "Period Type");
|
||||||
|
|
||||||
|
// comboTimeDataFormat
|
||||||
|
TimeDataFormatProperties propsTimeDataFormat = GWT
|
||||||
|
.create(TimeDataFormatProperties.class);
|
||||||
|
storeComboTimeDataFormat = new ListStore<TimeDataFormat>(
|
||||||
|
propsTimeDataFormat.id());
|
||||||
|
|
||||||
|
comboTimeDataFormat = new ComboBox<TimeDataFormat>(
|
||||||
|
storeComboTimeDataFormat, 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,
|
||||||
|
"Time Format");
|
||||||
|
|
||||||
// Change
|
// Change
|
||||||
change = new TextButton("Change");
|
change = new TextButton("Change");
|
||||||
|
@ -475,7 +497,9 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
* v.add(comboColumnMappingLabel, new VerticalLayoutData(1, -1, new
|
* v.add(comboColumnMappingLabel, new VerticalLayoutData(1, -1, new
|
||||||
* Margins(1)));
|
* Margins(1)));
|
||||||
*/
|
*/
|
||||||
v.add(comboTimeDimensionTypeLabel, new VerticalLayoutData(1, -1,
|
v.add(comboPeriodTypeLabel, new VerticalLayoutData(1, -1,
|
||||||
|
new Margins(1)));
|
||||||
|
v.add(comboTimeDataFormatLabel, new VerticalLayoutData(1, -1,
|
||||||
new Margins(1)));
|
new Margins(1)));
|
||||||
v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
||||||
add(v, new VerticalLayoutData(1, 1, new Margins(0)));
|
add(v, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||||
|
@ -491,7 +515,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboDimensionTypeLabel.setVisible(false);
|
comboDimensionTypeLabel.setVisible(false);
|
||||||
comboColumnReferenceTypeLabel.setVisible(false);
|
comboColumnReferenceTypeLabel.setVisible(false);
|
||||||
comboColumnMappingLabel.setVisible(false);
|
comboColumnMappingLabel.setVisible(false);
|
||||||
comboTimeDimensionTypeLabel.setVisible(false);
|
comboPeriodTypeLabel.setVisible(false);
|
||||||
|
comboTimeDataFormat.setValidateOnBlur(false);
|
||||||
comboLocaleTypeLabel.setVisible(false);
|
comboLocaleTypeLabel.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,20 +662,6 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
+ "!"));
|
+ "!"));
|
||||||
Log.debug("ComboColumnReferenceType selected: "
|
Log.debug("ComboColumnReferenceType selected: "
|
||||||
+ event.getSelectedItem());
|
+ event.getSelectedItem());
|
||||||
|
|
||||||
//Change column enables the Change Button
|
|
||||||
//ColumnData columnReference = event.getSelectedItem();
|
|
||||||
//updateConfBtnChange(columnReference);
|
|
||||||
|
|
||||||
|
|
||||||
// TODO Mapping fix
|
|
||||||
/*
|
|
||||||
* comboColumnMapping.reset();
|
|
||||||
* storeComboColumnMapping.clear();
|
|
||||||
* storeComboColumnMapping.commitChanges();
|
|
||||||
* comboColumnMappingLabel.setVisible(true);
|
|
||||||
* forceLayout();
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,30 +686,48 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addHandlersForComboTimeDimensionType(
|
protected void addHandlersForComboPeriodType(
|
||||||
final LabelProvider<PeriodDataType> labelProvider) {
|
final LabelProvider<PeriodDataType> labelProvider) {
|
||||||
comboTimeDimensionType
|
comboPeriodType
|
||||||
.addSelectionHandler(new SelectionHandler<PeriodDataType>() {
|
.addSelectionHandler(new SelectionHandler<PeriodDataType>() {
|
||||||
public void onSelection(
|
public void onSelection(SelectionEvent<PeriodDataType> event) {
|
||||||
SelectionEvent<PeriodDataType> event) {
|
|
||||||
Info.display(
|
Info.display(
|
||||||
"Time Dimension Type Selected",
|
"Period Type Selected",
|
||||||
"You selected "
|
"You selected "
|
||||||
+ (event.getSelectedItem() == null ? "nothing"
|
+ (event.getSelectedItem() == null ? "nothing"
|
||||||
: labelProvider.getLabel(event
|
: labelProvider.getLabel(event
|
||||||
.getSelectedItem())
|
.getSelectedItem())
|
||||||
+ "!"));
|
+ "!"));
|
||||||
Log.debug("ComboTimeDimensionType selected: "
|
Log.debug("ComboPeriodType selected: "
|
||||||
+ event.getSelectedItem());
|
+ event.getSelectedItem());
|
||||||
PeriodDataType timeDimensionType = event
|
PeriodDataType periodDataType = event.getSelectedItem();
|
||||||
.getSelectedItem();
|
updatePeriodType(periodDataType);
|
||||||
updateTimeDimensionType(timeDimensionType);
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addHandlersForComboTimeDataFormat(
|
||||||
|
final LabelProvider<TimeDataFormat> labelProvider) {
|
||||||
|
comboTimeDataFormat
|
||||||
|
.addSelectionHandler(new SelectionHandler<TimeDataFormat>() {
|
||||||
|
public void onSelection(SelectionEvent<TimeDataFormat> event) {
|
||||||
|
Info.display(
|
||||||
|
"Time Format Selected",
|
||||||
|
"You selected "
|
||||||
|
+ (event.getSelectedItem() == null ? "nothing"
|
||||||
|
: labelProvider.getLabel(event
|
||||||
|
.getSelectedItem())
|
||||||
|
+ "!"));
|
||||||
|
Log.debug("ComboTimeDataFormat selected: "
|
||||||
|
+ event.getSelectedItem());
|
||||||
|
TimeDataFormat timeDataFormat = event.getSelectedItem();
|
||||||
|
updateTimeDataFormat(timeDataFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
protected void updateColumnType(ColumnTypeCode type) {
|
protected void updateColumnType(ColumnTypeCode type) {
|
||||||
Log.debug("Update ColumnTypeCode: " + type);
|
Log.debug("Update ColumnTypeCode: " + type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -709,7 +738,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboDimensionTypeLabel.setVisible(false);
|
comboDimensionTypeLabel.setVisible(false);
|
||||||
comboColumnReferenceTypeLabel.setVisible(false);
|
comboColumnReferenceTypeLabel.setVisible(false);
|
||||||
comboColumnMappingLabel.setVisible(false);
|
comboColumnMappingLabel.setVisible(false);
|
||||||
comboTimeDimensionTypeLabel.setVisible(false);
|
comboPeriodTypeLabel.setVisible(false);
|
||||||
|
comboTimeDataFormatLabel.setVisible(false);
|
||||||
break;
|
break;
|
||||||
case ATTRIBUTE:
|
case ATTRIBUTE:
|
||||||
comboLocaleTypeLabel.setVisible(false);
|
comboLocaleTypeLabel.setVisible(false);
|
||||||
|
@ -718,7 +748,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboDimensionTypeLabel.setVisible(false);
|
comboDimensionTypeLabel.setVisible(false);
|
||||||
comboColumnReferenceTypeLabel.setVisible(false);
|
comboColumnReferenceTypeLabel.setVisible(false);
|
||||||
comboColumnMappingLabel.setVisible(false);
|
comboColumnMappingLabel.setVisible(false);
|
||||||
comboTimeDimensionTypeLabel.setVisible(false);
|
comboPeriodTypeLabel.setVisible(false);
|
||||||
|
comboTimeDataFormatLabel.setVisible(false);
|
||||||
break;
|
break;
|
||||||
case DIMENSION:
|
case DIMENSION:
|
||||||
comboLocaleTypeLabel.setVisible(false);
|
comboLocaleTypeLabel.setVisible(false);
|
||||||
|
@ -727,7 +758,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboDimensionTypeLabel.setVisible(true);
|
comboDimensionTypeLabel.setVisible(true);
|
||||||
comboColumnReferenceTypeLabel.setVisible(false);
|
comboColumnReferenceTypeLabel.setVisible(false);
|
||||||
comboColumnMappingLabel.setVisible(false);
|
comboColumnMappingLabel.setVisible(false);
|
||||||
comboTimeDimensionTypeLabel.setVisible(false);
|
comboPeriodTypeLabel.setVisible(false);
|
||||||
|
comboTimeDataFormatLabel.setVisible(false);
|
||||||
break;
|
break;
|
||||||
case MEASURE:
|
case MEASURE:
|
||||||
comboLocaleTypeLabel.setVisible(false);
|
comboLocaleTypeLabel.setVisible(false);
|
||||||
|
@ -736,7 +768,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboDimensionTypeLabel.setVisible(false);
|
comboDimensionTypeLabel.setVisible(false);
|
||||||
comboColumnReferenceTypeLabel.setVisible(false);
|
comboColumnReferenceTypeLabel.setVisible(false);
|
||||||
comboColumnMappingLabel.setVisible(false);
|
comboColumnMappingLabel.setVisible(false);
|
||||||
comboTimeDimensionTypeLabel.setVisible(false);
|
comboPeriodTypeLabel.setVisible(false);
|
||||||
|
comboTimeDataFormatLabel.setVisible(false);
|
||||||
break;
|
break;
|
||||||
case TIMEDIMENSION:
|
case TIMEDIMENSION:
|
||||||
comboLocaleTypeLabel.setVisible(false);
|
comboLocaleTypeLabel.setVisible(false);
|
||||||
|
@ -745,7 +778,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboDimensionTypeLabel.setVisible(false);
|
comboDimensionTypeLabel.setVisible(false);
|
||||||
comboColumnReferenceTypeLabel.setVisible(false);
|
comboColumnReferenceTypeLabel.setVisible(false);
|
||||||
comboColumnMappingLabel.setVisible(false);
|
comboColumnMappingLabel.setVisible(false);
|
||||||
comboTimeDimensionTypeLabel.setVisible(true);
|
comboPeriodTypeLabel.setVisible(true);
|
||||||
|
comboTimeDataFormatLabel.setVisible(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
comboLocaleTypeLabel.setVisible(false);
|
comboLocaleTypeLabel.setVisible(false);
|
||||||
|
@ -754,7 +788,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboDimensionTypeLabel.setVisible(false);
|
comboDimensionTypeLabel.setVisible(false);
|
||||||
comboColumnReferenceTypeLabel.setVisible(false);
|
comboColumnReferenceTypeLabel.setVisible(false);
|
||||||
comboColumnMappingLabel.setVisible(false);
|
comboColumnMappingLabel.setVisible(false);
|
||||||
comboTimeDimensionTypeLabel.setVisible(false);
|
comboPeriodTypeLabel.setVisible(false);
|
||||||
|
comboTimeDataFormatLabel.setVisible(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,7 +812,18 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateTimeDimensionType(PeriodDataType type) {
|
protected void updatePeriodType(PeriodDataType periodDataType) {
|
||||||
|
ArrayList<TimeDataFormat> timeDataFormats = periodDataType
|
||||||
|
.getTimeDataFormats();
|
||||||
|
comboTimeDataFormat.clear();
|
||||||
|
comboTimeDataFormat.reset();
|
||||||
|
comboTimeDataFormat.getStore().clear();
|
||||||
|
comboTimeDataFormat.getStore().addAll(timeDataFormats);
|
||||||
|
comboTimeDataFormat.redraw();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void updateTimeDataFormat(TimeDataFormat type) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -879,11 +925,16 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (type == ColumnTypeCode.TIMEDIMENSION) {
|
if (type == ColumnTypeCode.TIMEDIMENSION) {
|
||||||
changeColumnTypeSession
|
changeColumnTypeSession.setPeriodDataType(cd
|
||||||
.setTimeDimensionType(cd
|
.getPeriodDataType());
|
||||||
.getPeriodDataType());
|
comboPeriodType.setValue(cd.getPeriodDataType());
|
||||||
comboTimeDimensionType.setValue(cd
|
ArrayList<TimeDataFormat> timeDataFormats = cd
|
||||||
.getPeriodDataType());
|
.getPeriodDataType().getTimeDataFormats();
|
||||||
|
comboTimeDataFormat.clear();
|
||||||
|
comboTimeDataFormat.reset();
|
||||||
|
comboTimeDataFormat.getStore().clear();
|
||||||
|
comboTimeDataFormat.getStore().addAll(timeDataFormats);
|
||||||
|
comboTimeDataFormat.redraw();
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
if (type == ColumnTypeCode.DIMENSION) {
|
if (type == ColumnTypeCode.DIMENSION) {
|
||||||
|
@ -1146,17 +1197,25 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
break;
|
break;
|
||||||
case TIMEDIMENSION:
|
case TIMEDIMENSION:
|
||||||
changeColumnTypeSession.setColumnTypeCodeTarget(type);
|
changeColumnTypeSession.setColumnTypeCodeTarget(type);
|
||||||
PeriodDataType periodDataType = comboTimeDimensionType
|
PeriodDataType periodDataType = comboPeriodType
|
||||||
.getCurrentValue();
|
.getCurrentValue();
|
||||||
if (periodDataType != null) {
|
if (periodDataType != null) {
|
||||||
|
changeColumnTypeSession
|
||||||
|
.setPeriodDataType(periodDataType);
|
||||||
|
TimeDataFormat timeDataFormat = comboTimeDataFormat
|
||||||
|
.getCurrentValue();
|
||||||
|
if (timeDataFormat != null) {
|
||||||
changeColumnTypeSession
|
changeColumnTypeSession
|
||||||
.setTimeDimensionType(periodDataType);
|
.setTimeDataFormat(timeDataFormat);
|
||||||
callChangeColumnType();
|
callChangeColumnType();
|
||||||
|
} else {
|
||||||
|
UtilsGXT3.alert("Attention",
|
||||||
|
"Time Format not selected!");
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
UtilsGXT3.alert("Attention",
|
UtilsGXT3.alert("Attention",
|
||||||
"Time Dimension type not selected!");
|
"Period Type not selected!");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1412,7 +1471,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void retrievePeriodDataType() {
|
protected void retrievePeriodDataType() {
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
.getPeriodDataTypes(new AsyncCallback<ArrayList<PeriodDataType>>() {
|
.getPeriodDataTypes(new AsyncCallback<ArrayList<PeriodDataType>>() {
|
||||||
|
@ -1434,26 +1493,26 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
Log.debug(caught.getLocalizedMessage());
|
Log.debug(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving period type",
|
UtilsGXT3.alert(
|
||||||
|
"Error retrieving period type",
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ArrayList<PeriodDataType> result) {
|
public void onSuccess(ArrayList<PeriodDataType> result) {
|
||||||
storeComboTimeDimensionType.clear();
|
storeComboPeriodType.clear();
|
||||||
storeComboTimeDimensionType.addAll(result);
|
storeComboPeriodType.addAll(result);
|
||||||
storeComboTimeDimensionType.commitChanges();
|
storeComboPeriodType.commitChanges();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void setLocale(String locale) {
|
protected void setLocale(String locale) {
|
||||||
for (LocaleTypeElement loc : storeComboLocaleType.getAll()) {
|
for (LocaleTypeElement loc : storeComboLocaleType.getAll()) {
|
||||||
if (loc.getLocaleName().compareTo(locale) == 0) {
|
if (loc.getLocaleName().compareTo(locale) == 0) {
|
||||||
|
@ -1525,7 +1584,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
public void operationComplete(OperationResult operationResult) {
|
public void operationComplete(OperationResult operationResult) {
|
||||||
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
||||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||||
ChangeTableRequestType.CHANGECOLUMNTYPE, operationResult.getTrId(), why);
|
ChangeTableRequestType.CHANGECOLUMNTYPE,
|
||||||
|
operationResult.getTrId(), why);
|
||||||
eventBus.fireEvent(changeTableRequestEvent);
|
eventBus.fireEvent(changeTableRequestEvent);
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
@ -1538,10 +1598,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationStopped(OperationResult operationResult, String reason, String details) {
|
public void operationStopped(OperationResult operationResult,
|
||||||
|
String reason, String details) {
|
||||||
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
|
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
|
||||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||||
ChangeTableRequestType.CHANGECOLUMNTYPE, operationResult.getTrId(), why);
|
ChangeTableRequestType.CHANGECOLUMNTYPE,
|
||||||
|
operationResult.getTrId(), why);
|
||||||
eventBus.fireEvent(changeTableRequestEvent);
|
eventBus.fireEvent(changeTableRequestEvent);
|
||||||
close();
|
close();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package org.gcube.portlets.user.td.columnwidget.client.properties;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TimeDataFormat;
|
||||||
|
|
||||||
|
import com.google.gwt.editor.client.Editor.Path;
|
||||||
|
import com.sencha.gxt.data.shared.LabelProvider;
|
||||||
|
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||||
|
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface TimeDataFormatProperties extends
|
||||||
|
PropertyAccess<TimeDataFormat> {
|
||||||
|
|
||||||
|
@Path("id")
|
||||||
|
ModelKeyProvider<TimeDataFormat> id();
|
||||||
|
|
||||||
|
LabelProvider<TimeDataFormat> example();
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue