]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/content/ContributionViewpoint.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.browsing.ui / src / org / simantics / browsing / ui / content / ContributionViewpoint.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.browsing.ui.content;
13
14 import java.util.Collection;
15
16 import org.simantics.browsing.ui.GraphExplorer;
17 import org.simantics.browsing.ui.NodeContext;
18 import org.simantics.browsing.ui.PrimitiveQueryUpdater;
19
20 /**
21  * A Viewpoint is used for describing the child node generation of a single UI
22  * (e.g. tree) node. Viewpoints are created on a per UI node basis, including
23  * the invisible root input of provided to
24  * {@link GraphExplorer#setRoot(Object)}. Viewpoints are created by
25  * {@link ViewpointFactory}s.
26  * 
27  * <p>
28  * A Viewpoint is responsible for informing of any changes happening in the set
29  * of children provided by it. Updates are performed using the
30  * {@link PrimitiveQueryUpdater} received by the {@link ViewpointFactory} that
31  * created the Viewpoint. To signal that the set of children has (possibly)
32  * changed, invoke
33  * {@link PrimitiveQueryUpdater#scheduleReplace(NodeContext, org.simantics.browsing.ui.NodeContext.PrimitiveQueryKey, Object)}
34  * and eventually the query system will re-request the viewpoint for the new
35  * children.
36  * </p>
37  * 
38  * @author Antti Villberg
39  * 
40  * @see ViewpointStub
41  */
42 public interface ContributionViewpoint {
43
44     Collection<ViewpointContributionFactory> getContributions();
45
46 }