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