]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/processors/ShowMaxChildrenProcessor.java
ea00429239f74e472cc5b331ca35ccc8e830da94
[simantics/platform.git] / bundles / org.simantics.browsing.ui.common / src / org / simantics / browsing / ui / common / processors / ShowMaxChildrenProcessor.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 org.simantics.browsing.ui.BuiltinKeys;\r
15 import org.simantics.browsing.ui.NodeContext;\r
16 import org.simantics.browsing.ui.PrimitiveQueryProcessor;\r
17 \r
18 /**\r
19  * A primitive query processor (see {@link PrimitiveQueryProcessor}) interface\r
20  * for externally controlling the results of\r
21  * {@link BuiltinKeys#SHOW_MAX_CHILDREN} queries.\r
22  * \r
23  * @author Tuukka Lehtonen\r
24  */\r
25 public interface ShowMaxChildrenProcessor {\r
26 \r
27     /**\r
28      * Set internal processor showAllChildren status without notifying the graph\r
29      * explorer query cache of changes.\r
30      * \r
31      * @param context the context to mark\r
32      * @param maxChildren the new max child count or 0 to make this processor\r
33      *        return <code>null</code> when queried\r
34      * @return <code>true</code> if the node's expanded state was changed,\r
35      *         <code>false</code> otherwise\r
36      */\r
37     boolean setShowMaxChildren(NodeContext context, int maxChildren);\r
38 \r
39     /**\r
40      * Replace the current processor showAllChildren status and notify the graph\r
41      * explorer query cache of changes.\r
42      * \r
43      * @param context the context to mark\r
44      * @param maxChildren the new max child count or 0 to make this processor\r
45      *        return <code>null</code> when queried\r
46      * @return <code>true</code> if the node's expanded state was changed,\r
47      *         <code>false</code> otherwise\r
48      */\r
49     boolean replaceShowMaxChildren(NodeContext context, int maxChildren);\r
50 \r
51 }\r