]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/labelers/LazyContainerLabeler.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.browsing.ui.common / src / org / simantics / browsing / ui / common / labelers / LazyContainerLabeler.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.browsing.ui.common.labelers;
13
14 import java.util.Collections;
15 import java.util.HashMap;
16 import java.util.Map;
17
18 import org.simantics.browsing.ui.GraphExplorer.ModificationContext;
19 import org.simantics.browsing.ui.content.Labeler;
20
21 public class LazyContainerLabeler implements Labeler {
22
23     private final HashMap<String, String> labels = new HashMap<String, String>(4);
24     private int category;
25     //private LabelerListener listener;
26
27     public void addLabel(String key, String label) {
28         @SuppressWarnings("unused")
29         String old = labels.put(key, label);
30         //if (listener != null && !ObjectUtils.objectEquals(label, old))
31         //    listener.columnModified(key, label);
32     }
33
34     @Override
35     public Map<String, String> getLabels() {
36         return labels;
37     }
38
39     @Override
40     public Map<String, String> getRuntimeLabels() {
41         return Collections.emptyMap();
42     }
43
44     @Override
45     public int getCategory() {
46         return category;
47     }
48
49     public void setCategory(int category) {
50         this.category = category;
51     }
52
53     @Override
54     public Modifier getModifier(ModificationContext modificationContext, String key) {
55         return null;
56     }
57
58     @Override
59     public void setListener(LabelerListener listener) {
60         //this.listener = listener;
61     }
62
63 }