X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.interop%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fbrowsing%2FImportNode2.java;h=7d8655a325bf66563af15b6f0035e00b4e783930;hb=4fb2bb0dac3c463447ba22f36aeb0d2358ad6624;hp=8bb6d7492747cf5e15e93a6fec807fa46e8fb2f1;hpb=7f68ba3a14669671b3fc6f79f4c190d467dd1413;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 8bb6d74..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,17 +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.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 { @@ -25,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 @@ -46,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; @@ -72,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)) { @@ -93,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; }