Updated ReplaceColumn

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@113842 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-03-31 17:10:28 +00:00
parent 0143f32efa
commit 7cad8df81b
3 changed files with 11 additions and 8 deletions

View File

@ -410,7 +410,7 @@ public class ConditionWidget extends SimpleContainer {
comboOp.setTriggerAction(TriggerAction.ALL);
horiz.add(comboOp, new BoxLayoutData(new Margins(0)));
if (column==null|| column.getDataTypeName().compareTo("Date") != 0) {
if (column==null|| column.getDataTypeName()==null|| column.getDataTypeName().compareTo("Date") != 0) {
horiz.add(firstArg, new BoxLayoutData(new Margins(0)));
horiz.add(andText, new BoxLayoutData(new Margins(0)));
horiz.add(secondArg, new BoxLayoutData(new Margins(0)));

View File

@ -214,9 +214,11 @@ public class ReplaceColumnByExpressionDialog extends Window implements
ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
removableColumn.add(c);
} else {
if (c.getColumnId() != null
if (c.getColumnId() != null && column != null
&& column.getColumnId() != null
&& !column.getColumnId().isEmpty()
&& c.getColumnId().compareTo(column.getColumnId()) == 0) {
column=c;
column = c;
}
}
}

View File

@ -136,7 +136,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
}
protected void calcHeight() {
if (column != null
if (column != null && column.getDataTypeName()!=null && !column.getDataTypeName().isEmpty()
&& (column.getDataTypeName().compareTo(
ColumnDataType.Text.toString()) == 0
|| column.getDataTypeName().compareTo(
@ -307,7 +307,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
VerticalLayoutContainer replaceValueFieldSetLayout = new VerticalLayoutContainer();
replaceValueFieldSet.add(replaceValueFieldSetLayout);
if (column == null) {
if (column == null || column.getDataTypeName()==null ||column.getDataTypeName().isEmpty()) {
replaceValue = new TextField();
replaceValue.setToolTip("Replace Value");
replaceValue.setValue("");
@ -361,17 +361,18 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
}
protected void setSelectedColumn() {
if (column == null) {
if (column == null|| column.getTypeCode()==null) {
} else {
ColumnTypeCode typeCode = ColumnTypeCode
.getColumnTypeCodeFromId(column.getTypeCode());
HTML errorMessage;
if (typeCode == null) {
errorMessage = new HTML(
"This column has column data type null!");
"This column has column type code null!");
UtilsGXT3.alert("Error",
"This column has column data type null!!");
"This column has column type code null!!");
return;
}