X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FcomponentTypeEditor%2FDerivedPropertiesSection.java;fp=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FcomponentTypeEditor%2FDerivedPropertiesSection.java;h=19d9e6f29dc5c0f7e12b8e18844cb1d8999f6561;hp=1fa503515b4e840c8bd5c55a7b1ae8729fa2626b;hb=72d52b5910e1ed0141b6768ef700e7321ac05553;hpb=1624c696a48a2ca88c50545bcd57daf2ea51104c diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java index 1fa503515..19d9e6f29 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/DerivedPropertiesSection.java @@ -43,11 +43,11 @@ import org.simantics.structural.stubs.StructuralResource2; public class DerivedPropertiesSection implements ComponentTypeViewerSection { private static final String[] COLUMN_NAMES = - new String[] {"Name", "Type", "Expression", "Label", "Description"}; + new String[] {"Name", "Type", "Expression", "Unit", "Label", "Description"}; private static final int[] COLUMN_LENGTHS = - new int[] { 120, 100, 100, 100, 100 }; + new int[] { 120, 100, 100, 70, 100, 100 }; private static final int[] COLUMN_WEIGHTS = - new int[] { 0, 0, 100, 0, 0 }; + new int[] { 0, 0, 100, 0, 0, 0 }; private static Function4 VALIDATE_MONITOR_EXPRESSION = new Function4() { @Override @@ -155,11 +155,11 @@ public class DerivedPropertiesSection implements ComponentTypeViewerSection { }, VALIDATE_MONITOR_EXPRESSION); break; -// case 3: -// editUnit(table2, editor2, propertyInfo, selectedItem, column); -// break; - case 3: + data.editUnit(table, editor, propertyInfo, selectedItem, column); + break; + + case 4: data.editValue(table, editor, propertyInfo, selectedItem, column, propertyInfo.immutable ? null : new StringWriter() { @Override public void perform(WriteGraph graph, String newValue) throws DatabaseException { @@ -170,7 +170,7 @@ public class DerivedPropertiesSection implements ComponentTypeViewerSection { }, null); break; - case 4: + case 5: data.editMultilineText(table, editor, propertyInfo, selectedItem, selectedItemBounds, column, new StringWriter() { @Override public void perform(WriteGraph graph, String newValue) throws DatabaseException { @@ -330,9 +330,9 @@ public class DerivedPropertiesSection implements ComponentTypeViewerSection { item.setText(0, info.valid != null ? info.name + " (!)" : info.name); item.setText(1, info.type); item.setText(2, info.expression); - //item.setText(3, unitStr(info)); - item.setText(3, info.label); - item.setText(4, info.description); + item.setText(3, info.unitString()); + item.setText(4, info.label); + item.setText(5, info.description); item.setForeground(fg); @@ -376,4 +376,4 @@ public class DerivedPropertiesSection implements ComponentTypeViewerSection { return 100.0; } -} +} \ No newline at end of file