]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@16205 ac1ea38d-2e2b...
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 18 Jun 2010 06:32:59 +0000 (06:32 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 18 Jun 2010 06:32:59 +0000 (06:32 +0000)
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/VariableInformationTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypeWidget.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ShortcutTabWidget.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/TextWidget.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/UnitWidget.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/VariableNameWidget.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/DoublePropertyFactory.java

index f5d6359d1cf5eccfdd645fb937b1ca23e83cd68c..0c41c928976e99120a3008ce2fa45d34bdf2f2c3 100644 (file)
@@ -35,7 +35,7 @@ public class ConfigurationTab extends PropertyTabContributorImpl {
         label.setText("Name");\r
         \r
         name = new TextWidget(composite, support, SWT.BORDER);\r
-        name.setTextFactory(new StringPropertyFactory(context, Builtins.URIs.HasName));\r
+        name.setTextFactory(new StringPropertyFactory(Builtins.URIs.HasName));\r
         name.addFocusListener(new SaveListener());\r
         name.addVerifyListener(new VerifyListener() {\r
 \r
@@ -54,7 +54,7 @@ public class ConfigurationTab extends PropertyTabContributorImpl {
         label.setText("Start time");\r
 \r
         startTime = new TextWidget(composite, support, SWT.BORDER | SWT.RIGHT);\r
-        startTime.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasStartTime));\r
+        startTime.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasStartTime));\r
         startTime.addVerifyListener(new DoubleVerify());\r
         startTime.addFocusListener(new SaveListener());\r
         GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(startTime.getTextWidget());\r
@@ -63,7 +63,7 @@ public class ConfigurationTab extends PropertyTabContributorImpl {
         label.setText("Stop time");\r
 \r
         stopTime = new TextWidget(composite, support, SWT.BORDER | SWT.RIGHT);\r
-        stopTime.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasStopTime));\r
+        stopTime.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasStopTime));\r
         stopTime.addVerifyListener(new DoubleVerify());\r
         stopTime.addFocusListener(new SaveListener());\r
         GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(stopTime.getTextWidget());\r
index b581a06ac1c63a93bf42f65c2852a368681a9c6f..378ad63e17db338ed90a8ff96c149bc254fbdd82 100644 (file)
@@ -43,7 +43,7 @@ public class EquationTab extends PropertyTabContributorImpl {
         GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);\r
         GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(6).applyTo(composite);\r
         nameWidget = new VariableNameWidget(composite, support, SWT.BORDER);\r
-        nameWidget.setTextFactory(new StringPropertyFactory(context, Builtins.URIs.HasName));\r
+        nameWidget.setTextFactory(new StringPropertyFactory(Builtins.URIs.HasName));\r
 \r
 \r
         Label label = new Label(composite, SWT.SINGLE );\r
@@ -58,7 +58,7 @@ public class EquationTab extends PropertyTabContributorImpl {
         GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(label);\r
 \r
         unitWidget = new UnitWidget(composite, support, SWT.DROP_DOWN | SWT.BORDER);\r
-        unitWidget.setTextFactory(new StringPropertyFactory(context, SysdynResource.URIs.HasUnit));\r
+        unitWidget.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.HasUnit));\r
 \r
         shortcutTabWidget = new ShortcutTabWidget(composite, support, SWT.NONE);\r
 \r
index 8bef2975ce800319408a8c9fca92f49226a870b6..3175a7d977da5f1161e1e0401c552499000b3f70 100644 (file)
@@ -37,7 +37,7 @@ public class VariableInformationTab extends PropertyTabContributorImpl {
         GridLayoutFactory.fillDefaults().margins(3, 3).applyTo(informationGroup);\r
         \r
         information = new TextWidget(informationGroup, support, SWT.MULTI | SWT.BORDER);\r
-        information.setTextFactory(new StringPropertyFactory(context, Builtins.URIs.HasDescription));\r
+        information.setTextFactory(new StringPropertyFactory(Builtins.URIs.HasDescription));\r
         information.addFocusListener(new SaveListener());\r
         GridDataFactory.fillDefaults().grab(true, true).applyTo(information.getTextWidget());\r
         \r
@@ -51,7 +51,7 @@ public class VariableInformationTab extends PropertyTabContributorImpl {
         label.setText("Start");\r
         \r
         rangeStart = new TextWidget(rangeGroup, support, SWT.BORDER | SWT.RIGHT);\r
-        rangeStart.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasRangeStart));\r
+        rangeStart.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasRangeStart));\r
         rangeStart.addFocusListener(new SaveListener());\r
         rangeStart.addVerifyListener(new DoubleVerify());\r
 \r
@@ -59,7 +59,7 @@ public class VariableInformationTab extends PropertyTabContributorImpl {
         label.setText("End");\r
         \r
         rangeEnd = new TextWidget(rangeGroup, support, SWT.BORDER | SWT.RIGHT);\r
-        rangeEnd.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasRangeEnd));\r
+        rangeEnd.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasRangeEnd));\r
         rangeEnd.addFocusListener(new SaveListener());\r
         rangeEnd.addVerifyListener(new DoubleVerify());\r
 \r
@@ -67,7 +67,7 @@ public class VariableInformationTab extends PropertyTabContributorImpl {
         label.setText("Step");\r
         \r
         rangeStep = new TextWidget(rangeGroup, support, SWT.BORDER | SWT.RIGHT);\r
-        rangeStep.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasRangeStep));\r
+        rangeStep.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasRangeStep));\r
         rangeStep.addFocusListener(new SaveListener());\r
         rangeStep.addVerifyListener(new DoubleVerify());\r
         \r
index 1fae3e03aa749389042b795652ac4158c8736afc..0b4d9808f08bfbd54a23952d5eef4bf8b297f88f 100644 (file)
@@ -14,6 +14,7 @@ import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;\r
 import org.simantics.db.common.request.ReadRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.management.ISessionContext;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.ui.properties.widgets.ExpressionTypes.ExpressionType;\r
 import org.simantics.ui.SimanticsUI;\r
@@ -38,7 +39,7 @@ public class ExpressionTypeWidget implements Widget {
     }\r
 \r
     @Override\r
-    public void setInput(Object input) {\r
+    public void setInput(ISessionContext context, Object input) {\r
         if(input instanceof IStructuredSelection) {\r
             final Resource variable = ISelectionUtils.filterSingleSelection((IStructuredSelection)input, Resource.class);\r
             if(variable != null) {\r
index 46307bbb6d5e95ef23f88fd8504d2f878599caa3..6ed0546e3ae31662cc46e741af793f23edbb1231 100644 (file)
@@ -16,6 +16,7 @@ import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.management.ISessionContext;\r
 import org.simantics.db.request.Read;\r
 import org.simantics.sysdyn.ui.properties.widgets.ExpressionTypes.ExpressionType;\r
 import org.simantics.sysdyn.ui.properties.widgets.expressions.AuxiliaryExpression;\r
@@ -49,7 +50,7 @@ public class ExpressionWidget implements Widget {
     }\r
 \r
     @Override\r
-    public void setInput(Object input) {\r
+    public void setInput(ISessionContext context, Object input) {\r
         if(input instanceof ISelection) {\r
             ISelection selection = (ISelection)input;\r
             if(selection instanceof IStructuredSelection) {\r
index a8cd943d179be8528d6b344abc6133d1710a735c..b43486c5eb62850852df518ae244c793c6af3fea 100644 (file)
@@ -20,6 +20,7 @@ import org.simantics.db.Builtins;
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.management.ISessionContext;\r
 import org.simantics.db.request.Read;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.ui.SimanticsUI;\r
@@ -69,7 +70,7 @@ public class ShortcutTabWidget implements Widget {
     }\r
 \r
     @Override\r
-    public void setInput(Object input) {\r
+    public void setInput(ISessionContext context, Object input) {\r
         if(input instanceof IStructuredSelection) {\r
             final Resource variable = ISelectionUtils.filterSingleSelection((IStructuredSelection)input, Resource.class);\r
             if(variable != null) {\r
index bf72c8278e0046d42979b510157d7c4d5e1e6db2..4fb581019393bfd9769650c6fac207fa81da437b 100644 (file)
@@ -17,6 +17,7 @@ import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;\r
 import org.simantics.db.common.request.WriteRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.management.ISessionContext;\r
 import org.simantics.db.procedure.Listener;\r
 import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyFactory;\r
 import org.simantics.ui.SimanticsUI;\r
@@ -55,12 +56,12 @@ public class TextWidget implements Widget {
     }\r
 \r
     @Override\r
-    public void setInput(Object input) {\r
+    public void setInput(ISessionContext context, Object input) {\r
         if(input instanceof ISelection)\r
             resource = ISelectionUtils.filterSingleSelection((ISelection)input, Resource.class);\r
 \r
         if(readFactory != null) {\r
-            readFactory.listen(input, new Listener<String>() {\r
+            readFactory.listen(context, input, new Listener<String>() {\r
 \r
                 @Override\r
                 public void exception(Throwable t) {\r
index a6ca29fae998483844afcef0cb922e9c80b36caa..fae7df9907ec82afdaf44025364edaeaff008a60 100644 (file)
@@ -24,6 +24,7 @@ import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;\r
 import org.simantics.db.common.request.WriteRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.management.ISessionContext;\r
 import org.simantics.db.procedure.Listener;\r
 import org.simantics.db.request.Read;\r
 import org.simantics.sysdyn.SysdynResource;\r
@@ -78,11 +79,11 @@ public class UnitWidget implements Widget {
     }\r
 \r
     @Override\r
-    public void setInput(final Object input) {\r
+    public void setInput(ISessionContext context, final Object input) {\r
         if(input instanceof ISelection)\r
             variable = ISelectionUtils.filterSingleSelection((ISelection)input, Resource.class);\r
         if(textFactory != null) {\r
-            textFactory.listen(input, new Listener<String>() {\r
+            textFactory.listen(context, input, new Listener<String>() {\r
 \r
                 @Override\r
                 public void exception(Throwable t) {\r
index ab10229e708a069bb6bc43e070d833703b905126..46897945858d68e2fd3e175719faa20c1dfc35bc 100644 (file)
@@ -25,6 +25,7 @@ import org.simantics.db.WriteGraph;
 import org.simantics.db.common.request.ReadRequest;\r
 import org.simantics.db.common.request.WriteRequest;\r
 import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.management.ISessionContext;\r
 import org.simantics.db.procedure.Listener;\r
 import org.simantics.sysdyn.manager.SysdynModel;\r
 import org.simantics.sysdyn.manager.SysdynModelManager;\r
@@ -97,7 +98,7 @@ public class VariableNameWidget implements Widget {
     }\r
 \r
     @Override\r
-    public void setInput(Object input) {\r
+    public void setInput(ISessionContext context, Object input) {\r
         if(input instanceof ISelection) {\r
             variable = ISelectionUtils.filterSingleSelection((ISelection)input, Resource.class);\r
             SimanticsUI.getSession().asyncRequest(new ReadRequest() {\r
@@ -111,7 +112,7 @@ public class VariableNameWidget implements Widget {
             \r
         }\r
         if(textFactory != null) {\r
-            textFactory.listen(input, new Listener<String>() {\r
+            textFactory.listen(context, input, new Listener<String>() {\r
 \r
                 @Override\r
                 public void exception(Throwable t) {\r
index dbd48b1149e90f7f4dfabbf1e1e73298b305ee0a..045bf1603011e18475cbe231052552dfbcfe63e0 100644 (file)
@@ -11,8 +11,7 @@ public class DoublePropertyFactory extends ReadFactoryImpl<Resource, String> {
 \r
     final private String propertyURI;\r
     \r
-    public DoublePropertyFactory(ISessionContext context, String propertyURI) {\r
-        super(context);\r
+    public DoublePropertyFactory(String propertyURI) {\r
         this.propertyURI = propertyURI;\r
     }\r
 \r