]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ResourcePair.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.diagram.profile / src / org / simantics / diagram / profile / view / ResourcePair.java
diff --git a/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ResourcePair.java b/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ResourcePair.java
new file mode 100644 (file)
index 0000000..3aab7e2
--- /dev/null
@@ -0,0 +1,22 @@
+package org.simantics.diagram.profile.view;\r
+\r
+import org.eclipse.core.runtime.IAdaptable;\r
+import org.simantics.db.Resource;\r
+import org.simantics.utils.datastructures.map.Tuple;\r
+\r
+public class ResourcePair extends Tuple implements IAdaptable{\r
+    ResourcePair(Resource first, Resource second) { super(first ,second); }\r
+    public Resource getFirst() { return (Resource) getField(0); }\r
+    public Resource getSecond() { return (Resource) getField(1); }\r
+       \r
+    @SuppressWarnings("rawtypes")\r
+       @Override\r
+       public Object getAdapter(Class adapter) {\r
+               if (adapter == Resource.class) {\r
+                       return getSecond();\r
+               }\r
+               return null;\r
+       }\r
+    \r
+    \r
+}
\ No newline at end of file