]> gerrit.simantics Code Review - simantics/interop.git/blob - org.simantics.interop/src/org/simantics/interop/handlers/Contributor1.java
26d63a6bf2e34412d5c98d5f587d24dcfbe90f8f
[simantics/interop.git] / org.simantics.interop / src / org / simantics / interop / handlers / Contributor1.java
1 package org.simantics.interop.handlers;\r
2 \r
3 import java.util.ArrayList;\r
4 import java.util.Collection;\r
5 \r
6 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
7 import org.simantics.db.ReadGraph;\r
8 import org.simantics.db.Resource;\r
9 import org.simantics.db.exception.DatabaseException;\r
10 import org.simantics.interop.browsing.ImportNode;\r
11 import org.simantics.layer0.utils.direct.GraphUtils;\r
12 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
13 \r
14 public class Contributor1 extends ViewpointContributor<Resource> {\r
15 \r
16         \r
17         public Contributor1() {\r
18                 super();\r
19         }\r
20         @Override\r
21         public Collection<?> getContribution(ReadGraph graph, Resource input)\r
22                         throws DatabaseException {\r
23                 Collection<INode> nodes = new ArrayList<INode>();\r
24                 System.out.println("Contributor 1 " + input + " " + GraphUtils.getReadableName(graph, input));\r
25                 nodes.add(new ImportNode(input));\r
26                 return nodes;\r
27         }\r
28         \r
29         @Override\r
30         public String getViewpointId() {\r
31                 return "Standard";\r
32         }\r
33         \r
34         \r
35 \r
36 }\r