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