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.browsing.ui;
\r
14 import org.simantics.browsing.ui.NodeContext.PrimitiveQueryKey;
\r
15 import org.simantics.browsing.ui.exception.NoDataSourceException;
\r
20 public interface PrimitiveQueryUpdater {
\r
23 * A unique object representing a certain exploring context. This must be
\r
24 * different for separate graph explorer instances.
\r
26 * @return an object representing the current exploring context
\r
28 Object getExplorerContext();
\r
33 * @return <code>null</code> if no data source is available
\r
35 <T> DataSource<T> tryGetDataSource(Class<T> clazz);
\r
40 * @return a data source of the requested type.
\r
41 * @throws NoDataSourceException if data source was not found
\r
43 <T> DataSource<T> getDataSource(Class<T> clazz) throws NoDataSourceException;
\r
51 <T> void scheduleReplace(NodeContext context, PrimitiveQueryKey<T> key, T newResult);
\r
52 // <T> void scheduleClear(INodeContext context, PrimitiveQueryKey<T> key);
\r
55 * Tells whether this primitive query updater is disposed or not. Don't use
\r
56 * the updater after it is disposed. Disposal always happens in the UI
\r
59 * @return <code>true</code> if disposed
\r
61 boolean isDisposed();
\r
62 boolean isShown(NodeContext context);
\r
64 void incRef(NodeContext context);
\r
65 void decRef(NodeContext context);
\r