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