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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.ui.workbench;
\r
14 import org.eclipse.core.runtime.IAdaptable;
\r
15 import org.eclipse.ui.IEditorInput;
\r
16 import org.simantics.db.ReadGraph;
\r
17 import org.simantics.db.Resource;
\r
18 import org.simantics.db.common.ResourceArray;
\r
19 import org.simantics.db.exception.DatabaseException;
\r
22 * @author Tuukka Lehtonen
\r
24 * @see IResourceEditorInput2
\r
25 * @see ResourceEditorInput
\r
26 * @see ResourceEditorInput2
\r
28 public interface IResourceEditorInput extends IEditorInput {
\r
31 * @param adapter not needed anymore since 1.6, may be <code>null</code>
\r
33 void init(IAdaptable adapter) throws DatabaseException;
\r
36 * Release any strong references to resources held by this editor input.
\r
37 * Does nothing when called multiple times.
\r
42 * @return the same as getResourceArray().get(0) or <code>null</code> if
\r
43 * resource does not exist, i.e. getResourceArray returns an empty
\r
46 Resource getResource();
\r
49 * @return <code>null</code> if resource does not exist
\r
51 ResourceArray getResourceArray();
\r
54 * For checking the existence of the resource input from the given graph.
\r
59 boolean exists(ReadGraph g) throws DatabaseException;
\r
62 * Needs to be called on every update by the related editor part to keep the
\r
63 * cached data coherent with the graph model.
\r
67 void update(ReadGraph g) throws DatabaseException;
\r