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