Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@113987 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2421a8f333
commit
b313965538
|
@ -3,27 +3,46 @@ package org.gcube.portlets.user.td.expressionwidget.client;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataPropertiesCombo;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataTypeProperties;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnTypeCodeProperties;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.properties.LocaleTypeProperties;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionResources;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.store.ColumnDataTypeElement;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.store.ColumnDataTypeStore;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.store.ColumnTypeCodeElement;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.store.ColumnTypeCodeStore;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.store.LocaleTypeElement;
|
||||
import org.gcube.portlets.user.td.expressionwidget.shared.exception.ConditionTypeMapException;
|
||||
import org.gcube.portlets.user.td.expressionwidget.shared.model.logical.C_Not;
|
||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.monitorwidget.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ExpressionWrapperEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.expression.C_ExpressionContainer;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.expression.ExpressionWrapper;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnMockUp;
|
||||
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;
|
||||
import com.google.gwt.core.client.Scheduler;
|
||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||
import com.google.gwt.event.logical.shared.SelectionHandler;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
import com.sencha.gxt.data.shared.ListStore;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
|
@ -39,6 +58,7 @@ import com.sencha.gxt.widget.core.client.form.ComboBox;
|
|||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||
import com.sencha.gxt.widget.core.client.info.Info;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -75,6 +95,17 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
private ComboBox<ColumnData> comboCols;
|
||||
private RuleDialog parentRuleDialog;
|
||||
|
||||
private TextField columnTag;
|
||||
private ComboBox<ColumnTypeCodeElement> comboColumnTypeCode;
|
||||
private ComboBox<ColumnDataTypeElement> comboMeasureType;
|
||||
private ComboBox<ColumnDataTypeElement> comboAttributeType;
|
||||
private ListStore<LocaleTypeElement> storeComboLocaleType;
|
||||
private ComboBox<LocaleTypeElement> comboLocaleType;
|
||||
private FieldLabel comboLocaleTypeLabel;
|
||||
private FieldLabel comboAttributeTypeLabel;
|
||||
private FieldLabel comboMeasureTypeLabel;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parentMultiColumnFilterTabPanel
|
||||
|
@ -96,7 +127,7 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
|
||||
createOnMultiColumnFilter();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parentFilterDialog
|
||||
|
@ -146,7 +177,8 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
* @param column
|
||||
* @param eventBus
|
||||
*/
|
||||
public ColumnExpressionPanel(ColumnExpressionDialog parentColumnExpressionDialog,
|
||||
public ColumnExpressionPanel(
|
||||
ColumnExpressionDialog parentColumnExpressionDialog,
|
||||
ColumnData column, EventBus eventBus) {
|
||||
super();
|
||||
setWidth(WIDTH);
|
||||
|
@ -160,15 +192,13 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
|
||||
createOnTemplate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parentRuleDialog
|
||||
* @param eventBus
|
||||
*/
|
||||
public ColumnExpressionPanel(RuleDialog parentRuleDialog,
|
||||
EventBus eventBus) {
|
||||
public ColumnExpressionPanel(RuleDialog parentRuleDialog, EventBus eventBus) {
|
||||
super();
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
|
@ -181,7 +211,7 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
|
||||
createOnRule();
|
||||
}
|
||||
|
||||
|
||||
protected void createOnRule() {
|
||||
// Important: fixed rendering of widgets
|
||||
forceLayoutOnResize = true;
|
||||
|
@ -254,26 +284,313 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
add(basicLayout);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//TODO
|
||||
private void createColumnMockUp(VerticalLayoutContainer propertiesLayout) {
|
||||
TextField columnType = new TextField();
|
||||
columnType.setToolTip("The type of column");
|
||||
columnType.setReadOnly(true);
|
||||
columnType.setValue(column.getTypeCode());
|
||||
propertiesLayout.add(new FieldLabel(columnType, "Column Type"),
|
||||
new VerticalLayoutData(1, -1));
|
||||
|
||||
TextField dataType = new TextField();
|
||||
dataType.setToolTip("The data type");
|
||||
dataType.setReadOnly(true);
|
||||
dataType.setValue(column.getDataTypeName());
|
||||
propertiesLayout.add(new FieldLabel(dataType, "Data Type"),
|
||||
new VerticalLayoutData(1, -1));
|
||||
// TODO
|
||||
private void createColumnMockUp(VerticalLayoutContainer propertiesLayout) {
|
||||
columnTag = new TextField();
|
||||
columnTag.setToolTip("Label");
|
||||
FieldLabel columnLabel=new FieldLabel(columnTag, "Column Label");
|
||||
|
||||
//combo TypeCode
|
||||
ColumnTypeCodeProperties propsColumnTypeCode = GWT
|
||||
.create(ColumnTypeCodeProperties.class);
|
||||
ListStore<ColumnTypeCodeElement> storeComboTypeCode = new ListStore<ColumnTypeCodeElement>(
|
||||
propsColumnTypeCode.id());
|
||||
storeComboTypeCode.addAll(ColumnTypeCodeStore
|
||||
.getColumnTypeCodesForRule());
|
||||
|
||||
comboColumnTypeCode = new ComboBox<ColumnTypeCodeElement>(
|
||||
storeComboTypeCode, propsColumnTypeCode.label());
|
||||
Log.trace("ComboColumnTypeCode created");
|
||||
|
||||
addHandlersForComboColumnTypeCode(propsColumnTypeCode.label());
|
||||
|
||||
comboColumnTypeCode.setEmptyText("Select a column type...");
|
||||
comboColumnTypeCode.setWidth(191);
|
||||
comboColumnTypeCode.setTypeAhead(true);
|
||||
comboColumnTypeCode.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
// comboMeasureType
|
||||
ColumnDataTypeProperties propsMeasureType = GWT
|
||||
.create(ColumnDataTypeProperties.class);
|
||||
ListStore<ColumnDataTypeElement> storeComboMeasureType = new ListStore<ColumnDataTypeElement>(
|
||||
propsMeasureType.id());
|
||||
storeComboMeasureType.addAll(ColumnDataTypeStore.getMeasureType());
|
||||
|
||||
comboMeasureType = new ComboBox<ColumnDataTypeElement>(
|
||||
storeComboMeasureType, propsMeasureType.label());
|
||||
Log.trace("ComboMeasureType created");
|
||||
|
||||
addHandlersForComboMeasureType(propsMeasureType.label());
|
||||
|
||||
comboMeasureType.setEmptyText("Select a measure type...");
|
||||
comboMeasureType.setWidth(191);
|
||||
comboMeasureType.setTypeAhead(true);
|
||||
comboMeasureType.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
comboMeasureTypeLabel = new FieldLabel(comboMeasureType, "Measure Type");
|
||||
|
||||
// comboAttributeType
|
||||
ColumnDataTypeProperties propsAttributeType = GWT
|
||||
.create(ColumnDataTypeProperties.class);
|
||||
ListStore<ColumnDataTypeElement> storeComboAttributeType = new ListStore<ColumnDataTypeElement>(
|
||||
propsAttributeType.id());
|
||||
storeComboAttributeType.addAll(ColumnDataTypeStore.getAttributeType());
|
||||
|
||||
comboAttributeType = new ComboBox<ColumnDataTypeElement>(
|
||||
storeComboAttributeType, propsAttributeType.label());
|
||||
Log.trace("ComboAttributeType created");
|
||||
|
||||
addHandlersForComboAttributeType(propsAttributeType.label());
|
||||
|
||||
comboAttributeType.setEmptyText("Select a column type...");
|
||||
comboAttributeType.setWidth(191);
|
||||
comboAttributeType.setTypeAhead(true);
|
||||
comboAttributeType.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
comboAttributeTypeLabel = new FieldLabel(comboAttributeType,
|
||||
"Attribute Type");
|
||||
|
||||
// comboLocaleType
|
||||
LocaleTypeProperties propsLocaleType = GWT
|
||||
.create(LocaleTypeProperties.class);
|
||||
storeComboLocaleType = new ListStore<LocaleTypeElement>(
|
||||
propsLocaleType.id());
|
||||
|
||||
comboLocaleType = new ComboBox<LocaleTypeElement>(storeComboLocaleType,
|
||||
propsLocaleType.label()) {
|
||||
|
||||
protected void onAfterFirstAttach() {
|
||||
super.onAfterFirstAttach();
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
public void execute() {
|
||||
retrieveLocales();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Log.trace("ComboLocaleType created");
|
||||
|
||||
addHandlersForComboLocaleType(propsLocaleType.label());
|
||||
|
||||
comboLocaleType.setEmptyText("Select a locale type...");
|
||||
comboLocaleType.setWidth(191);
|
||||
comboLocaleType.setTypeAhead(true);
|
||||
comboLocaleType.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
comboLocaleTypeLabel = new FieldLabel(comboLocaleType, "Locale");
|
||||
|
||||
|
||||
propertiesLayout.add(columnLabel,
|
||||
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
propertiesLayout.add(new FieldLabel(comboColumnTypeCode, "Column Type"),
|
||||
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
propertiesLayout.add(comboLocaleTypeLabel, new VerticalLayoutData(1, -1,
|
||||
new Margins(0)));
|
||||
propertiesLayout.add(comboMeasureTypeLabel, new VerticalLayoutData(1, -1, new Margins(
|
||||
0)));
|
||||
propertiesLayout.add(comboAttributeTypeLabel, new VerticalLayoutData(1, -1,
|
||||
new Margins(0)));
|
||||
|
||||
|
||||
comboMeasureTypeLabel.setVisible(false);
|
||||
comboAttributeTypeLabel.setVisible(false);
|
||||
comboLocaleTypeLabel.setVisible(false);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void addHandlersForComboColumnTypeCode(
|
||||
final LabelProvider<ColumnTypeCodeElement> labelProvider) {
|
||||
comboColumnTypeCode
|
||||
.addSelectionHandler(new SelectionHandler<ColumnTypeCodeElement>() {
|
||||
public void onSelection(
|
||||
SelectionEvent<ColumnTypeCodeElement> event) {
|
||||
Info.display(
|
||||
"Column Type Selected",
|
||||
"You selected "
|
||||
+ (event.getSelectedItem() == null ? "nothing"
|
||||
: labelProvider.getLabel(event
|
||||
.getSelectedItem())
|
||||
+ "!"));
|
||||
Log.debug("ComboColumnTypeCode selected: "
|
||||
+ event.getSelectedItem());
|
||||
ColumnTypeCodeElement columnType = event
|
||||
.getSelectedItem();
|
||||
updateColumnType(columnType.getCode());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
protected void addHandlersForComboMeasureType(
|
||||
final LabelProvider<ColumnDataTypeElement> labelProvider) {
|
||||
comboMeasureType
|
||||
.addSelectionHandler(new SelectionHandler<ColumnDataTypeElement>() {
|
||||
public void onSelection(
|
||||
SelectionEvent<ColumnDataTypeElement> event) {
|
||||
Info.display(
|
||||
"Measure Type Selected",
|
||||
"You selected "
|
||||
+ (event.getSelectedItem() == null ? "nothing"
|
||||
: labelProvider.getLabel(event
|
||||
.getSelectedItem())
|
||||
+ "!"));
|
||||
Log.debug("ComboMeasureType selected: "
|
||||
+ event.getSelectedItem());
|
||||
ColumnDataTypeElement measureType = event
|
||||
.getSelectedItem();
|
||||
updateMeasureType(measureType.getType());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
protected void addHandlersForComboAttributeType(
|
||||
final LabelProvider<ColumnDataTypeElement> labelProvider) {
|
||||
comboAttributeType
|
||||
.addSelectionHandler(new SelectionHandler<ColumnDataTypeElement>() {
|
||||
public void onSelection(
|
||||
SelectionEvent<ColumnDataTypeElement> event) {
|
||||
Info.display(
|
||||
"Attribute Type Selected",
|
||||
"You selected "
|
||||
+ (event.getSelectedItem() == null ? "nothing"
|
||||
: labelProvider.getLabel(event
|
||||
.getSelectedItem())
|
||||
+ "!"));
|
||||
Log.debug("ComboAttributeType selected: "
|
||||
+ event.getSelectedItem());
|
||||
ColumnDataTypeElement attributeType = event
|
||||
.getSelectedItem();
|
||||
updateAttributeType(attributeType.getType());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
protected void addHandlersForComboLocaleType(
|
||||
final LabelProvider<LocaleTypeElement> labelProvider) {
|
||||
comboLocaleType
|
||||
.addSelectionHandler(new SelectionHandler<LocaleTypeElement>() {
|
||||
public void onSelection(
|
||||
SelectionEvent<LocaleTypeElement> event) {
|
||||
Info.display(
|
||||
"Locale Type Selected",
|
||||
"You selected "
|
||||
+ (event.getSelectedItem() == null ? "nothing"
|
||||
: labelProvider.getLabel(event
|
||||
.getSelectedItem())
|
||||
+ "!"));
|
||||
Log.debug("ComboLocaleType selected: "
|
||||
+ event.getSelectedItem());
|
||||
LocaleTypeElement localeType = event.getSelectedItem();
|
||||
updateLocaleType(localeType);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
protected void updateColumnType(ColumnTypeCode type) {
|
||||
Log.debug("Update ColumnTypeCode " + type.toString());
|
||||
switch (type) {
|
||||
case CODENAME:
|
||||
comboLocaleTypeLabel.setVisible(true);
|
||||
comboMeasureTypeLabel.setVisible(false);
|
||||
comboAttributeTypeLabel.setVisible(false);
|
||||
break;
|
||||
case ATTRIBUTE:
|
||||
comboLocaleTypeLabel.setVisible(false);
|
||||
comboMeasureTypeLabel.setVisible(false);
|
||||
comboAttributeTypeLabel.setVisible(true);
|
||||
comboAttributeType.reset();
|
||||
break;
|
||||
case MEASURE:
|
||||
comboLocaleTypeLabel.setVisible(false);
|
||||
comboMeasureTypeLabel.setVisible(true);
|
||||
comboAttributeTypeLabel.setVisible(false);
|
||||
comboMeasureType.reset();
|
||||
break;
|
||||
default:
|
||||
comboLocaleTypeLabel.setVisible(false);
|
||||
comboMeasureTypeLabel.setVisible(false);
|
||||
comboAttributeTypeLabel.setVisible(false);
|
||||
break;
|
||||
}
|
||||
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
protected void updateMeasureType(ColumnDataType type) {
|
||||
Log.debug("Update ColumnTypeCode " + type);
|
||||
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
protected void updateAttributeType(ColumnDataType type) {
|
||||
Log.debug("Update ColumnTypeCode " + type);
|
||||
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
||||
protected void updateLocaleType(LocaleTypeElement type) {
|
||||
Log.debug("Update LocalType" + type);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void retrieveLocales() {
|
||||
TDGWTServiceAsync.INSTANCE
|
||||
.getLocales(new AsyncCallback<ArrayList<String>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
if (caught instanceof TDGWTIsLockedException) {
|
||||
Log.error(caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error Locked",
|
||||
caught.getLocalizedMessage());
|
||||
} else {
|
||||
if (caught instanceof TDGWTIsFinalException) {
|
||||
Log.error(caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error Final",
|
||||
caught.getLocalizedMessage());
|
||||
} else {
|
||||
Log.debug(caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving locales",
|
||||
caught.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ArrayList<String> result) {
|
||||
storeComboLocaleType.clear();
|
||||
ArrayList<LocaleTypeElement> locales = new ArrayList<LocaleTypeElement>();
|
||||
LocaleTypeElement locale;
|
||||
for (String local : result) {
|
||||
locale = new LocaleTypeElement(local);
|
||||
locales.add(locale);
|
||||
}
|
||||
storeComboLocaleType.addAll(locales);
|
||||
storeComboLocaleType.commitChanges();
|
||||
// comboColumnReferenceTypeLabel.setVisible(true);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void createOnTemplate() {
|
||||
// Important: fixed rendering of widgets
|
||||
forceLayoutOnResize = true;
|
||||
|
@ -700,11 +1017,11 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
C_ExpressionContainer condContainer=null;
|
||||
ExpressionWrapper exWrapper=null;
|
||||
ExpressionWrapperEvent expressionEvent=null;
|
||||
|
||||
|
||||
C_ExpressionContainer condContainer = null;
|
||||
ExpressionWrapper exWrapper = null;
|
||||
ExpressionWrapperEvent expressionEvent = null;
|
||||
|
||||
switch (type) {
|
||||
case Template:
|
||||
parentTemplateDialog.setExpression(exp);
|
||||
|
@ -713,10 +1030,9 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
condContainer.setExp(exp);
|
||||
condContainer.setReadableExpression(conditionWidget
|
||||
.getReadableExpression());
|
||||
exWrapper=new ExpressionWrapper(column.getTrId(),
|
||||
column,condContainer);
|
||||
expressionEvent = new ExpressionWrapperEvent(
|
||||
exWrapper);
|
||||
exWrapper = new ExpressionWrapper(column.getTrId(), column,
|
||||
condContainer);
|
||||
expressionEvent = new ExpressionWrapperEvent(exWrapper);
|
||||
Log.debug(expressionEvent.toString());
|
||||
parentTemplateDialog.hide();
|
||||
eventBus.fireEvent(expressionEvent);
|
||||
|
@ -724,9 +1040,9 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
case ColumnFilter:
|
||||
parentFilterDialog.applyFilter(column, exp);
|
||||
break;
|
||||
|
||||
|
||||
case Rule:
|
||||
ColumnMockUp columnMockUp=new ColumnMockUp();
|
||||
ColumnMockUp columnMockUp = new ColumnMockUp();
|
||||
column = new ColumnData();
|
||||
column.setColumnId(columnMockUp.getColumnId());
|
||||
column.setLabel(columnMockUp.getLabel());
|
||||
|
@ -737,13 +1053,14 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
condContainer.setExp(exp);
|
||||
condContainer.setReadableExpression(conditionWidget
|
||||
.getReadableExpression());
|
||||
exWrapper=new ExpressionWrapper(null,column,condContainer);
|
||||
exWrapper = new ExpressionWrapper(null, column, condContainer);
|
||||
parentRuleDialog.addRule(exWrapper);
|
||||
break;
|
||||
case RowDeleteByExpression:
|
||||
C_Expression notExp=new C_Not(exp);
|
||||
parentRowsDeleteByExpressionDialog.deleteRowsByExpression(column,notExp);
|
||||
|
||||
C_Expression notExp = new C_Not(exp);
|
||||
parentRowsDeleteByExpressionDialog.deleteRowsByExpression(column,
|
||||
notExp);
|
||||
|
||||
break;
|
||||
case MultiColumnFilter:
|
||||
parentMultiColumnFilterTabPanel.applyFilter(column, exp);
|
||||
|
@ -765,8 +1082,9 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
protected void close() {
|
||||
switch (type) {
|
||||
case Template:
|
||||
ExpressionWrapper exWrapper=new ExpressionWrapper();
|
||||
ExpressionWrapperEvent expressionEvent = new ExpressionWrapperEvent(exWrapper);
|
||||
ExpressionWrapper exWrapper = new ExpressionWrapper();
|
||||
ExpressionWrapperEvent expressionEvent = new ExpressionWrapperEvent(
|
||||
exWrapper);
|
||||
Log.debug(expressionEvent.toString());
|
||||
parentTemplateDialog.hide();
|
||||
eventBus.fireEvent(expressionEvent);
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.properties;
|
||||
|
||||
|
||||
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.store.ColumnDataTypeElement;
|
||||
|
||||
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 Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface ColumnDataTypeProperties extends
|
||||
PropertyAccess<ColumnDataTypeElement> {
|
||||
|
||||
@Path("id")
|
||||
ModelKeyProvider<ColumnDataTypeElement> id();
|
||||
|
||||
LabelProvider<ColumnDataTypeElement> label();
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.properties;
|
||||
|
||||
|
||||
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.store.ColumnTypeCodeElement;
|
||||
|
||||
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 Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface ColumnTypeCodeProperties extends
|
||||
PropertyAccess<ColumnTypeCodeElement> {
|
||||
|
||||
@Path("id")
|
||||
ModelKeyProvider<ColumnTypeCodeElement> id();
|
||||
|
||||
LabelProvider<ColumnTypeCodeElement> label();
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.properties;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.store.LocaleTypeElement;
|
||||
|
||||
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 Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface LocaleTypeProperties extends
|
||||
PropertyAccess<LocaleTypeElement> {
|
||||
|
||||
@Path("id")
|
||||
ModelKeyProvider<LocaleTypeElement> id();
|
||||
|
||||
LabelProvider<LocaleTypeElement> label();
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.properties;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||
|
||||
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 Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface TabResourceProperties extends
|
||||
PropertyAccess<TabResource> {
|
||||
|
||||
@Path("id")
|
||||
ModelKeyProvider<TabResource> id();
|
||||
|
||||
@Path("name")
|
||||
LabelProvider<TabResource> label();
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.store;
|
||||
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ColumnDataTypeElement {
|
||||
|
||||
protected int id; // For insert in table only
|
||||
protected ColumnDataType type;
|
||||
|
||||
|
||||
public ColumnDataTypeElement(int id,ColumnDataType type){
|
||||
this.id=id;
|
||||
this.type=type;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public ColumnDataType getType() {
|
||||
return type;
|
||||
}
|
||||
public void setCode(ColumnDataType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return type.toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ColumnDataTypeElement [id=" + id + ", type=" + type + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.store;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ColumnDataTypeStore implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1908324094430432681L;
|
||||
|
||||
protected static ArrayList<ColumnDataTypeElement> store;
|
||||
|
||||
protected static ColumnDataTypeElement integerElement=new ColumnDataTypeElement(1,ColumnDataType.Integer);
|
||||
protected static ColumnDataTypeElement numericElement=new ColumnDataTypeElement(2,ColumnDataType.Numeric);
|
||||
protected static ColumnDataTypeElement booleanElement=new ColumnDataTypeElement(3,ColumnDataType.Boolean);
|
||||
protected static ColumnDataTypeElement textElement=new ColumnDataTypeElement(4,ColumnDataType.Text);
|
||||
protected static ColumnDataTypeElement dateElement=new ColumnDataTypeElement(5,ColumnDataType.Date);
|
||||
protected static ColumnDataTypeElement geometryElement=new ColumnDataTypeElement(6,ColumnDataType.Geometry);
|
||||
|
||||
|
||||
public static ArrayList<ColumnDataTypeElement> getMeasureType(){
|
||||
store=new ArrayList<ColumnDataTypeElement>();
|
||||
store.add(integerElement);
|
||||
store.add(numericElement);
|
||||
return store;
|
||||
}
|
||||
|
||||
public static int selectedMeasurePosition(String selected){
|
||||
int position=0;
|
||||
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
|
||||
position=1;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
|
||||
position=2;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
|
||||
public static ColumnDataType selectedMeasure(String selected){
|
||||
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
|
||||
return ColumnDataType.Integer;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
|
||||
return ColumnDataType.Numeric;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ColumnDataTypeElement selectedMeasureElement(String selected){
|
||||
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
|
||||
return integerElement;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
|
||||
return numericElement;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static ArrayList<ColumnDataTypeElement> getAttributeType(){
|
||||
store=new ArrayList<ColumnDataTypeElement>();
|
||||
store.add(integerElement);
|
||||
store.add(numericElement);
|
||||
store.add(booleanElement);
|
||||
store.add(textElement);
|
||||
store.add(dateElement);
|
||||
store.add(geometryElement);
|
||||
return store;
|
||||
}
|
||||
|
||||
public static int selectedAttributePosition(String selected){
|
||||
int position=0;
|
||||
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
|
||||
position=1;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
|
||||
position=2;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Boolean.toString())==0){
|
||||
position=3;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Text.toString())==0){
|
||||
position=4;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Date.toString())==0){
|
||||
position=5;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Geometry.toString())==0){
|
||||
position=6;
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
public static ColumnDataType selectedAttribute(String selected){
|
||||
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
|
||||
return ColumnDataType.Integer;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
|
||||
return ColumnDataType.Numeric;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Boolean.toString())==0){
|
||||
return ColumnDataType.Boolean;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Text.toString())==0){
|
||||
return ColumnDataType.Text;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Date.toString())==0){
|
||||
return ColumnDataType.Date;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Geometry.toString())==0){
|
||||
return ColumnDataType.Geometry;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ColumnDataTypeElement selectedAttributeElement(String selected){
|
||||
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
|
||||
return integerElement;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
|
||||
return numericElement;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Boolean.toString())==0){
|
||||
return booleanElement;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Text.toString())==0){
|
||||
return textElement;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Date.toString())==0){
|
||||
return dateElement;
|
||||
} else {
|
||||
if(selected.compareTo(ColumnDataType.Geometry.toString())==0){
|
||||
return geometryElement;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.store;
|
||||
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ColumnTypeCodeElement {
|
||||
|
||||
protected int id; // For insert in table only
|
||||
protected ColumnTypeCode code;
|
||||
|
||||
|
||||
public ColumnTypeCodeElement(int id,ColumnTypeCode code){
|
||||
this.id=id;
|
||||
this.code=code;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public ColumnTypeCode getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(ColumnTypeCode code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return code.getColumnTypeCodeLabel();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ColumnTypeCodeElement [id=" + id + ", code=" + code + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,318 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.store;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ColumnTypeCodeStore implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1908324094430432681L;
|
||||
|
||||
protected static ColumnTypeCodeElement annotation = new ColumnTypeCodeElement(
|
||||
1, ColumnTypeCode.ANNOTATION);
|
||||
protected static ColumnTypeCodeElement attribute = new ColumnTypeCodeElement(
|
||||
2, ColumnTypeCode.ATTRIBUTE);
|
||||
protected static ColumnTypeCodeElement measure = new ColumnTypeCodeElement(
|
||||
3, ColumnTypeCode.MEASURE);
|
||||
protected static ColumnTypeCodeElement code = new ColumnTypeCodeElement(4,
|
||||
ColumnTypeCode.CODE);
|
||||
protected static ColumnTypeCodeElement codeName = new ColumnTypeCodeElement(
|
||||
5, ColumnTypeCode.CODENAME);
|
||||
protected static ColumnTypeCodeElement codeDescription = new ColumnTypeCodeElement(
|
||||
6, ColumnTypeCode.CODEDESCRIPTION);
|
||||
protected static ColumnTypeCodeElement dimension = new ColumnTypeCodeElement(
|
||||
7, ColumnTypeCode.DIMENSION);
|
||||
protected static ColumnTypeCodeElement timeDimension = new ColumnTypeCodeElement(
|
||||
8, ColumnTypeCode.TIMEDIMENSION);
|
||||
|
||||
protected static ArrayList<ColumnTypeCodeElement> store;
|
||||
|
||||
public static ArrayList<ColumnTypeCodeElement> getColumnTypeCodes(TRId trId) {
|
||||
store = new ArrayList<ColumnTypeCodeElement>();
|
||||
if (trId == null || trId.getTableTypeName() == null) {
|
||||
Log.debug("Attention no valid table type, trId:" + trId);
|
||||
store.add(annotation);
|
||||
return store;
|
||||
}
|
||||
|
||||
if (trId.getTableTypeName().compareTo("Generic") == 0) {
|
||||
store.add(annotation);
|
||||
store.add(attribute);
|
||||
store.add(measure);
|
||||
store.add(code);
|
||||
store.add(codeName);
|
||||
store.add(codeDescription);
|
||||
store.add(dimension);
|
||||
store.add(timeDimension);
|
||||
} else {
|
||||
if (trId.getTableTypeName().compareTo("Codelist") == 0) {
|
||||
store.add(annotation);
|
||||
store.add(code);
|
||||
store.add(codeName);
|
||||
store.add(codeDescription);
|
||||
} else {
|
||||
if (trId.getTableTypeName().compareTo("Dataset") == 0) {
|
||||
store.add(attribute);
|
||||
store.add(measure);
|
||||
store.add(dimension);
|
||||
store.add(timeDimension);
|
||||
} else {
|
||||
store.add(annotation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
public static ArrayList<ColumnTypeCodeElement> getColumnTypeCodesForAddColumn(
|
||||
TRId trId) {
|
||||
store = new ArrayList<ColumnTypeCodeElement>();
|
||||
if (trId == null || trId.getTableTypeName() == null) {
|
||||
Log.debug("Attention no valid table type, trId:" + trId);
|
||||
store.add(annotation);
|
||||
return store;
|
||||
}
|
||||
|
||||
if (trId.getTableTypeName().compareTo("Generic") == 0) {
|
||||
store.add(annotation);
|
||||
store.add(attribute);
|
||||
store.add(measure);
|
||||
store.add(code);
|
||||
store.add(codeName);
|
||||
store.add(codeDescription);
|
||||
} else {
|
||||
if (trId.getTableTypeName().compareTo("Codelist") == 0) {
|
||||
store.add(annotation);
|
||||
store.add(code);
|
||||
store.add(codeName);
|
||||
store.add(codeDescription);
|
||||
} else {
|
||||
if (trId.getTableTypeName().compareTo("Dataset") == 0) {
|
||||
store.add(attribute);
|
||||
store.add(measure);
|
||||
} else {
|
||||
store.add(annotation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
public static ArrayList<ColumnTypeCodeElement> getColumnTypeCodesForRule() {
|
||||
store = new ArrayList<ColumnTypeCodeElement>();
|
||||
|
||||
store.add(annotation);
|
||||
store.add(attribute);
|
||||
store.add(measure);
|
||||
store.add(code);
|
||||
store.add(codeName);
|
||||
store.add(codeDescription);
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static ArrayList<ColumnTypeCodeElement> getColumnTypeCodesForGeneric() {
|
||||
store = new ArrayList<ColumnTypeCodeElement>();
|
||||
store.add(annotation);
|
||||
store.add(attribute);
|
||||
store.add(measure);
|
||||
store.add(code);
|
||||
store.add(codeName);
|
||||
store.add(codeDescription);
|
||||
store.add(dimension);
|
||||
store.add(timeDimension);
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
public static ArrayList<ColumnTypeCodeElement> getColumnTypeCodesForCodelist() {
|
||||
store = new ArrayList<ColumnTypeCodeElement>();
|
||||
store.add(annotation);
|
||||
store.add(code);
|
||||
store.add(codeName);
|
||||
store.add(codeDescription);
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
public static ArrayList<ColumnTypeCodeElement> getColumnTypeCodesForDataset() {
|
||||
store = new ArrayList<ColumnTypeCodeElement>();
|
||||
store.add(attribute);
|
||||
store.add(measure);
|
||||
store.add(dimension);
|
||||
store.add(timeDimension);
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
public static int selectedPosition(String selected) {
|
||||
int position = 0;
|
||||
if (selected.compareTo(ColumnTypeCode.ANNOTATION.toString()) == 0) {
|
||||
position = 1;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.ATTRIBUTE.toString()) == 0) {
|
||||
position = 2;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.MEASURE.toString()) == 0) {
|
||||
position = 3;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.CODE.toString()) == 0) {
|
||||
position = 4;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.CODENAME
|
||||
.toString()) == 0) {
|
||||
position = 5;
|
||||
} else {
|
||||
if (selected
|
||||
.compareTo(ColumnTypeCode.CODEDESCRIPTION
|
||||
.toString()) == 0) {
|
||||
position = 6;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.DIMENSION
|
||||
.toString()) == 0) {
|
||||
position = 7;
|
||||
} else {
|
||||
if (selected
|
||||
.compareTo(ColumnTypeCode.TIMEDIMENSION
|
||||
.toString()) == 0) {
|
||||
position = 8;
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
public static ColumnTypeCode selected(String selected) {
|
||||
Log.debug("ColumnTypeCodeStore Selected:" + selected);
|
||||
if (selected.compareTo(ColumnTypeCode.ANNOTATION.toString()) == 0) {
|
||||
return ColumnTypeCode.ANNOTATION;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.ATTRIBUTE.toString()) == 0) {
|
||||
return ColumnTypeCode.ATTRIBUTE;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.MEASURE.toString()) == 0) {
|
||||
return ColumnTypeCode.MEASURE;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.CODE.toString()) == 0) {
|
||||
return ColumnTypeCode.CODE;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.CODENAME
|
||||
.toString()) == 0) {
|
||||
return ColumnTypeCode.CODENAME;
|
||||
} else {
|
||||
if (selected
|
||||
.compareTo(ColumnTypeCode.CODEDESCRIPTION
|
||||
.toString()) == 0) {
|
||||
return ColumnTypeCode.CODEDESCRIPTION;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.DIMENSION
|
||||
.toString()) == 0) {
|
||||
return ColumnTypeCode.DIMENSION;
|
||||
} else {
|
||||
if (selected
|
||||
.compareTo(ColumnTypeCode.TIMEDIMENSION
|
||||
.toString()) == 0) {
|
||||
return ColumnTypeCode.TIMEDIMENSION;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static ColumnTypeCodeElement selectedElement(String selected) {
|
||||
if (selected.compareTo(ColumnTypeCode.ANNOTATION.toString()) == 0) {
|
||||
return annotation;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.ATTRIBUTE.toString()) == 0) {
|
||||
return attribute;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.MEASURE.toString()) == 0) {
|
||||
return measure;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.CODE.toString()) == 0) {
|
||||
return code;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.CODENAME
|
||||
.toString()) == 0) {
|
||||
return codeName;
|
||||
} else {
|
||||
if (selected
|
||||
.compareTo(ColumnTypeCode.CODEDESCRIPTION
|
||||
.toString()) == 0) {
|
||||
return codeDescription;
|
||||
} else {
|
||||
if (selected.compareTo(ColumnTypeCode.DIMENSION
|
||||
.toString()) == 0) {
|
||||
return dimension;
|
||||
} else {
|
||||
if (selected
|
||||
.compareTo(ColumnTypeCode.TIMEDIMENSION
|
||||
.toString()) == 0) {
|
||||
return timeDimension;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.store;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class LocaleTypeElement implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected String localeName;
|
||||
|
||||
public LocaleTypeElement() {
|
||||
}
|
||||
|
||||
public LocaleTypeElement(String localeName){
|
||||
this.localeName=localeName;
|
||||
}
|
||||
|
||||
|
||||
public String getLocaleName() {
|
||||
return localeName;
|
||||
}
|
||||
|
||||
public void setLocaleName(String localeName) {
|
||||
this.localeName = localeName;
|
||||
}
|
||||
|
||||
public String id(){
|
||||
return localeName;
|
||||
}
|
||||
|
||||
public String label(){
|
||||
return localeName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LocaleTypeElement [localeName=" + localeName + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue