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