From 8491db985ce4dd05614adcefbdf2e5c2154d95ad Mon Sep 17 00:00:00 2001 From: jplaine Date: Fri, 10 Sep 2010 13:37:12 +0000 Subject: [PATCH] ModelBrowser prepared to support images git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17870 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.sysdyn.ui/icons/image_add.png | Bin 0 -> 653 bytes org.simantics.sysdyn.ui/plugin.xml | 19 ++++++++++++++++++ .../sysdyn/ui/browser/SysdynBrowser.java | 2 +- .../ui/browser/nodes/ExperimentsFolder.java | 8 ++++++++ .../sysdyn/ui/browser/nodes/ModulesNode.java | 7 +++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 org.simantics.sysdyn.ui/icons/image_add.png 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 0000000000000000000000000000000000000000..fc5d6139e92b666e12853634ce65d341e56c2879 GIT binary patch literal 653 zcmV;80&@L{P)9Ovu3r^Sp@>J&i__b$%mxew<#AEK)K4_tuGzR_Dj zPEIW+13!^2!Lpmfum?NCj6AtX3WL`1|z0WJO$R6%tkR)SoHv)7)V z2J!;SiNK5OjY!w+2h{D`h38lT^}tkNg#0yvV}#EiXX)>`NH!2DT1ckB7?;L|{Tz(8 z;ur_j0K^3mj0hqIV+lr?y8Vsi$6LOTA8J(bfmHy@>b zcO$Rop0fUa(vNo6-E;xeS_D{{pDQU43O%OnNC$xlI9%J##D`I$O)boS8oT7?XD#2H zp@F_)^gFKH=_e!=bR0Mbz~#1kjL!}OW4;TpGi>5Em#V5QmwXEgf`!BCTAaDqG;d>5 z^tO*M_~HzHzE&w0V25WOoga94ESc3NYfJ6YaewCBwAXT|mGRkO%EV>r%_P8({OdYL nyXyvlE}#-v1%_wt#(IAOCI8(qh + + + + + + + + @@ -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); + } } -- 2.47.1