From 1ecbc01ed426a6329c4b92ee1abca7dc7f31e5cb Mon Sep 17 00:00:00 2001 From: luukkainen Date: Tue, 20 Sep 2011 16:19:41 +0000 Subject: [PATCH] INode cleanup git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@22349 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.interop/graph.tg | Bin 2041 -> 2027 bytes org.simantics.interop/graph/Interop.pgraph | 2 +- .../org/simantics/interop/browsing/INode.java | 5 ---- .../interop/browsing/INodeEvaluators.java | 28 ++++++++---------- .../interop/browsing/ImportNode.java | 27 +++++------------ .../interop/browsing/ImportNode2.java | 26 ++++------------ 6 files changed, 27 insertions(+), 61 deletions(-) diff --git a/org.simantics.interop/graph.tg b/org.simantics.interop/graph.tg index 164cb48bf5d912fe7248650f2fcb4ca7d6843754..e4f909a43660bcc93c5cfe6e4d3539fe3df94757 100644 GIT binary patch delta 44 zcmey#|C)b8FS~-ON`6tgUU6n_VqQsRa getChildren(ReadGraph graph) throws DatabaseException; boolean hasChildren(ReadGraph graph) throws DatabaseException; ImageDescriptor getImage(ReadGraph graph) throws DatabaseException; - void handleDrop(Session session, ISelection selection); - Modifier getModifier(Session session, String columnId); } diff --git a/org.simantics.interop/src/org/simantics/interop/browsing/INodeEvaluators.java b/org.simantics.interop/src/org/simantics/interop/browsing/INodeEvaluators.java index e6216ed..97c8e29 100644 --- a/org.simantics.interop/src/org/simantics/interop/browsing/INodeEvaluators.java +++ b/org.simantics.interop/src/org/simantics/interop/browsing/INodeEvaluators.java @@ -6,16 +6,15 @@ import java.util.Map; import org.eclipse.jface.resource.ImageDescriptor; import org.simantics.browsing.ui.BuiltinKeys; -import org.simantics.browsing.ui.DataSource; -import org.simantics.browsing.ui.NodeContext; -import org.simantics.browsing.ui.PrimitiveQueryUpdater; import org.simantics.browsing.ui.BuiltinKeys.ImagerKey; import org.simantics.browsing.ui.BuiltinKeys.LabelerKey; import org.simantics.browsing.ui.BuiltinKeys.ViewpointKey; -import org.simantics.browsing.ui.GraphExplorer.ModificationContext; +import org.simantics.browsing.ui.DataSource; +import org.simantics.browsing.ui.NodeContext; +import org.simantics.browsing.ui.PrimitiveQueryUpdater; import org.simantics.browsing.ui.common.ColumnKeys; -import org.simantics.browsing.ui.common.EvaluatorImpl; import org.simantics.browsing.ui.common.EvaluatorData.Evaluator; +import org.simantics.browsing.ui.common.EvaluatorImpl; import org.simantics.browsing.ui.common.comparators.AlphanumericComparatorFactory; import org.simantics.browsing.ui.common.imagers.ContainerImager; import org.simantics.browsing.ui.content.Imager; @@ -32,7 +31,6 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.modeling.ui.modelBrowser.model.IChildrenCallback; import org.simantics.modeling.ui.modelBrowser.model.IDisposable; import org.simantics.modeling.ui.modelBrowser.model.IUpdateable; -import org.simantics.ui.SimanticsUI; import org.simantics.utils.datastructures.Callable; import org.simantics.utils.datastructures.Callback; @@ -140,15 +138,15 @@ class NodeLabelerFactory implements LabelerFactory { ((INode) context.getConstant(BuiltinKeys.INPUT)).getLabel(graph)); } - @Override - public Modifier getModifier(ModificationContext sourcePart, String key) { - return ((INode) context.getConstant(BuiltinKeys.INPUT)).getModifier(SimanticsUI.getSession(), key); - } - - @Override - public int category(ReadGraph graph) throws DatabaseException { - return ((INode) context.getConstant(BuiltinKeys.INPUT)).getCategory(graph); - } +// @Override +// public Modifier getModifier(ModificationContext sourcePart, String key) { +// return ((INode) context.getConstant(BuiltinKeys.INPUT)).getModifier(SimanticsUI.getSession(), key); +// } +// +// @Override +// public int category(ReadGraph graph) throws DatabaseException { +// return ((INode) context.getConstant(BuiltinKeys.INPUT)).getCategory(graph); +// } }; } } diff --git a/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode.java b/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode.java index 386dbf5..18296c6 100644 --- a/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode.java +++ b/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode.java @@ -5,11 +5,8 @@ import java.util.Collection; import java.util.List; import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.ISelection; -import org.simantics.browsing.ui.content.Labeler.Modifier; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; -import org.simantics.db.Session; import org.simantics.db.exception.DatabaseException; import org.simantics.interop.Activator; import org.simantics.interop.stubs.InteropResource; @@ -27,12 +24,7 @@ public class ImportNode implements INode { public Object getAdapter(Class adapter) { return null; } - - @Override - public int getCategory(ReadGraph graph) throws DatabaseException { - return 0; - } - + @Override public ImageDescriptor getImage(ReadGraph graph) throws DatabaseException { @@ -43,17 +35,7 @@ public class ImportNode implements INode { public String getLabel(ReadGraph graph) throws DatabaseException { return "Imports"; } - - @Override - public Modifier getModifier(Session session, String columnId) { - return null; - } - - - @Override - public void handleDrop(Session session, ISelection selection) { - - } + @Override public boolean hasChildren(ReadGraph graph) throws DatabaseException { @@ -76,5 +58,10 @@ public class ImportNode implements INode { } + @Override + public int getCategory(ReadGraph graph) throws DatabaseException { + return 0; + } + } diff --git a/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java b/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java index e1f81d0..7d8655a 100644 --- a/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java +++ b/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java @@ -5,11 +5,8 @@ import java.util.Collection; import java.util.List; import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.ISelection; -import org.simantics.browsing.ui.content.Labeler.Modifier; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; -import org.simantics.db.Session; import org.simantics.db.exception.DatabaseException; import org.simantics.interop.Activator; import org.simantics.interop.stubs.InteropResource; @@ -27,11 +24,7 @@ public class ImportNode2 implements INode { public Object getAdapter(Class adapter) { return null; } - - @Override - public int getCategory(ReadGraph graph) throws DatabaseException { - return 0; - } + @Override @@ -44,18 +37,6 @@ public class ImportNode2 implements INode { return "Imports"; } - @Override - public Modifier getModifier(Session session, String columnId) { - return null; - } - - - - @Override - public void handleDrop(Session session, ISelection selection) { - - } - @Override public boolean hasChildren(ReadGraph graph) throws DatabaseException { return getChildren(graph).size() > 0; @@ -77,5 +58,10 @@ public class ImportNode2 implements INode { } + @Override + public int getCategory(ReadGraph graph) throws DatabaseException { + return 0; + } + } -- 2.47.1