]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.diagram.synchronization;\r
13 \r
14 import org.simantics.g2d.diagram.IDiagram;\r
15 import org.simantics.g2d.element.IElement;\r
16 import org.simantics.g2d.element.IElementClassProvider;\r
17 import org.simantics.project.IProject;\r
18 import org.simantics.project.ProjectKeys;\r
19 import org.simantics.utils.datastructures.hints.IHintContext;\r
20 import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
21 import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;\r
22 \r
23 /**\r
24  * A collection of {@link IHintContext} keys related to graph and diagram\r
25  * synchronization.\r
26  * \r
27  * @author Tuukka Lehtonen\r
28  */\r
29 public final class SynchronizationHints {\r
30 \r
31     /**\r
32      * A key for associating an {@link ISynchronizationContext} with an\r
33      * {@link IDiagram}.\r
34      */\r
35     public static final Key CONTEXT                = new KeyOf(ISynchronizationContext.class, "SYNCHRONIZATION_CONTEXT");\r
36 \r
37     /**\r
38      * A key for associating an {@link IElementClassProvider} with an\r
39      * {@link ISynchronizationContext}.\r
40      */\r
41     public static final Key ELEMENT_CLASS_PROVIDER = new KeyOf(IElementClassProvider.class, "ELEMENT_CLASS_PROVIDER");\r
42 \r
43     /**\r
44      * A key for associating an {@link ErrorHandler} with an\r
45      * {@link ISynchronizationContext}.\r
46      */\r
47     public static final Key ERROR_HANDLER          = new KeyOf(ErrorHandler.class, "ERROR_HANDLER");\r
48 \r
49     /**\r
50      * A key for associating an {@link IModificationQueue} with an\r
51      * {@link ISynchronizationContext}.\r
52      */\r
53     public static final Key MODIFICATION_QUEUE     = new KeyOf(IModificationQueue.class, "MODIFICATION_QUEUE");\r
54 \r
55     /**\r
56      * A key for associating a custom hint synchronizer to an {@link IElement}.\r
57      */\r
58     public static final Key HINT_SYNCHRONIZER      = new KeyOf(IHintSynchronizer.class, "HINT_SYNCHRONIZER");\r
59 \r
60     /**\r
61      * A key for defining a {@link CopyAdvisor} to be used with a particular\r
62      * {@link IDiagram}.\r
63      */\r
64     public static final Key COPY_ADVISOR           = new KeyOf(CopyAdvisor.class, "COPY_ADVISOR");\r
65 \r
66     /**\r
67      * A key for hinting to a {@link CopyAdvisor} that it should not perform\r
68      * renaming of the copied data.\r
69      */\r
70     public static final Key NO_RENAME              = new KeyOf(Boolean.class, "NO_RENAME");\r
71 \r
72     /**\r
73      * A key for retrieving the curretly active project (see {@link IProject})\r
74      * from an {@link ISynchronizationContext}.\r
75      */\r
76     public static final Key PROJECT                = ProjectKeys.KEY_PROJECT;\r
77 \r
78 }\r