From: lempinen Date: Thu, 28 Apr 2011 13:44:43 +0000 (+0000) Subject: All tabs use LabelPropertyTabContributor to provide proper names for tabs. X-Git-Tag: simantics-1.4RC1~33 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=5ec52205c5dda0a21b4bdabefb0c8f04f1fdd874;p=simantics%2Fsysdyn.git All tabs use LabelPropertyTabContributor to provide proper names for tabs. git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@20615 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ArrayIndexesTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ArrayIndexesTab.java index 2e61a13a..0f275677 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ArrayIndexesTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ArrayIndexesTab.java @@ -15,7 +15,6 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Tree; import org.eclipse.ui.IWorkbenchSite; import org.simantics.browsing.ui.swt.AdaptableHintContext; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.SingleSelectionInputSource; import org.simantics.browsing.ui.swt.widgets.Button; import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite; @@ -31,7 +30,7 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.properties.widgets.ColumnKeys; import org.simantics.utils.datastructures.ArrayMap; -public class ArrayIndexesTab extends PropertyTabContributorImpl implements Widget{ +public class ArrayIndexesTab extends LabelPropertyTabContributor implements Widget{ GraphExplorerComposite availableEnumerationsExplorer; GraphExplorerComposite usedEnumerationsExplorer; 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 512532ab..f87760de 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 @@ -21,16 +21,16 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; -import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier; import org.simantics.browsing.ui.swt.widgets.TrackedCombo; import org.simantics.browsing.ui.swt.widgets.TrackedText; import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl; +import org.simantics.browsing.ui.swt.widgets.impl.TextModifyListenerImpl; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; +import org.simantics.db.common.utils.NameUtils; import org.simantics.db.exception.DatabaseException; import org.simantics.db.management.ISessionContext; import org.simantics.layer0.Layer0; @@ -40,8 +40,22 @@ import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyFactor import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyModifier; import org.simantics.sysdyn.ui.utils.VariableNameUtils; -public class ConfigurationTab extends PropertyTabContributorImpl { - +public class ConfigurationTab extends LabelPropertyTabContributor { + + private class ModelLabelModifier extends TextModifyListenerImpl { + + public ModelLabelModifier(ISessionContext context, String propertyURI) { + } + + @Override + public void applyText(WriteGraph graph, Resource issue, String text) throws DatabaseException { + Layer0 l0 = Layer0.getInstance(graph); + graph.claimLiteral(issue, l0.HasLabel, text); + String safeName = NameUtils.findFreshName(graph, text, graph.getSingleObject(issue, l0.PartOf), l0.ConsistsOf, "%s%d"); + graph.claimLiteral(issue, l0.HasName, safeName); + } + + } @Override @@ -55,7 +69,7 @@ public class ConfigurationTab extends PropertyTabContributorImpl { TrackedText name = new TrackedText(composite, support, SWT.BORDER); name.setTextFactory(new StringPropertyFactory(Layer0.URIs.HasLabel)); - name.addModifyListener(new StringPropertyModifier(context, Layer0.URIs.HasLabel)); + name.addModifyListener(new ModelLabelModifier(context, Layer0.URIs.HasLabel)); name.setInputValidator(new IInputValidator() { @Override diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/DependencyTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/DependencyTab.java index ac5507cc..1119f941 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/DependencyTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/DependencyTab.java @@ -16,7 +16,6 @@ import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier; import org.simantics.browsing.ui.swt.widgets.TrackedText; @@ -24,7 +23,7 @@ import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.management.ISessionContext; import org.simantics.layer0.Layer0; -public class DependencyTab extends PropertyTabContributorImpl { +public class DependencyTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EnumerationTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EnumerationTab.java index ee23bcc1..3d88d849 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EnumerationTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EnumerationTab.java @@ -17,7 +17,6 @@ import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; import org.eclipse.ui.IWorkbenchSite; import org.simantics.browsing.ui.NodeContext; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.SingleSelectionInputSource; import org.simantics.browsing.ui.swt.widgets.Button; import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite; @@ -52,7 +51,7 @@ import org.simantics.ui.SimanticsUI; import org.simantics.ui.utils.AdaptionUtils; import org.simantics.utils.datastructures.ArrayMap; -public class EnumerationTab extends PropertyTabContributorImpl implements Widget { +public class EnumerationTab extends LabelPropertyTabContributor implements Widget { GraphExplorerComposite indexExplorer; 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 21e8764e..ba68d2c9 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 @@ -38,7 +38,6 @@ import org.eclipse.swt.widgets.TableItem; import org.eclipse.ui.IWorkbenchPartReference; import org.eclipse.ui.IWorkbenchSite; import org.simantics.browsing.ui.platform.PropertyPageView; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.Button; import org.simantics.browsing.ui.swt.widgets.TrackedCombo; import org.simantics.browsing.ui.swt.widgets.impl.ComboModifyListenerImpl; @@ -76,7 +75,7 @@ import org.simantics.ui.SimanticsUI; import org.simantics.ui.utils.AdaptionUtils; import org.simantics.utils.datastructures.Pair; -public class EquationTab extends PropertyTabContributorImpl implements Widget { +public class EquationTab extends LabelPropertyTabContributor implements Widget { TrackedCombo expressionTypeCombo, unitCombo, arrayEquationCombo; ShortcutTabWidget shortcutTabWidget; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ExperimentTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ExperimentTab.java index 7a97aeb5..8d4aa90b 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ExperimentTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ExperimentTab.java @@ -13,11 +13,10 @@ package org.simantics.sysdyn.ui.properties; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.management.ISessionContext; -public class ExperimentTab extends PropertyTabContributorImpl { +public class ExperimentTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ExternalFilesTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ExternalFilesTab.java index 7abe6142..b965ed6a 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ExternalFilesTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ExternalFilesTab.java @@ -19,7 +19,6 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Tree; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.SingleSelectionInputSource; import org.simantics.browsing.ui.swt.widgets.Button; import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite; @@ -36,7 +35,7 @@ import org.simantics.ui.SimanticsUI; import org.simantics.utils.datastructures.ArrayMap; import org.simantics.utils.datastructures.Pair; -public class ExternalFilesTab extends PropertyTabContributorImpl implements Widget { +public class ExternalFilesTab extends LabelPropertyTabContributor implements Widget { GraphExplorerComposite externalFilesExplorer; Button importButton; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionLibraryTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionLibraryTab.java index abbdacf4..b198c15d 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionLibraryTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionLibraryTab.java @@ -16,7 +16,6 @@ import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier; import org.simantics.browsing.ui.swt.widgets.TrackedText; @@ -24,7 +23,7 @@ import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.management.ISessionContext; import org.simantics.layer0.Layer0; -public class FunctionLibraryTab extends PropertyTabContributorImpl { +public class FunctionLibraryTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionTab.java index 6a161ba5..2d7e2c22 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionTab.java @@ -17,7 +17,6 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.Label; import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier; @@ -33,7 +32,7 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.manager.FunctionUtils; import org.simantics.sysdyn.ui.properties.widgets.FunctionLabelFactory; -public class FunctionTab extends PropertyTabContributorImpl { +public class FunctionTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/InputVariableTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/InputVariableTab.java index acc53a50..661be836 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/InputVariableTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/InputVariableTab.java @@ -19,7 +19,6 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; import org.simantics.browsing.ui.swt.widgets.TrackedText; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; @@ -32,7 +31,7 @@ import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyModifi import org.simantics.sysdyn.ui.properties.widgets.factories.VariableNamePropertyModifier; import org.simantics.sysdyn.ui.properties.widgets.factories.VariableNameValidator; -public class InputVariableTab extends PropertyTabContributorImpl { +public class InputVariableTab extends LabelPropertyTabContributor { @Override diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/LabelPropertyTabContributor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/LabelPropertyTabContributor.java new file mode 100644 index 00000000..2d9d76c6 --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/LabelPropertyTabContributor.java @@ -0,0 +1,63 @@ +package org.simantics.sysdyn.ui.properties; + +import org.eclipse.jface.viewers.ISelection; +import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; +import org.simantics.db.AsyncReadGraph; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.procedure.AsyncListener; +import org.simantics.db.request.Read; +import org.simantics.layer0.Layer0; +import org.simantics.ui.SimanticsUI; +import org.simantics.ui.utils.AdaptionUtils; +import org.simantics.utils.datastructures.Callback; + +public abstract class LabelPropertyTabContributor extends PropertyTabContributorImpl { + + + public void updatePartName(ISelection forSelection, final Callback updateCallback) { + final Resource r = AdaptionUtils.adaptToSingle(forSelection, Resource.class); + if(r == null) { + updateCallback.run("Selection properties"); + return; + } + + try { + SimanticsUI.getSession().syncRequest(new Read() { + + @Override + public String perform(ReadGraph graph) throws DatabaseException { + Layer0 l0 = Layer0.getInstance(graph); + String label = graph.getPossibleRelatedValue(r, l0.HasLabel); + if(label != null) + return label; + label = graph.getPossibleRelatedValue(r, l0.HasName); + if(label != null) + return label; + return "No name for selection"; + } + }, new AsyncListener() { + + @Override + public void execute(AsyncReadGraph graph, String result) { + updateCallback.run(result); + } + + @Override + public void exception(AsyncReadGraph graph, Throwable throwable) { + + } + + @Override + public boolean isDisposed() { + return false; + } + }); + } catch (DatabaseException e) { + updateCallback.run("Selection error in LabelPropertyTabContributor"); + e.printStackTrace(); + } + + } +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/LookupTableTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/LookupTableTab.java index a6d756c5..678227ff 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/LookupTableTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/LookupTableTab.java @@ -17,7 +17,6 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.TrackedText; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.management.ISessionContext; @@ -27,7 +26,7 @@ import org.simantics.sysdyn.ui.properties.widgets.ChartWidget; import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyFactory; import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyModifier; -public class LookupTableTab extends PropertyTabContributorImpl { +public class LookupTableTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModelTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModelTab.java index 93f12690..77ea180a 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModelTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModelTab.java @@ -13,11 +13,10 @@ package org.simantics.sysdyn.ui.properties; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.management.ISessionContext; -public class ModelTab extends PropertyTabContributorImpl { +public class ModelTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleInputTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleInputTab.java index 5f59b455..f188749c 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleInputTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleInputTab.java @@ -18,7 +18,6 @@ import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; @@ -29,12 +28,12 @@ import org.simantics.layer0.Layer0; import org.simantics.structural.stubs.StructuralResource2; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.properties.widgets.ModuleInputEditingSupport; -import org.simantics.sysdyn.ui.properties.widgets.ReferenceTable; import org.simantics.sysdyn.ui.properties.widgets.ReferenceRow; -import org.simantics.sysdyn.ui.properties.widgets.RowProvider; import org.simantics.sysdyn.ui.properties.widgets.ReferenceRowLabelProvider; +import org.simantics.sysdyn.ui.properties.widgets.ReferenceTable; +import org.simantics.sysdyn.ui.properties.widgets.RowProvider; -public class ModuleInputTab extends PropertyTabContributorImpl { +public class ModuleInputTab extends LabelPropertyTabContributor { public static final String FIRSTCOLUMN = "Input in Module"; public static final String SECONDCOLUMN = "Refers to output"; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleOutputTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleOutputTab.java index cb75f97a..29c2819f 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleOutputTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleOutputTab.java @@ -18,7 +18,6 @@ import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; @@ -34,7 +33,7 @@ import org.simantics.sysdyn.ui.properties.widgets.ReferenceRowLabelProvider; import org.simantics.sysdyn.ui.properties.widgets.ReferenceTable; import org.simantics.sysdyn.ui.properties.widgets.RowProvider; -public class ModuleOutputTab extends PropertyTabContributorImpl { +public class ModuleOutputTab extends LabelPropertyTabContributor { public static final String FIRSTCOLUMN = "Output in module"; public static final String SECONDCOLUMN = "Referes to input"; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java index 1c44fcdb..acde5e36 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTab.java @@ -19,7 +19,6 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Tree; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.SingleSelectionInputSource; import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite; import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; @@ -33,7 +32,7 @@ import org.simantics.layer0.Layer0; import org.simantics.sysdyn.ui.properties.widgets.ColumnKeys; import org.simantics.utils.datastructures.ArrayMap; -public class ModuleTab extends PropertyTabContributorImpl implements Widget { +public class ModuleTab extends LabelPropertyTabContributor implements Widget { GraphExplorerComposite enumerationRedeclarationExplorer; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTypeTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTypeTab.java index 5910e9ac..fe40aee7 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTypeTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ModuleTypeTab.java @@ -16,7 +16,6 @@ import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier; import org.simantics.browsing.ui.swt.widgets.TrackedText; @@ -24,7 +23,7 @@ import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.management.ISessionContext; import org.simantics.layer0.Layer0; -public class ModuleTypeTab extends PropertyTabContributorImpl { +public class ModuleTypeTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ReferenceDependencyTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ReferenceDependencyTab.java index 0ed0d0ea..cc8f4384 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ReferenceDependencyTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ReferenceDependencyTab.java @@ -13,11 +13,10 @@ package org.simantics.sysdyn.ui.properties; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.management.ISessionContext; -public class ReferenceDependencyTab extends PropertyTabContributorImpl { +public class ReferenceDependencyTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResultTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResultTab.java index 020dd97f..306cd840 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResultTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ResultTab.java @@ -13,11 +13,10 @@ package org.simantics.sysdyn.ui.properties; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; import org.simantics.db.management.ISessionContext; -public class ResultTab extends PropertyTabContributorImpl { +public class ResultTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/SharedFunctionLibrariesTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/SharedFunctionLibrariesTab.java index 75e3ac1b..d3d855a3 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/SharedFunctionLibrariesTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/SharedFunctionLibrariesTab.java @@ -27,7 +27,6 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IWorkbenchSite; import org.simantics.browsing.ui.NodeContext; import org.simantics.browsing.ui.swt.AdaptableHintContext; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.SingleSelectionInputSource; import org.simantics.browsing.ui.swt.widgets.Button; import org.simantics.browsing.ui.swt.widgets.GraphExplorerComposite; @@ -45,7 +44,7 @@ import org.simantics.ui.SimanticsUI; import org.simantics.ui.utils.AdaptionUtils; import org.simantics.utils.datastructures.ArrayMap; -public class SharedFunctionLibrariesTab extends PropertyTabContributorImpl implements Widget { +public class SharedFunctionLibrariesTab extends LabelPropertyTabContributor implements Widget { GraphExplorerComposite availableSharedFunctionLibraries; GraphExplorerComposite usedSharedFunctionLibraries; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/SysdynPropertyPage.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/SysdynPropertyPage.java index 44f9e8a0..b7ba338f 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/SysdynPropertyPage.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/SysdynPropertyPage.java @@ -13,22 +13,12 @@ package org.simantics.sysdyn.ui.properties; import java.util.Set; -import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IWorkbenchPartSite; import org.simantics.browsing.ui.swt.StandardPropertyPage; -import org.simantics.db.ReadGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.modeling.ModelingUtils; public class SysdynPropertyPage extends StandardPropertyPage { public SysdynPropertyPage(IWorkbenchPartSite site, Set set) { super(site, set); } - - @Override - protected String computeTitle(ReadGraph graph, ISelection selection) throws DatabaseException { - return ModelingUtils.computeTitle(graph, selection, MAX_SELECTION_LENGTH_TO_SHOW, true); - } - } 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 92bacb2b..9a3b21e8 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 @@ -19,7 +19,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.PropertyTabContributorImpl; import org.simantics.browsing.ui.swt.widgets.StringPropertyFactory; import org.simantics.browsing.ui.swt.widgets.StringPropertyModifier; import org.simantics.browsing.ui.swt.widgets.TrackedText; @@ -30,7 +29,7 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyFactory; import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyModifier; -public class VariableInformationTab extends PropertyTabContributorImpl { +public class VariableInformationTab extends LabelPropertyTabContributor { @Override public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) {