]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/processors/IsExpandedProcessor.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.browsing.ui.common / src / org / simantics / browsing / ui / common / processors / IsExpandedProcessor.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.common.processors;
13
14 import java.util.Collection;
15
16 import org.simantics.browsing.ui.GraphExplorer;
17 import org.simantics.browsing.ui.NodeContext;
18
19 /**
20  * @author Tuukka Lehtonen
21  */
22 public interface IsExpandedProcessor {
23
24     /**
25      * @return all expanded nodes in the owner {@link GraphExplorer}
26      */
27     Collection<NodeContext> getExpanded();
28
29     /**
30      * @param context the context to test for expandedness
31      * @return <code>true</code> if expanded
32      */
33     boolean getExpanded(NodeContext context);
34
35     /**
36      * Set internal processor expanded status without notifying the graph
37      * explorer query cache of changes.
38      * 
39      * @param context the context to mark as expanded
40      * @param expanded the new expanded state
41      * @return <code>true</code> if the node's expanded state was changed,
42      *         <code>false</code> otherwise
43      */
44     boolean setExpanded(NodeContext context, boolean expanded);
45
46     /**
47      * Replace the current processor expanded status and notify the graph
48      * explorer query cache of changes.
49      * 
50      * @param context the context to mark as expanded
51      * @param expanded the new expanded state
52      * @return <code>true</code> if the node's expanded state was changed,
53      *         <code>false</code> otherwise
54      */
55     boolean replaceExpanded(NodeContext context, boolean expanded);
56
57 }