X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2FPrimitiveQueryUpdater.java;fp=bundles%2Forg.simantics.browsing.ui%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2FPrimitiveQueryUpdater.java;h=ec4137b739892ba4ea4be337aece132ab5bdbe14;hp=0000000000000000000000000000000000000000;hb=969bd23cab98a79ca9101af33334000879fb60c5;hpb=866dba5cd5a3929bbeae85991796acb212338a08 diff --git a/bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/PrimitiveQueryUpdater.java b/bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/PrimitiveQueryUpdater.java new file mode 100644 index 000000000..ec4137b73 --- /dev/null +++ b/bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/PrimitiveQueryUpdater.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.browsing.ui; + +import org.simantics.browsing.ui.NodeContext.PrimitiveQueryKey; +import org.simantics.browsing.ui.exception.NoDataSourceException; + +/** + * + */ +public interface PrimitiveQueryUpdater { + + /** + * A unique object representing a certain exploring context. This must be + * different for separate graph explorer instances. + * + * @return an object representing the current exploring context + */ + Object getExplorerContext(); + + /** + * @param + * @param clazz + * @return null if no data source is available + */ + DataSource tryGetDataSource(Class clazz); + + /** + * @param + * @param clazz + * @return a data source of the requested type. + * @throws NoDataSourceException if data source was not found + */ + DataSource getDataSource(Class clazz) throws NoDataSourceException; + + /** + * @param + * @param context + * @param key + * @param newResult + */ + void scheduleReplace(NodeContext context, PrimitiveQueryKey key, T newResult); + // void scheduleClear(INodeContext context, PrimitiveQueryKey key); + + /** + * Tells whether this primitive query updater is disposed or not. Don't use + * the updater after it is disposed. Disposal always happens in the UI + * thread. + * + * @return true if disposed + */ + boolean isDisposed(); + boolean isShown(NodeContext context); + + void incRef(NodeContext context); + void decRef(NodeContext context); + +} \ No newline at end of file