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