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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.browsing.ui.content;
\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
20 * A CheckState is used with check box trees (see SWT.CHECK). CheckStates are
\r
21 * created by {@link CheckedStateFactory}s.
\r
23 * @author Antti Villberg
\r
26 public interface CheckedStateFactory {
\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
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
44 CheckedState create(PrimitiveQueryUpdater updater, NodeContext context, CheckedStateKey key);
\r