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