]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/content/CheckedStateFactory.java
58de9ad58ffb413583edffec5ac1f4832f718d91
[simantics/platform.git] / bundles / org.simantics.browsing.ui / src / org / simantics / browsing / ui / content / CheckedStateFactory.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.content;\r
13 \r
14 import org.simantics.browsing.ui.CheckedState;\r
15 import org.simantics.browsing.ui.NodeContext;\r
16 import org.simantics.browsing.ui.PrimitiveQueryUpdater;\r
17 import org.simantics.browsing.ui.BuiltinKeys.CheckedStateKey;\r
18 \r
19 /**\r
20  * A CheckState is used with check box trees (see SWT.CHECK). CheckStates are\r
21  * created by {@link CheckedStateFactory}s.\r
22  * \r
23  * @author Antti Villberg\r
24  * \r
25  */\r
26 public interface CheckedStateFactory {\r
27 \r
28     /**\r
29      * Returns a {@link CheckedState} for the specified input node context or\r
30      * <code>null</code> if this factory is unable to provide a CheckedState for the\r
31      * input.\r
32      * \r
33      * @param updater the updater that needs to be invoked through\r
34      *        {@link PrimitiveQueryUpdater#scheduleReplace(NodeContext, org.simantics.browsing.ui.NodeContext.PrimitiveQueryKey, Object)}\r
35      *        to invalidate the result CheckState of this method if when the\r
36      *        state changes in any way.\r
37      * @param context the input for which to create a {@link CheckedState}\r
38      * @param key the key representing the primitive query that resulted in\r
39      *        calling this {@link CheckedStateFactory}\r
40      * @return a CheckedState that describes checkedness aspects of\r
41      *         the specified input context or <code>null</code> if a state\r
42      *         cannot be provided for any reason\r
43      */\r
44     CheckedState create(PrimitiveQueryUpdater updater, NodeContext context, CheckedStateKey key);\r
45 \r
46 }\r