diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceArithmeticWidget.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceArithmeticWidget.java index 781484c..d97c03d 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceArithmeticWidget.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceArithmeticWidget.java @@ -73,7 +73,7 @@ public class ReplaceArithmeticWidget extends SimpleContainer { private VerticalLayoutContainer vert; private String readableExpression; - private String itemIdComboArithmetic; + private String itemIdComboOperation; private String itemIdComboLeaf; private String itemIdComboColumns; private String itemIdFirstArg; @@ -213,7 +213,7 @@ public class ReplaceArithmeticWidget extends SimpleContainer { } protected void setup() { - itemIdComboArithmetic = "ComboArithmetic" + trId.getId(); + itemIdComboOperation = "ComboOperation" + trId.getId(); itemIdComboLeaf = "ComboLeaf" + trId.getId(); itemIdComboColumns = "ComboColumns" + trId.getId(); itemIdFirstArg = "FirstArg" + trId.getId(); @@ -403,6 +403,7 @@ public class ReplaceArithmeticWidget extends SimpleContainer { firstArg.setEmptyText(""); secondArg.setVisible(false); secondArg.setEmptyText(""); + removeOperator(source); break; case Addition: case Subtraction: @@ -480,7 +481,7 @@ public class ReplaceArithmeticWidget extends SimpleContainer { comboReplaceArithmeticElementsOperators.setEmptyText("Select..."); comboReplaceArithmeticElementsOperators - .setItemId(itemIdComboArithmetic); + .setItemId(itemIdComboOperation); comboReplaceArithmeticElementsOperators.setWidth(COMBO_WIDTH); comboReplaceArithmeticElementsOperators.setEditable(false); comboReplaceArithmeticElementsOperators @@ -689,6 +690,7 @@ public class ReplaceArithmeticWidget extends SimpleContainer { firstArg.setEmptyText(""); secondArg.setVisible(false); secondArg.setEmptyText(""); + removeOperator(source); break; case Addition: case Subtraction: @@ -766,7 +768,7 @@ public class ReplaceArithmeticWidget extends SimpleContainer { }); comboReplaceArithmeticElementsOperator.setEmptyText("Select..."); - comboReplaceArithmeticElementsOperator.setItemId(itemIdComboArithmetic); + comboReplaceArithmeticElementsOperator.setItemId(itemIdComboOperation); comboReplaceArithmeticElementsOperator.setWidth(COMBO_WIDTH); comboReplaceArithmeticElementsOperator.setEditable(false); comboReplaceArithmeticElementsOperator @@ -861,7 +863,7 @@ public class ReplaceArithmeticWidget extends SimpleContainer { horiz = (HBoxLayoutContainer) vert.getWidget(index); @SuppressWarnings("unchecked") ComboBox comboOperator = (ComboBox) horiz - .getItemByItemId(itemIdComboArithmetic); + .getItemByItemId(itemIdComboOperation); Log.debug("combo Operator: " + comboOperator.getCurrentValue()); @SuppressWarnings("unchecked") ComboBox comboLeaf = (ComboBox) horiz diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceWidget.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceWidget.java index 51b1550..eedef1e 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceWidget.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceWidget.java @@ -381,6 +381,7 @@ public class ReplaceWidget extends SimpleContainer { firstArg.setEmptyText(""); secondArg.setVisible(false); secondArg.setEmptyText(""); + removeConcat(source); break; case Concat: if (!existConcat(source)) { @@ -642,6 +643,7 @@ public class ReplaceWidget extends SimpleContainer { firstArg.setEmptyText(""); secondArg.setVisible(false); secondArg.setEmptyText(""); + removeConcat(source); break; case Concat: if (!existConcat(source)) { diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/replace/ReplaceArithmeticType.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/replace/ReplaceArithmeticType.java index 32fe618..654ba54 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/replace/ReplaceArithmeticType.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/replace/ReplaceArithmeticType.java @@ -14,10 +14,10 @@ public enum ReplaceArithmeticType { SubstringByCharSeq("Substring by Char Seq."), TextReplaceMatchingRegex("Replace Matching Regex"), Addition("Addition"), - Subtraction("Substring by Index"), - Modulus("Substring by Char Seq."), - Multiplication("Replace Matching Regex"), - Division("Replace Matching Regex"); + Subtraction("Subtraction"), + Modulus("Modulus"), + Multiplication("Multiplication"), + Division("Division"); /** * @param text