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