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