]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/SimanticsKeys.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / SimanticsKeys.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.db.layer0.util;
13
14 import java.util.Collection;
15
16 import org.simantics.databoard.container.DataContainer;
17 import org.simantics.db.Resource;
18 import org.simantics.db.layer0.internal.SimanticsInternal;
19 import org.simantics.db.layer0.util.SimanticsClipboard.Representation;
20 import org.simantics.db.layer0.variable.Variable;
21 import org.simantics.graph.representation.TransferableGraph1;
22 import org.simantics.utils.datastructures.hints.IHintContext.Key;
23 import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;
24
25 /**
26  * For dealing with clipboard-related keys listed in this class, see the 
27  * utility methods listed as <code>see</code> in this class.
28  * 
29  * @see SimanticsInternal#getClipboard()
30  * @see SimanticsClipboard#getContents()
31  * @see ClipboardUtils#accept(java.util.Set, Key)
32  * @see ClipboardUtils#accept(org.simantics.db.ReadGraph, java.util.Set, Key)
33  */
34 public interface SimanticsKeys {
35
36     /**
37      * A key for storing the resource of the current project in an IHintContext.
38      * This is used with ISessionContext.
39      */
40     Key KEY_PROJECT            = new KeyOf(Resource.class, "PROJECT_RESOURCE");
41
42     /**
43      * A key for storing the cut/copied transferable graph in a
44      * {@link SimanticsClipboard} instance as an available
45      * {@link Representation} for the clipboard data.
46      */
47     Key KEY_TRANSFERABLE_GRAPH = new KeyOf(TransferableGraph1.class, "TRANSFERABLE_GRAPH");
48
49     /**
50      * A key for storing the cut/copied transferable graph source in a
51      * {@link SimanticsClipboard} instance as an available
52      * {@link Representation} for the clipboard data.
53      */
54     Key KEY_TRANSFERABLE_GRAPH_SOURCE = new KeyOf(TransferableGraph1.class, "TRANSFERABLE_GRAPH_SOURCE");
55
56     /**
57      * A key for storing the cut/copied DataContainer in a
58      * {@link SimanticsClipboard} instance as an available
59      * {@link Representation} for the clipboard data.
60      */
61     Key KEY_DATA_CONTAINER = new KeyOf(DataContainer.class, "DATA_CONTAINER");
62
63     /**
64      * A key for storing the original source {@link Resource} of a copy
65      * operation in a {@link SimanticsClipboard} instance as an available
66      * {@link Representation} for the clipboard data.
67      */
68     Key KEY_COPY_RESOURCES      = new KeyOf(Collection.class, "COPY_RESOURCE");
69
70     /**
71      * A key for storing the original source {@link Resource} of a cut operation
72      * in a {@link SimanticsClipboard} instance as an available
73      * {@link Representation} for the clipboard data.
74      */
75     Key KEY_CUT_RESOURCES       = new KeyOf(Collection.class, "CUT_RESOURCE");
76
77     /**
78      * A key for storing the original copied {@link Variable} in a
79      * {@link SimanticsClipboard} instance as an available
80      * {@link Representation} for the clipboard data.
81      */
82     Key KEY_VARIABLE           = new KeyOf(Variable.class, "VARIABLE");
83
84 }