]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ResourceCopyRepresentation.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / ResourceCopyRepresentation.java
diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ResourceCopyRepresentation.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ResourceCopyRepresentation.java
new file mode 100644 (file)
index 0000000..b299295
--- /dev/null
@@ -0,0 +1,30 @@
+package org.simantics.db.layer0.util;\r
+\r
+import java.util.Collection;\r
+import java.util.Map;\r
+\r
+import org.simantics.db.RequestProcessor;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.layer0.util.SimanticsClipboard.Representation;\r
+import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
+\r
+class ResourceCopyRepresentation implements Representation {\r
+\r
+    private Collection<Resource> resources;\r
+\r
+    public ResourceCopyRepresentation(Collection<Resource> resources) {\r
+        this.resources = resources;\r
+    }\r
+\r
+    @Override\r
+    public Key getKey() {\r
+        return SimanticsKeys.KEY_COPY_RESOURCES;\r
+    }\r
+\r
+    @SuppressWarnings("unchecked")\r
+    @Override\r
+    public <T> T getValue(RequestProcessor processor, Map<String,Object> hints) {\r
+        return (T) resources;\r
+    }\r
+\r
+}
\ No newline at end of file