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.NodeContext;
\r
15 import org.simantics.browsing.ui.PrimitiveQueryUpdater;
\r
16 import org.simantics.browsing.ui.BuiltinKeys.LabelerKey;
\r
19 * @author Antti Villberg
\r
21 public interface LabelerFactory {
\r
24 * Returns a labeler for the specified input node context or
\r
25 * <code>null</code> if this factory is unable to provide a labeler for the
\r
26 * input. See {@link Labeler} for more on its purpose.
\r
28 * @param updater the updater that needs to be invoked through
\r
29 * {@link PrimitiveQueryUpdater#scheduleReplace(NodeContext, org.simantics.browsing.ui.NodeContext.PrimitiveQueryKey, Object)}
\r
30 * to invalidate the result Labeler of this method if when the
\r
31 * labeler changes in any way.
\r
32 * @param context the input for which to create a {@link Labeler}
\r
33 * @param key the key representing the primitive query that resulted in
\r
34 * calling this {@link LabelerFactory}
\r
35 * @return a Labeler that describes labeling and label editing aspects of
\r
36 * the specified input context or <code>null</code> if a labeler
\r
37 * cannot be provided for any reason
\r
39 Labeler create(PrimitiveQueryUpdater updater, NodeContext context, LabelerKey key);
\r