]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/SynchronizationHints.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / synchronization / SynchronizationHints.java
diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/SynchronizationHints.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/SynchronizationHints.java
new file mode 100644 (file)
index 0000000..621cef3
--- /dev/null
@@ -0,0 +1,78 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.diagram.synchronization;\r
+\r
+import org.simantics.g2d.diagram.IDiagram;\r
+import org.simantics.g2d.element.IElement;\r
+import org.simantics.g2d.element.IElementClassProvider;\r
+import org.simantics.project.IProject;\r
+import org.simantics.project.ProjectKeys;\r
+import org.simantics.utils.datastructures.hints.IHintContext;\r
+import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
+import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;\r
+\r
+/**\r
+ * A collection of {@link IHintContext} keys related to graph and diagram\r
+ * synchronization.\r
+ * \r
+ * @author Tuukka Lehtonen\r
+ */\r
+public final class SynchronizationHints {\r
+\r
+    /**\r
+     * A key for associating an {@link ISynchronizationContext} with an\r
+     * {@link IDiagram}.\r
+     */\r
+    public static final Key CONTEXT                = new KeyOf(ISynchronizationContext.class, "SYNCHRONIZATION_CONTEXT");\r
+\r
+    /**\r
+     * A key for associating an {@link IElementClassProvider} with an\r
+     * {@link ISynchronizationContext}.\r
+     */\r
+    public static final Key ELEMENT_CLASS_PROVIDER = new KeyOf(IElementClassProvider.class, "ELEMENT_CLASS_PROVIDER");\r
+\r
+    /**\r
+     * A key for associating an {@link ErrorHandler} with an\r
+     * {@link ISynchronizationContext}.\r
+     */\r
+    public static final Key ERROR_HANDLER          = new KeyOf(ErrorHandler.class, "ERROR_HANDLER");\r
+\r
+    /**\r
+     * A key for associating an {@link IModificationQueue} with an\r
+     * {@link ISynchronizationContext}.\r
+     */\r
+    public static final Key MODIFICATION_QUEUE     = new KeyOf(IModificationQueue.class, "MODIFICATION_QUEUE");\r
+\r
+    /**\r
+     * A key for associating a custom hint synchronizer to an {@link IElement}.\r
+     */\r
+    public static final Key HINT_SYNCHRONIZER      = new KeyOf(IHintSynchronizer.class, "HINT_SYNCHRONIZER");\r
+\r
+    /**\r
+     * A key for defining a {@link CopyAdvisor} to be used with a particular\r
+     * {@link IDiagram}.\r
+     */\r
+    public static final Key COPY_ADVISOR           = new KeyOf(CopyAdvisor.class, "COPY_ADVISOR");\r
+\r
+    /**\r
+     * A key for hinting to a {@link CopyAdvisor} that it should not perform\r
+     * renaming of the copied data.\r
+     */\r
+    public static final Key NO_RENAME              = new KeyOf(Boolean.class, "NO_RENAME");\r
+\r
+    /**\r
+     * A key for retrieving the curretly active project (see {@link IProject})\r
+     * from an {@link ISynchronizationContext}.\r
+     */\r
+    public static final Key PROJECT                = ProjectKeys.KEY_PROJECT;\r
+\r
+}\r