X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fbrowsing%2FImportNode2.java;h=7d8655a325bf66563af15b6f0035e00b4e783930;hb=1ecbc01ed426a6329c4b92ee1abca7dc7f31e5cb;hp=d4122cc0682eedfe9cb7020bfa29f570ca53335d;hpb=82d9794e76d4d3c91d814b7935f24d20fa6e915c;p=simantics%2Finterop.git 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 d4122cc..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,18 +5,11 @@ 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.Builtins; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; -import org.simantics.db.Session; -import org.simantics.db.WriteGraph; import org.simantics.db.exception.DatabaseException; import org.simantics.interop.Activator; import org.simantics.interop.stubs.InteropResource; -import org.simantics.layer0.Layer0; -import org.simantics.modeling.ui.modelBrowser.model.INode; public class ImportNode2 implements INode { @@ -26,15 +19,12 @@ public class ImportNode2 implements INode { this.project = project; } + @SuppressWarnings("rawtypes") @Override public Object getAdapter(Class adapter) { return null; } - - @Override - public int getCategory(ReadGraph graph) throws DatabaseException { - return 0; - } + @Override @@ -47,24 +37,6 @@ public class ImportNode2 implements INode { return "Imports"; } - @Override - public Modifier getModifier(Session session, String columnId) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void handleDelete(WriteGraph graph) throws DatabaseException { - // TODO Auto-generated method stub - - } - - @Override - public void handleDrop(Session session, ISelection selection) { - // TODO Auto-generated method stub - - } - @Override public boolean hasChildren(ReadGraph graph) throws DatabaseException { return getChildren(graph).size() > 0; @@ -73,19 +45,8 @@ public class ImportNode2 implements INode { @Override public Collection getChildren(ReadGraph graph) throws DatabaseException { List nodes = new ArrayList(); - Layer0 l0 = Layer0.getInstance(graph); InteropResource i = InteropResource.getInstance(graph); -// Collection models = graph.getObjects(project, b.ConsistsOf); -// for (Resource m : models) { -// Collection objs = graph.getObjects(m, b.ConsistsOf); -// for (Resource o : objs) { -// if (graph.isInstanceOf(o, i.ImportLibrary)) { -// INode node = graph.adapt(o, INode.class); -// nodes.add(node); -// } -// } -// } - //Collection objs = graph.getObjects(project, b.ConsistsOf); + Collection objs = graph.getObjects(project, i.HasImportData); for (Resource o : objs) { if (graph.isInstanceOf(o, i.ImportLibrary)) { @@ -94,23 +55,12 @@ public class ImportNode2 implements INode { } } return nodes; - -// ComosResource c = ComosResource.getInstance(graph); -// Collection models = graph.getObjects(project, b.ConsistsOf); -// Collection comosImports = new ArrayList(); -// for (Resource m : models) { -// Collection objs = graph.getObjects(m, b.ConsistsOf); -// for (Resource o : objs) { -// if (graph.isInstanceOf(o, c.ComosImportLibrary)) { -// String icon_db_path = ComosGraphTools.getIconPath(o, graph); -// if (icon_db_path == null) -// continue; -// ComosIconReader iconReader = new ComosIconReader(icon_db_path); -// comosImports.add(new ComosGraphNode(o, iconReader)); -// } -// } -// } -// return comosImports; + + } + + @Override + public int getCategory(ReadGraph graph) throws DatabaseException { + return 0; }