]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fix change of type in component property editor when range is present 54/2854/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Tue, 16 Apr 2019 13:54:50 +0000 (16:54 +0300)
committerReino Ruusu <reino.ruusu@semantum.fi>
Tue, 16 Apr 2019 13:54:50 +0000 (16:54 +0300)
gitlab #285

Change-Id: Idee2893d334ea093147678c0cb4579bf9aaadc2c

bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeViewerData.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ConfigurationPropertiesSection.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java

index 1c4b22ee0762cbc2f6f2a2b248d4b7d53e4ce895..ea10d6d8d4e44d700cf6cc789b97ca49ed9e6e6c 100644 (file)
@@ -216,7 +216,7 @@ public class ComponentTypeViewerData {
         editor.setEditor(text, selectedItem, column);
     }
 
-    public void editType(Table table, TableEditor editor, final ComponentTypeViewerPropertyInfo propertyInfo, TableItem selectedItem, int column, final boolean convertDefaultValue) {
+    public void editType(Table table, TableEditor editor, final ComponentTypeViewerPropertyInfo propertyInfo, TableItem selectedItem, int column, String range, final boolean convertDefaultValue) {
         int extraStyle = propertyInfo.immutable ? SWT.READ_ONLY : 0;
         final Combo combo = new Combo(table, SWT.NONE | extraStyle);
         combo.setText(selectedItem.getText(column));
@@ -252,6 +252,7 @@ public class ComponentTypeViewerData {
                             throws DatabaseException {
                         graph.markUndoPoint();
                         ComponentTypeCommands.editType(graph, componentType, propertyInfo.resource, convertDefaultValue, newValue);
+                        if (range != null) ComponentTypeCommands.setRange(graph, componentType, propertyInfo.resource, range);
                     }
                 });
             }
index 34d26e4915e387ca0d04266be246ede57d1081cd..c11463f1321848cdbd9c69c28da204209ad3700d 100644 (file)
@@ -183,7 +183,7 @@ public class ConfigurationPropertiesSection implements ComponentTypeViewerSectio
                     break;
 
                 case 1:
-                    data.editType(table, editor, propertyInfo, selectedItem, column, true);
+                    data.editType(table, editor, propertyInfo, selectedItem, column, selectedItem.getText(4), true);
                     break;
 
                 case 2: {
index 5f96c2ba9bbfba35461807f0b26958fdec709b49..1abe8434897ee8bc3071ff528baf45b41e76bbee 100644 (file)
@@ -162,7 +162,7 @@ public class DerivedPropertiesSection implements ComponentTypeViewerSection {
                     break;
 
                 case 1:
-                    data.editType(table, editor, propertyInfo, selectedItem, column, false);
+                    data.editType(table, editor, propertyInfo, selectedItem, column, null, false);
                     break;
 
                 case 2: