]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.ui/src/org/simantics/ui/workbench/IResourceEditorInput2.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.ui / src / org / simantics / ui / workbench / IResourceEditorInput2.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.ui.workbench;\r
13 \r
14 import org.eclipse.ui.IEditorInput;\r
15 import org.simantics.db.ReadGraph;\r
16 import org.simantics.db.Resource;\r
17 import org.simantics.db.exception.DatabaseException;\r
18 import org.simantics.db.layer0.variable.Variable;\r
19 \r
20 /**\r
21  * @author Tuukka Lehtonen\r
22  * \r
23  * @see ResourceEditorInput2\r
24  */\r
25 public interface IResourceEditorInput2 extends IEditorInput, IResourceEditorInput {\r
26 \r
27     /**\r
28          * This is a base URI, not a model URI but the name of the method cannot be\r
29          * changed now. If {@link #getRVI()} returns <code>null</code>, this URI\r
30          * should be used as such to get a {@link Variable} view of the input.\r
31          * \r
32          * @return URI of the model the input is related to or <code>null</code> if\r
33          *         no model is available\r
34          */\r
35 //    String getModelURI();\r
36 \r
37     Resource getModel(ReadGraph graph);\r
38     \r
39     /**\r
40          * @return a {@link Variable} Relative Variable Identifier (RVI). May be an\r
41          *         empty string or <code>null</code> if {@link #getModelURI()}\r
42          *         should be interpreted as the absolute {@link Variable} URI of the\r
43          *         input.\r
44          */\r
45     String getRVI();\r
46 \r
47     /**\r
48      * Adapt this editor input into a {@link Variable} outside of a database\r
49      * transaction.\r
50      * \r
51      * @return\r
52      * @throws DatabaseException if variable adaption fails\r
53      * @since 1.6\r
54      */\r
55     Variable getVariable() throws DatabaseException;\r
56 \r
57     /**\r
58      * Adapt this editor input into a {@link Variable} within a database\r
59      * transaction.\r
60      * \r
61      * @param graph\r
62      * @return\r
63      * @throws DatabaseException if variable adaption fails\r
64      * @since 1.6\r
65      */\r
66     Variable getVariable(ReadGraph graph) throws DatabaseException;\r
67 \r
68 }\r