import org.simantics.db.exception.DatabaseException;\r
import org.simantics.interop.Activator;\r
import org.simantics.interop.stubs.InteropResource;\r
-import org.simantics.layer0.Layer0;\r
import org.simantics.modeling.ui.modelBrowser.model.INode;\r
\r
+@SuppressWarnings("deprecation")\r
public class ImportNode implements INode {\r
\r
//private Resource project;\r
this.model = project;\r
}\r
\r
+ @SuppressWarnings("rawtypes")\r
@Override\r
public Object getAdapter(Class adapter) {\r
return null;\r
@Override\r
public Collection<?> getChildren(ReadGraph graph) throws DatabaseException {\r
List<INode> nodes = new ArrayList<INode>();\r
- Layer0 l0 = Layer0.getInstance(graph);\r
InteropResource i = InteropResource.getInstance(graph);\r
-// Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
-// for (Resource m : models) {\r
-// Collection<Resource> objs = graph.getObjects(m, b.ConsistsOf);\r
-// for (Resource o : objs) {\r
-// if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
-// INode node = graph.adapt(o, INode.class);\r
-// nodes.add(node);\r
-// }\r
-// }\r
-// }\r
- //Collection<Resource> objs = graph.getObjects(model, b.ConsistsOf);\r
+ \r
Collection<Resource> objs = graph.getObjects(model, i.HasImportData);\r
for (Resource o : objs) {\r
if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
}\r
return nodes;\r
\r
-// ComosResource c = ComosResource.getInstance(graph);\r
-// Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
-// Collection<ComosGraphNode> comosImports = new ArrayList<ComosGraphNode>();\r
-// for (Resource m : models) {\r
-// Collection<Resource> objs = graph.getObjects(m, b.ConsistsOf);\r
-// for (Resource o : objs) {\r
-// if (graph.isInstanceOf(o, c.ComosImportLibrary)) {\r
-// String icon_db_path = ComosGraphTools.getIconPath(o, graph);\r
-// if (icon_db_path == null)\r
-// continue;\r
-// ComosIconReader iconReader = new ComosIconReader(icon_db_path);\r
-// comosImports.add(new ComosGraphNode(o, iconReader));\r
-// }\r
-// }\r
-// }\r
-// return comosImports;\r
}\r
\r
\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.interop.Activator;\r
import org.simantics.interop.stubs.InteropResource;\r
-import org.simantics.layer0.Layer0;\r
import org.simantics.modeling.ui.modelBrowser.model.INode;\r
\r
+@SuppressWarnings("deprecation")\r
public class ImportNode2 implements INode {\r
\r
private Resource project;\r
this.project = project;\r
}\r
\r
+ @SuppressWarnings("rawtypes")\r
@Override\r
public Object getAdapter(Class adapter) {\r
return null;\r
@Override\r
public Collection<?> getChildren(ReadGraph graph) throws DatabaseException {\r
List<INode> nodes = new ArrayList<INode>();\r
- Layer0 l0 = Layer0.getInstance(graph);\r
InteropResource i = InteropResource.getInstance(graph);\r
-// Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
-// for (Resource m : models) {\r
-// Collection<Resource> objs = graph.getObjects(m, b.ConsistsOf);\r
-// for (Resource o : objs) {\r
-// if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
-// INode node = graph.adapt(o, INode.class);\r
-// nodes.add(node);\r
-// }\r
-// }\r
-// }\r
- //Collection<Resource> objs = graph.getObjects(project, b.ConsistsOf);\r
+\r
Collection<Resource> objs = graph.getObjects(project, i.HasImportData);\r
for (Resource o : objs) {\r
if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
}\r
}\r
return nodes;\r
- \r
-// ComosResource c = ComosResource.getInstance(graph);\r
-// Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
-// Collection<ComosGraphNode> comosImports = new ArrayList<ComosGraphNode>();\r
-// for (Resource m : models) {\r
-// Collection<Resource> objs = graph.getObjects(m, b.ConsistsOf);\r
-// for (Resource o : objs) {\r
-// if (graph.isInstanceOf(o, c.ComosImportLibrary)) {\r
-// String icon_db_path = ComosGraphTools.getIconPath(o, graph);\r
-// if (icon_db_path == null)\r
-// continue;\r
-// ComosIconReader iconReader = new ComosIconReader(icon_db_path);\r
-// comosImports.add(new ComosGraphNode(o, iconReader));\r
-// }\r
-// }\r
-// }\r
-// return comosImports;\r
+\r
}\r
\r
\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.interop.stubs.InteropResource;\r
-import org.simantics.layer0.Layer0;\r
import org.simantics.modeling.ui.modelBrowser.model.INode;\r
\r
+@SuppressWarnings("deprecation")\r
public class InteropChildRule implements ChildRule{\r
@Override\r
public boolean isCompatible(Class<?> contentType) {\r
return Resource.class.isAssignableFrom(contentType);\r
}\r
- @Override\r
+ @Override\r
public Collection<?> getChildren(ReadGraph graph, Object parent_)\r
throws DatabaseException {\r
Resource parent = (Resource)parent_;\r
\r
import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.interop.browsing.ImportNode;\r
-import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ui.modelBrowser.model.INode;\r
import org.simantics.structural.ui.modelBrowser.nodes.ModelNode;\r
\r
\r
+@SuppressWarnings("deprecation")\r
public class Contributor1 extends ViewpointContributor<ModelNode> {\r
\r
\r
public Collection<?> getContribution(ReadGraph graph, ModelNode input)\r
throws DatabaseException {\r
Collection<INode> nodes = new ArrayList<INode>();\r
- System.out.println("Contributor 1 " + input + " " + GraphUtils.getReadableName(graph, input.resource));\r
nodes.add(new ImportNode(input.resource));\r
return nodes;\r
}\r
\r
\r
}\r
-//public class Contributor1 extends ViewpointContributor<Resource> {\r
-//\r
-// \r
-// public Contributor1() {\r
-// super();\r
-// }\r
-// @Override\r
-// public Collection<?> getContribution(ReadGraph graph, Resource input)\r
-// throws DatabaseException {\r
-// Collection<INode> nodes = new ArrayList<INode>();\r
-// System.out.println("Contributor 1 " + input + " " + GraphUtils.getReadableName(graph, input));\r
-// nodes.add(new ImportNode(input));\r
-// return nodes;\r
-// }\r
-// \r
-// @Override\r
-// public String getViewpointId() {\r
-// return "Standard";\r
-// }\r
-// \r
-// \r
-//\r
-//}\r
+\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.interop.browsing.ImportNode2;\r
-import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ui.modelBrowser.model.INode;\r
\r
\r
+@SuppressWarnings("deprecation")\r
public class Contributor2 extends ViewpointContributor<Resource> {\r
\r
\r
public Collection<?> getContribution(ReadGraph graph, Resource input)\r
throws DatabaseException {\r
Collection<INode> nodes = new ArrayList<INode>();\r
- System.out.println("Contributor 2 " + input + " " + GraphUtils.getReadableName(graph, input));\r
nodes.add(new ImportNode2(input));\r
return nodes;\r
}\r
\r
import java.util.Collection;\r
\r
-import org.eclipse.jface.resource.JFaceResources;\r
-import org.eclipse.jface.resource.LocalResourceManager;\r
-import org.eclipse.swt.widgets.Display;\r
import org.simantics.browsing.ui.common.EvaluatorData.Evaluator;\r
import org.simantics.browsing.ui.common.extension.EvaluatorFactory;\r
import org.simantics.modeling.ui.modelBrowser.ModelEvaluators;\r
import org.simantics.modeling.ui.modelBrowser.model.INode;\r
-import org.simantics.ui.SimanticsUI;\r
\r
+@SuppressWarnings("deprecation")\r
public class EvaluatorFactory1 implements EvaluatorFactory {\r
\r
public EvaluatorFactory1() {\r
- // TODO Auto-generated constructor stub\r
}\r
\r
@Override\r
}\r
\r
\r
+ @SuppressWarnings("unchecked")\r
@Override\r
public Object[] getElements(Object inputElement) {\r
Collection<Issue> issues = (Collection<Issue>)inputElement;\r
}\r
}\r
\r
+ @SuppressWarnings("unchecked")\r
@Override\r
public int compare(Viewer viewer, Object e1, Object e2) {\r
\r