From e6fda1f81af972e0ccfe49a3d31ceee87fb3b3c8 Mon Sep 17 00:00:00 2001 From: villberg Date: Fri, 18 Jun 2010 06:32:59 +0000 Subject: [PATCH] git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@16205 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../simantics/sysdyn/ui/properties/ConfigurationTab.java | 6 +++--- .../org/simantics/sysdyn/ui/properties/EquationTab.java | 4 ++-- .../sysdyn/ui/properties/VariableInformationTab.java | 8 ++++---- .../ui/properties/widgets/ExpressionTypeWidget.java | 3 ++- .../sysdyn/ui/properties/widgets/ExpressionWidget.java | 3 ++- .../sysdyn/ui/properties/widgets/ShortcutTabWidget.java | 3 ++- .../sysdyn/ui/properties/widgets/TextWidget.java | 5 +++-- .../sysdyn/ui/properties/widgets/UnitWidget.java | 5 +++-- .../sysdyn/ui/properties/widgets/VariableNameWidget.java | 5 +++-- .../widgets/factories/DoublePropertyFactory.java | 3 +-- 10 files changed, 25 insertions(+), 20 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java index f5d6359d..0c41c928 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java @@ -35,7 +35,7 @@ public class ConfigurationTab extends PropertyTabContributorImpl { label.setText("Name"); name = new TextWidget(composite, support, SWT.BORDER); - name.setTextFactory(new StringPropertyFactory(context, Builtins.URIs.HasName)); + name.setTextFactory(new StringPropertyFactory(Builtins.URIs.HasName)); name.addFocusListener(new SaveListener()); name.addVerifyListener(new VerifyListener() { @@ -54,7 +54,7 @@ public class ConfigurationTab extends PropertyTabContributorImpl { label.setText("Start time"); startTime = new TextWidget(composite, support, SWT.BORDER | SWT.RIGHT); - startTime.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasStartTime)); + startTime.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasStartTime)); startTime.addVerifyListener(new DoubleVerify()); startTime.addFocusListener(new SaveListener()); GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(startTime.getTextWidget()); @@ -63,7 +63,7 @@ public class ConfigurationTab extends PropertyTabContributorImpl { label.setText("Stop time"); stopTime = new TextWidget(composite, support, SWT.BORDER | SWT.RIGHT); - stopTime.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasStopTime)); + stopTime.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasStopTime)); stopTime.addVerifyListener(new DoubleVerify()); stopTime.addFocusListener(new SaveListener()); GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(stopTime.getTextWidget()); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java index b581a06a..378ad63e 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java @@ -43,7 +43,7 @@ public class EquationTab extends PropertyTabContributorImpl { GridDataFactory.fillDefaults().grab(true, true).applyTo(composite); GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(6).applyTo(composite); nameWidget = new VariableNameWidget(composite, support, SWT.BORDER); - nameWidget.setTextFactory(new StringPropertyFactory(context, Builtins.URIs.HasName)); + nameWidget.setTextFactory(new StringPropertyFactory(Builtins.URIs.HasName)); Label label = new Label(composite, SWT.SINGLE ); @@ -58,7 +58,7 @@ public class EquationTab extends PropertyTabContributorImpl { GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(label); unitWidget = new UnitWidget(composite, support, SWT.DROP_DOWN | SWT.BORDER); - unitWidget.setTextFactory(new StringPropertyFactory(context, SysdynResource.URIs.HasUnit)); + unitWidget.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.HasUnit)); shortcutTabWidget = new ShortcutTabWidget(composite, support, SWT.NONE); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/VariableInformationTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/VariableInformationTab.java index 8bef2975..3175a7d9 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/VariableInformationTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/VariableInformationTab.java @@ -37,7 +37,7 @@ public class VariableInformationTab extends PropertyTabContributorImpl { GridLayoutFactory.fillDefaults().margins(3, 3).applyTo(informationGroup); information = new TextWidget(informationGroup, support, SWT.MULTI | SWT.BORDER); - information.setTextFactory(new StringPropertyFactory(context, Builtins.URIs.HasDescription)); + information.setTextFactory(new StringPropertyFactory(Builtins.URIs.HasDescription)); information.addFocusListener(new SaveListener()); GridDataFactory.fillDefaults().grab(true, true).applyTo(information.getTextWidget()); @@ -51,7 +51,7 @@ public class VariableInformationTab extends PropertyTabContributorImpl { label.setText("Start"); rangeStart = new TextWidget(rangeGroup, support, SWT.BORDER | SWT.RIGHT); - rangeStart.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasRangeStart)); + rangeStart.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasRangeStart)); rangeStart.addFocusListener(new SaveListener()); rangeStart.addVerifyListener(new DoubleVerify()); @@ -59,7 +59,7 @@ public class VariableInformationTab extends PropertyTabContributorImpl { label.setText("End"); rangeEnd = new TextWidget(rangeGroup, support, SWT.BORDER | SWT.RIGHT); - rangeEnd.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasRangeEnd)); + rangeEnd.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasRangeEnd)); rangeEnd.addFocusListener(new SaveListener()); rangeEnd.addVerifyListener(new DoubleVerify()); @@ -67,7 +67,7 @@ public class VariableInformationTab extends PropertyTabContributorImpl { label.setText("Step"); rangeStep = new TextWidget(rangeGroup, support, SWT.BORDER | SWT.RIGHT); - rangeStep.setTextFactory(new DoublePropertyFactory(context, SysdynResource.URIs.HasRangeStep)); + rangeStep.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.HasRangeStep)); rangeStep.addFocusListener(new SaveListener()); rangeStep.addVerifyListener(new DoubleVerify()); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypeWidget.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypeWidget.java index 1fae3e03..0b4d9808 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypeWidget.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionTypeWidget.java @@ -14,6 +14,7 @@ import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.common.request.ReadRequest; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.management.ISessionContext; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.properties.widgets.ExpressionTypes.ExpressionType; import org.simantics.ui.SimanticsUI; @@ -38,7 +39,7 @@ public class ExpressionTypeWidget implements Widget { } @Override - public void setInput(Object input) { + public void setInput(ISessionContext context, Object input) { if(input instanceof IStructuredSelection) { final Resource variable = ISelectionUtils.filterSingleSelection((IStructuredSelection)input, Resource.class); if(variable != null) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java index 46307bbb..6ed0546e 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ExpressionWidget.java @@ -16,6 +16,7 @@ import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.management.ISessionContext; import org.simantics.db.request.Read; import org.simantics.sysdyn.ui.properties.widgets.ExpressionTypes.ExpressionType; import org.simantics.sysdyn.ui.properties.widgets.expressions.AuxiliaryExpression; @@ -49,7 +50,7 @@ public class ExpressionWidget implements Widget { } @Override - public void setInput(Object input) { + public void setInput(ISessionContext context, Object input) { if(input instanceof ISelection) { ISelection selection = (ISelection)input; if(selection instanceof IStructuredSelection) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ShortcutTabWidget.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ShortcutTabWidget.java index a8cd943d..b43486c5 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ShortcutTabWidget.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ShortcutTabWidget.java @@ -20,6 +20,7 @@ import org.simantics.db.Builtins; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.management.ISessionContext; import org.simantics.db.request.Read; import org.simantics.sysdyn.SysdynResource; import org.simantics.ui.SimanticsUI; @@ -69,7 +70,7 @@ public class ShortcutTabWidget implements Widget { } @Override - public void setInput(Object input) { + public void setInput(ISessionContext context, Object input) { if(input instanceof IStructuredSelection) { final Resource variable = ISelectionUtils.filterSingleSelection((IStructuredSelection)input, Resource.class); if(variable != null) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/TextWidget.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/TextWidget.java index bf72c827..4fb58101 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/TextWidget.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/TextWidget.java @@ -17,6 +17,7 @@ import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.management.ISessionContext; import org.simantics.db.procedure.Listener; import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyFactory; import org.simantics.ui.SimanticsUI; @@ -55,12 +56,12 @@ public class TextWidget implements Widget { } @Override - public void setInput(Object input) { + public void setInput(ISessionContext context, Object input) { if(input instanceof ISelection) resource = ISelectionUtils.filterSingleSelection((ISelection)input, Resource.class); if(readFactory != null) { - readFactory.listen(input, new Listener() { + readFactory.listen(context, input, new Listener() { @Override public void exception(Throwable t) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/UnitWidget.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/UnitWidget.java index a6ca29fa..fae7df99 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/UnitWidget.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/UnitWidget.java @@ -24,6 +24,7 @@ import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.management.ISessionContext; import org.simantics.db.procedure.Listener; import org.simantics.db.request.Read; import org.simantics.sysdyn.SysdynResource; @@ -78,11 +79,11 @@ public class UnitWidget implements Widget { } @Override - public void setInput(final Object input) { + public void setInput(ISessionContext context, final Object input) { if(input instanceof ISelection) variable = ISelectionUtils.filterSingleSelection((ISelection)input, Resource.class); if(textFactory != null) { - textFactory.listen(input, new Listener() { + textFactory.listen(context, input, new Listener() { @Override public void exception(Throwable t) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/VariableNameWidget.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/VariableNameWidget.java index ab10229e..46897945 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/VariableNameWidget.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/VariableNameWidget.java @@ -25,6 +25,7 @@ import org.simantics.db.WriteGraph; import org.simantics.db.common.request.ReadRequest; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.management.ISessionContext; import org.simantics.db.procedure.Listener; import org.simantics.sysdyn.manager.SysdynModel; import org.simantics.sysdyn.manager.SysdynModelManager; @@ -97,7 +98,7 @@ public class VariableNameWidget implements Widget { } @Override - public void setInput(Object input) { + public void setInput(ISessionContext context, Object input) { if(input instanceof ISelection) { variable = ISelectionUtils.filterSingleSelection((ISelection)input, Resource.class); SimanticsUI.getSession().asyncRequest(new ReadRequest() { @@ -111,7 +112,7 @@ public class VariableNameWidget implements Widget { } if(textFactory != null) { - textFactory.listen(input, new Listener() { + textFactory.listen(context, input, new Listener() { @Override public void exception(Throwable t) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/DoublePropertyFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/DoublePropertyFactory.java index dbd48b11..045bf160 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/DoublePropertyFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/DoublePropertyFactory.java @@ -11,8 +11,7 @@ public class DoublePropertyFactory extends ReadFactoryImpl { final private String propertyURI; - public DoublePropertyFactory(ISessionContext context, String propertyURI) { - super(context); + public DoublePropertyFactory(String propertyURI) { this.propertyURI = propertyURI; } -- 2.47.1