From: jplaine Date: Fri, 10 Sep 2010 13:37:12 +0000 (+0000) Subject: ModelBrowser prepared to support images X-Git-Tag: simantics-1.2.0~52 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=8491db985ce4dd05614adcefbdf2e5c2154d95ad;p=simantics%2Fsysdyn.git ModelBrowser prepared to support images git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17870 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/icons/image_add.png b/org.simantics.sysdyn.ui/icons/image_add.png new file mode 100644 index 00000000..fc5d6139 Binary files /dev/null and b/org.simantics.sysdyn.ui/icons/image_add.png differ diff --git a/org.simantics.sysdyn.ui/plugin.xml b/org.simantics.sysdyn.ui/plugin.xml index ebd75576..9c1f08f3 100644 --- a/org.simantics.sysdyn.ui/plugin.xml +++ b/org.simantics.sysdyn.ui/plugin.xml @@ -243,6 +243,21 @@ + + + + + + + + @@ -437,6 +452,10 @@ args="org.simantics.sysdyn.ui.browser.nodes.ModuleTypeNode" property="org.simantics.sysdyn.ui.nodeClass"> + + diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java index 97b57c67..bfb49594 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java @@ -38,7 +38,7 @@ import org.simantics.utils.datastructures.hints.IHintContext; public class SysdynBrowser extends GraphExplorerView { // private static final Set browseContexts = Collections.singleton("http://www.simantics.org/Sysdyn-1.0/Browser"); - private static final Set browseContexts = new HashSet(Arrays.asList("http://www.simantics.org/Sysdyn-1.0/Browser", "http://www.simantics.org/Operating-1.0/Browser")); + private static final Set browseContexts = new HashSet(Arrays.asList("http://www.simantics.org/Sysdyn-1.0/Browser", "http://www.simantics.org/Operating-1.0/Browser", "http://www.simantics.org/Image-1.0/Browser")); private BinaryFunction selectionTransformation = new BinaryFunction() { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java index 82626d46..e8b22350 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java @@ -19,5 +19,13 @@ public class ExperimentsFolder extends AbstractNode { public ExperimentsFolder(Resource resource) { super(resource); } + + @SuppressWarnings("unchecked") + @Override + public Object getAdapter(Class adapter) { + if(clazz == adapter) // There is no resource for this node.. + return null; + return super.getAdapter(adapter); + } } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java index 4132b921..d52ab4f2 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java @@ -20,5 +20,12 @@ public class ModulesNode extends AbstractNode { super(resource); } + @SuppressWarnings("unchecked") + @Override + public Object getAdapter(Class adapter) { + if(clazz == adapter) // There is no resource for this node.. + return null; + return super.getAdapter(adapter); + } }