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.common.labelers;
16 import org.eclipse.swt.widgets.Composite;
17 import org.eclipse.swt.widgets.Event;
18 import org.simantics.browsing.ui.GraphExplorer.ModificationContext;
19 import org.simantics.browsing.ui.NodeContext;
20 import org.simantics.browsing.ui.content.Labeler;
23 * A stub implementation of Labeler.
25 * @author Tuukka Lehtonen
28 * @author Jani Simomaa
31 public class LabelerStub implements Labeler {
33 protected LabelerContent content = LabelerContent.NO_CONTENT;
35 public LabelerStub() {
38 public LabelerStub(LabelerContent content) {
40 throw new NullPointerException(this + " tried to initialize with null content");
41 this.content = content;
44 public void setContent(LabelerContent content) {
46 throw new NullPointerException(this + " tried to set null content");
47 this.content = content;
51 public Map<String, String> getLabels() {
52 return content.labels;
56 public Map<String, String> getRuntimeLabels() {
61 public int getCategory() {
62 return content.category;
66 public Modifier getModifier(ModificationContext context, String key) {
71 public void setListener(LabelerListener listener) {
80 public Composite createToolTipContentArea(Event event, Composite parent, NodeContext nodeContext) {
89 public boolean shouldCreateToolTip(Event event, NodeContext nodeContext) {