From 1a24584a3590d0eb2ef464ecea71fb9ace6cf3f8 Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Thu, 12 Jan 2017 15:59:41 +0200 Subject: [PATCH] Enhancements to TabContributions Change-Id: I4df883661c0836a2b19288e7c9fd9456f16988fa --- .../graph/AnnotationView.pgraph | 8 +- .../graph/DocumentProperty.pgraph | 2 +- .../graph/DocumentUI.pgraph | 4 +- .../graph/DrawingTemplateVP.pgraph | 4 +- .../graph.tg | Bin 18748 -> 18562 bytes .../graph/PlatformUI.pgraph | 4 +- .../graph/PlatformUIViews.pgraph | 8 +- .../graph/Selectionview.pgraph | 23 +-- .../AbstractResourceTabContribution.java | 49 ++----- .../AbstractTabContribution.java | 68 +++++++++ .../AbstractTypedResourceTabContribution.java | 32 ++--- .../AbstractTypedTabContribution.java | 34 +++++ .../AbstractTypedVariableTabContribution.java | 32 ++--- .../AbstractVariableTabContribution.java | 62 ++------ .../MultiTypedTabContribution.java | 135 ++++++++++++++++++ .../TypedVariableTabContribution.java | 6 +- .../VariableTabContribution.java | 4 +- 17 files changed, 316 insertions(+), 159 deletions(-) create mode 100644 bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTabContribution.java create mode 100644 bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedTabContribution.java create mode 100644 bundles/org.simantics.selectionview/src/org/simantics/selectionview/MultiTypedTabContribution.java diff --git a/bundles/org.simantics.annotation.ontology/graph/AnnotationView.pgraph b/bundles/org.simantics.annotation.ontology/graph/AnnotationView.pgraph index 8b6a15520..39740b52c 100644 --- a/bundles/org.simantics.annotation.ontology/graph/AnnotationView.pgraph +++ b/bundles/org.simantics.annotation.ontology/graph/AnnotationView.pgraph @@ -40,15 +40,15 @@ ANNO.Functions.descriptionText : L0.Function L0.HasValueType "String" ANNO.SelectionTabContribution : SEL.TypedVariableTabContribution - SEL.TypedVariableTabContribution.HasType L0.Entity + SEL.TypedTabContribution.HasType L0.Entity SEL.VariableTabContribution.HasView ANNO.SelectionTab - SEL.VariableTabContribution.HasPriority -10 + SEL.TabContribution.HasPriority -10 L0.HasLabel "Annotations" ANNO.SelectionTabContribution2 : SEL.TypedVariableTabContribution - SEL.TypedVariableTabContribution.HasType ANNO.Annotation + SEL.TypedTabContribution.HasType ANNO.Annotation SEL.VariableTabContribution.HasView ANNO.SelectionTab2 - SEL.VariableTabContribution.HasPriority -9 + SEL.TabContribution.HasPriority -9 L0.HasLabel "Annotation Properties" ANNO.SelectionTab.BC : SEL_UI.StandardProperties.BrowseContextStandardChildren diff --git a/bundles/org.simantics.document.ui.ontology/graph/DocumentProperty.pgraph b/bundles/org.simantics.document.ui.ontology/graph/DocumentProperty.pgraph index c6263c034..8b9b8fbda 100644 --- a/bundles/org.simantics.document.ui.ontology/graph/DocumentProperty.pgraph +++ b/bundles/org.simantics.document.ui.ontology/graph/DocumentProperty.pgraph @@ -12,7 +12,7 @@ UI = UI.DocumentTabContributionType isInstanceOf r L0.IndexRoot" UI.WikitextContribution : SEL.VariableTabContribution - SEL.VariableTabContribution.HasTest UI.Functions.isWikitext : L0.Function + SEL.TabContribution.HasTest UI.Functions.isWikitext : L0.Function SEL.VariableTabContribution.HasView UI.WikitextContribution.View - SEL.VariableTabContribution.HasPriority 1 + SEL.TabContribution.HasPriority 1 L0.HasLabel "Wiki" UI.WikitextContribution.View : VIEWS.Composite diff --git a/bundles/org.simantics.modeling.template2d.ontology/graph/DrawingTemplateVP.pgraph b/bundles/org.simantics.modeling.template2d.ontology/graph/DrawingTemplateVP.pgraph index 66d2b336c..d01861d59 100644 --- a/bundles/org.simantics.modeling.template2d.ontology/graph/DrawingTemplateVP.pgraph +++ b/bundles/org.simantics.modeling.template2d.ontology/graph/DrawingTemplateVP.pgraph @@ -33,9 +33,9 @@ TEMPLATE2D.FlagTableUI.ColumnUI.HeaderUI AsPjb#Bz zAtZz}A#0Pc1PWzITOdgT2?=C@tn48`64In8&C)DwlO|2tqzRD!Klk4E?mWq?{o1eJ z7k%HIx&Jxmo^#K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G5!R|IMs)67RaikQwih7EpE#Glq zsW5ScW;z!7;h@Qe=~}Hn7r(-xtW&BV&pOs*(M4_9XMBztiq{g*LK4A0wy9^Td((PdLv1#o>Q?;J?D@tQ9(=FXpk&%5fB0Pl;BC mrNrlG^z;DPCq?$4aGkF^81Oj+GLO9qdyk6jtjV4`R{Rl8ZS : L0.Ontology SEL.Functions : L0.Library +SEL.TabContribution.Multi -- SEL.TabContribution.HasTest --> L0.Value -- SEL.TabContribution.HasPriority ==> "Integer" -- SEL.TypedTabContribution.HasType --> L0.Type -- SEL.AbstractVariableTabContribution.testFunction ==> "Variable -> Boolean" -- SEL.AbstractVariableTabContribution.HasPriority ==> "Integer" -- SEL.AbstractVariableTabContribution.HasTest --> L0.Value -- SEL.AbstractResourceTabContribution.HasTest --> L0.Value -- SEL.AbstractResourceTabContribution.HasPriority ==> "Integer" -- SEL.AbstractTypedVariableTabContribution.HasType --> L0.Type -- SEL.AbstractTypedResourceTabContribution.HasType --> L0.Type -- SEL.SCLTabContribution.instantiate ==> "() -> TabContribution" -- SEL.VariableTabContribution.HasTest -- SEL.VariableTabContribution.transformation ==> "Variable -> Variable" -- SEL.VariableTabContribution.HasView -- SEL.VariableTabContribution.HasPriority -- SEL.TypedVariableTabContribution.HasType { - final protected Resource configuration; +abstract public class AbstractResourceTabContribution extends AbstractTabContribution { public AbstractResourceTabContribution(ReadGraph graph, Resource configuration) throws DatabaseException { - this.configuration = configuration; - } - - public abstract void getContributors(ReadGraph graph, Resource resource, Integer priority, String label, Collection result) throws DatabaseException; - - @Override - public boolean accept(ReadGraph graph, Object input) throws DatabaseException { - - if (!(input instanceof Resource)) - return false; - Resource resource = (Resource) input; - - SelectionViewResources SEL = SelectionViewResources.getInstance(graph); - for(Resource r : graph.getObjects(configuration, SEL.AbstractResourceTabContribution_HasTest)) { - Boolean pass = Functions.exec(graph, r, graph, resource); - if(!pass) return false; - } - - return true; - + super(graph, configuration); } - @Override - final public void contribute(ReadGraph graph, final Resource resource, Collection result) throws DatabaseException { - - Layer0 L0 = Layer0.getInstance(graph); - SelectionViewResources SEL = SelectionViewResources.getInstance(graph); - - Integer priority = graph.getPossibleRelatedValue(configuration, SEL.AbstractResourceTabContribution_HasPriority, Bindings.INTEGER); - String label = graph.getPossibleRelatedValue(configuration, L0.HasLabel); - - getContributors(graph, resource, priority, label, result); - - } - + @Override + public boolean accept(ReadGraph graph, Object input) throws DatabaseException { + if (!(input instanceof Resource)) + return false; + return super.accept(graph, input); + } } diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTabContribution.java new file mode 100644 index 000000000..735669855 --- /dev/null +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTabContribution.java @@ -0,0 +1,68 @@ +package org.simantics.selectionview; + +import java.lang.reflect.Array; +import java.util.Collection; +import java.util.Objects; + +import org.simantics.databoard.Bindings; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.utils.Functions; +import org.simantics.db.exception.DatabaseException; +import org.simantics.layer0.Layer0; + +public abstract class AbstractTabContribution implements TabContribution { + + protected final Resource configuration; + protected final String uri; + + public AbstractTabContribution(ReadGraph graph, Resource configuration) throws DatabaseException { + this.configuration = Objects.requireNonNull(configuration); + this.uri = graph.getURI(configuration); + } + + @Override + public boolean accept(ReadGraph graph, Object input) throws DatabaseException { + SelectionViewResources SEL = SelectionViewResources.getInstance(graph); + // Lets see if multi or single support + Boolean multi = graph.getRelatedValue2(configuration, SEL.TabContribution_Multi, Bindings.BOOLEAN); + if (input instanceof Collection) { + Collection inputs = (Collection) input; + if (inputs.isEmpty()) + return false; + if (inputs.size() > 1 && !multi) + return false; + } else if (input.getClass().isArray()) { + int arrayLength = Array.getLength(input); + if (arrayLength == 0) + return false; + if (arrayLength > 1 && !multi) + return false; + } + // HasTest seems to be deprecated but lets support it just for fun + for(Resource r : graph.getObjects(configuration, SEL.TabContribution_HasTest)) { + Boolean pass = Functions.exec(graph, r, graph, input); + if(!pass) + return false; + } + return true; + } + + public abstract void getContributors(ReadGraph graph, T input, Integer priority, String label, Collection result) throws DatabaseException; + + @Override + public final void contribute(ReadGraph graph, T input, Collection result) throws DatabaseException { + Layer0 L0 = Layer0.getInstance(graph); + SelectionViewResources SEL = SelectionViewResources.getInstance(graph); + + Integer priority = graph.getPossibleRelatedValue(configuration, SEL.TabContribution_HasPriority, Bindings.INTEGER); + String label = graph.getPossibleRelatedValue(configuration, L0.HasLabel); + + getContributors(graph, input, priority, label, result); + } + + @Override + public String toString() { + return getClass().getSimpleName() + "[" + uri + "]"; + } +} diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedResourceTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedResourceTabContribution.java index 06c0e1e37..f1148084e 100644 --- a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedResourceTabContribution.java +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedResourceTabContribution.java @@ -1,32 +1,24 @@ package org.simantics.selectionview; +import java.util.Collection; +import java.util.Collections; + import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; -abstract public class AbstractTypedResourceTabContribution extends AbstractResourceTabContribution { +abstract public class AbstractTypedResourceTabContribution extends AbstractTypedTabContribution { public AbstractTypedResourceTabContribution(ReadGraph graph, Resource configuration) throws DatabaseException { super(graph, configuration); } - - @Override - public boolean accept(ReadGraph graph, Object input) throws DatabaseException { - - if (!(input instanceof Resource)) - return false; - Resource resource = (Resource) input; - - SelectionViewResources SEL = SelectionViewResources.getInstance(graph); - - Resource type = graph.getPossibleObject(configuration, SEL.AbstractTypedResourceTabContribution_HasType); - if(type == null) throw new DatabaseException("No type for " + graph.getPossibleURI(configuration)); - - if(!graph.isInstanceOf(resource, type)) return false; - - return super.accept(graph, resource); - - } - + @Override + public boolean accept(ReadGraph graph, Object input, Collection types) throws DatabaseException { + if (!(input instanceof Resource)) + return false; + Resource resource = (Resource) input; + Collection ts = graph.getTypes(resource); + return !Collections.disjoint(types, ts); + } } diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedTabContribution.java new file mode 100644 index 000000000..1c8a86eee --- /dev/null +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedTabContribution.java @@ -0,0 +1,34 @@ +package org.simantics.selectionview; + +import java.util.Collection; +import java.util.Objects; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; + +public abstract class AbstractTypedTabContribution extends AbstractTabContribution { + + protected final Collection types; + + public AbstractTypedTabContribution(ReadGraph graph, Resource configuration) throws DatabaseException { + super(graph, configuration); + this.types = Objects.requireNonNull(graph.getObjects(configuration, SelectionViewResources.getInstance(graph).TypedTabContribution_HasType)); + if(types.isEmpty()) + throw new DatabaseException("No type for " + graph.getPossibleURI(configuration)); + } + + @Override + public boolean accept(ReadGraph graph, Object input) throws DatabaseException { + if (!super.accept(graph, input)) + return false; + return accept(graph, input, types); + } + + public abstract boolean accept(ReadGraph graph, Object input, Collection type) throws DatabaseException; + + @Override + public String toString() { + return super.toString() + " type=" + types; + } +} diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedVariableTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedVariableTabContribution.java index 741cbd396..13f88b9fb 100644 --- a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedVariableTabContribution.java +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractTypedVariableTabContribution.java @@ -1,31 +1,31 @@ package org.simantics.selectionview; +import java.util.Collection; +import java.util.Collections; + import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.variable.Variable; -abstract public class AbstractTypedVariableTabContribution extends AbstractVariableTabContribution { +abstract public class AbstractTypedVariableTabContribution extends AbstractTypedTabContribution { public AbstractTypedVariableTabContribution(ReadGraph graph, Resource configuration) throws DatabaseException { super(graph, configuration); } - @Override - public boolean accept(ReadGraph graph, Variable variable, Object selection) throws DatabaseException { - - SelectionViewResources SEL = SelectionViewResources.getInstance(graph); + @Override + public boolean accept(ReadGraph graph, Object input, Collection types) throws DatabaseException { + + if (!(input instanceof Variable)) + return false; + Variable variable = (Variable) input; - Resource type = graph.getPossibleObject(configuration, SEL.AbstractTypedVariableTabContribution_HasType); - if(type == null) throw new DatabaseException("No type for " + graph.getPossibleURI(configuration)); + Resource resource = variable.getPossibleRepresents(graph); + if (resource == null) + return false; - Resource resource = variable.getPossibleRepresents(graph); - if(resource == null) return false; - - if(!graph.isInstanceOf(resource, type)) return false; - - return super.accept(graph, variable, selection); - - } - + Collection ts = graph.getTypes(resource); + return !Collections.disjoint(types, ts); + } } diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractVariableTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractVariableTabContribution.java index 8063eb3c1..2d4fcf223 100644 --- a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractVariableTabContribution.java +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/AbstractVariableTabContribution.java @@ -1,45 +1,31 @@ package org.simantics.selectionview; -import java.util.Collection; - import org.simantics.Simantics; -import org.simantics.databoard.Bindings; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; -import org.simantics.db.common.utils.Functions; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.variable.Variable; import org.simantics.db.layer0.variable.Variables; -import org.simantics.layer0.Layer0; import org.simantics.scl.runtime.function.Function; import org.simantics.ui.selection.WorkbenchSelectionUtils; -abstract public class AbstractVariableTabContribution implements TabContribution { - - final private String uri; - final protected Resource configuration; +abstract public class AbstractVariableTabContribution extends AbstractTabContribution { public AbstractVariableTabContribution(ReadGraph graph, Resource configuration) throws DatabaseException { - this.configuration = configuration; - this.uri = graph.getURI(configuration); - } - - public abstract void getContributors(ReadGraph graph, Variable variable, Integer priority, String label, Collection result) throws DatabaseException; - - @Override - public boolean accept(ReadGraph graph, Object input) throws DatabaseException { - return true; + super(graph, configuration); } - public boolean accept(ReadGraph graph, Variable variable, Object selection) throws DatabaseException { + @Override + public boolean accept(ReadGraph graph, Object input) throws DatabaseException { + if (!super.accept(graph, input)) + return false; + Variable variable = getPossibleVariable(graph, input); + if (variable == null) + return false; - if(selection instanceof SelectionInput) { + if(input instanceof SelectionInput) { SelectionViewResources SEL = SelectionViewResources.getInstance(graph); - for(Resource r : graph.getObjects(configuration, SEL.AbstractVariableTabContribution_HasTest)) { - Boolean pass = Functions.exec(graph, r, graph, (SelectionInput)selection); - if(!pass) return false; - } Variable configurationVariable = Variables.getVariable(graph, configuration); Function f = configurationVariable.getPossiblePropertyValue(graph, SEL.AbstractVariableTabContribution_testFunction); @@ -49,13 +35,9 @@ abstract public class AbstractVariableTabContribution implements TabContribution } } else { - return false; - } - return true; - } final private Variable getPossibleVariable(ReadGraph graph, Object selection) throws DatabaseException { @@ -67,28 +49,4 @@ abstract public class AbstractVariableTabContribution implements TabContribution } return null; } - - @Override - final public void contribute(ReadGraph graph, final Object selection, Collection result) throws DatabaseException { - - Variable variable = getPossibleVariable(graph, selection); - if(variable == null) return; - - Layer0 L0 = Layer0.getInstance(graph); - SelectionViewResources SEL = SelectionViewResources.getInstance(graph); - - Integer priority = graph.getPossibleRelatedValue(configuration, SEL.AbstractVariableTabContribution_HasPriority, Bindings.INTEGER); - String label = graph.getPossibleRelatedValue(configuration, L0.HasLabel); - - if(!accept(graph, variable, selection)) return; - - getContributors(graph, variable, priority, label, result); - - } - - @Override - public String toString() { - return "AbstractVariableTabContribution[" + uri + "]"; - } - } diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/MultiTypedTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/MultiTypedTabContribution.java new file mode 100644 index 000000000..9ffd74a60 --- /dev/null +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/MultiTypedTabContribution.java @@ -0,0 +1,135 @@ +package org.simantics.selectionview; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.ui.IWorkbenchSite; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.utils.Logger; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.Variable; +import org.simantics.db.layer0.variable.Variables; +import org.simantics.ui.selection.AnyResource; +import org.simantics.ui.selection.WorkbenchSelectionElement; +import org.simantics.views.swt.SWTViewLoaderProcess; +import org.simantics.views.swt.client.base.SWTRoot; + +public class MultiTypedTabContribution extends AbstractTypedTabContribution { + + public MultiTypedTabContribution(ReadGraph graph, Resource configuration) throws DatabaseException { + super(graph, configuration); + } + + static class Contribution extends ModelledTabContributor { + + private String viewURI; + + public Contribution(String viewURI) { + this.viewURI = viewURI; + } + + @Override + public void createControls(Composite body, IWorkbenchSite site) { + + try { + + final SWTViewLoaderProcess loader = new SWTViewLoaderProcess(null, site); + final SWTRoot root = loader.load(viewURI, runtime); + root.createControls(body); + body.addListener(SWT.Dispose, new Listener() { + + @Override + public void handleEvent(Event event) { + if(!loader.isDisposed()) + loader.dispose(); + } + + }); + + } catch (DatabaseException e) { + + e.printStackTrace(); + Logger.defaultLogError(e); + + } + + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + else if (obj == null) + return false; + else if (!(obj instanceof Contribution)) + return false; + Contribution c = (Contribution)obj; + return viewURI.equals(c.viewURI); + } + + @Override + public int hashCode() { + return viewURI.hashCode(); + } + + } + + @Override + public boolean accept(ReadGraph graph, Object input) throws DatabaseException { + return true; + } + + @Override + public boolean accept(ReadGraph graph, Object input, Collection type) throws DatabaseException { + return true; + } + + @Override + public void getContributors(ReadGraph graph, Object input, Integer priority, String label, Collection result) throws DatabaseException { + Collection objects; + if (input instanceof Collection) { + objects = (Collection) input; + } else { + objects = Collections.singletonList(input); + } + + SelectionViewResources SEL = SelectionViewResources.getInstance(graph); + Resource view = graph.getPossibleObject(configuration, SEL.VariableTabContribution_HasView); + if(view == null) { + throw new DatabaseException("No view for " + graph.getPossibleURI(configuration)); + } + + Set actualResult = new HashSet<>(objects.size()); + for (Object obj : objects) { + Resource resource = getPossibleResource(graph, obj); + if (resource == null) + continue; + + Collection ts = graph.getTypes(resource); + + if (!Collections.disjoint(types, ts)) { + Variable variable = Variables.getVariable(graph, resource); + actualResult.add(variable); + } + } + if (!actualResult.isEmpty()) { + final String viewURI = graph.getPossibleURI(view); + result.add(new ComparableTabContributor(new Contribution(viewURI), priority, actualResult, label)); + } + } + + private Resource getPossibleResource(ReadGraph graph, Object obj) { + if (obj instanceof Resource) + return (Resource) obj; + if (obj instanceof WorkbenchSelectionElement) + return ((WorkbenchSelectionElement) obj).getContent(new AnyResource(graph)); + return null; + } +} diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/TypedVariableTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/TypedVariableTabContribution.java index 68d6cdae4..10d4b465d 100644 --- a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/TypedVariableTabContribution.java +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/TypedVariableTabContribution.java @@ -108,13 +108,13 @@ public class TypedVariableTabContribution implements TabContribution { Layer0 L0 = Layer0.getInstance(graph); SelectionViewResources SEL = SelectionViewResources.getInstance(graph); - Collection types = graph.getObjects(configuration, SEL.TypedVariableTabContribution_HasType); + Collection types = graph.getObjects(configuration, SEL.TypedTabContribution_HasType); if(types.isEmpty()) throw new DatabaseException("No type for " + graph.getPossibleURI(configuration)); Resource view = graph.getPossibleObject(configuration, SEL.VariableTabContribution_HasView); if(view == null) { throw new DatabaseException("No view for " + graph.getPossibleURI(configuration)); } - Integer priority = graph.getPossibleRelatedValue(configuration, SEL.VariableTabContribution_HasPriority, Bindings.INTEGER); + Integer priority = graph.getPossibleRelatedValue(configuration, SEL.TabContribution_HasPriority, Bindings.INTEGER); String label = graph.getPossibleRelatedValue(configuration, L0.HasLabel); final String viewURI = graph.getPossibleURI(view); @@ -126,7 +126,7 @@ public class TypedVariableTabContribution implements TabContribution { if (!Collections.disjoint(types, ts)) { - for(Resource r : graph.getObjects(configuration, SEL.VariableTabContribution_HasTest)) { + for(Resource r : graph.getObjects(configuration, SEL.TabContribution_HasTest)) { Boolean pass = Functions.exec(graph, r, graph, variable); if(!pass) return; } diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/VariableTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/VariableTabContribution.java index a3e59985c..2287aab00 100644 --- a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/VariableTabContribution.java +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/VariableTabContribution.java @@ -43,10 +43,10 @@ public class VariableTabContribution implements TabContribution { Resource view = graph.getPossibleObject(configuration, SEL.VariableTabContribution_HasView); if(view == null) throw new DatabaseException("No view for " + graph.getPossibleURI(configuration)); - Integer priority = graph.getPossibleRelatedValue(configuration, SEL.VariableTabContribution_HasPriority, Bindings.INTEGER); + Integer priority = graph.getPossibleRelatedValue(configuration, SEL.TabContribution_HasPriority, Bindings.INTEGER); String label = graph.getPossibleRelatedValue(configuration, L0.HasLabel); - for(Resource r : graph.getObjects(configuration, SEL.VariableTabContribution_HasTest)) { + for(Resource r : graph.getObjects(configuration, SEL.TabContribution_HasTest)) { Boolean pass = Functions.exec(graph, r, graph, variable); if(!pass) return; } -- 2.47.1