]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - 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
diff --git a/bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/labelers/LazyContainerLabeler.java b/bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/labelers/LazyContainerLabeler.java
new file mode 100644 (file)
index 0000000..ccdd2ca
--- /dev/null
@@ -0,0 +1,63 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.browsing.ui.common.labelers;\r
+\r
+import java.util.Collections;\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.simantics.browsing.ui.GraphExplorer.ModificationContext;\r
+import org.simantics.browsing.ui.content.Labeler;\r
+\r
+public class LazyContainerLabeler implements Labeler {\r
+\r
+    private final HashMap<String, String> labels = new HashMap<String, String>(4);\r
+    private int category;\r
+    //private LabelerListener listener;\r
+\r
+    public void addLabel(String key, String label) {\r
+        @SuppressWarnings("unused")\r
+        String old = labels.put(key, label);\r
+        //if (listener != null && !ObjectUtils.objectEquals(label, old))\r
+        //    listener.columnModified(key, label);\r
+    }\r
+\r
+    @Override\r
+    public Map<String, String> getLabels() {\r
+        return labels;\r
+    }\r
+\r
+    @Override\r
+    public Map<String, String> getRuntimeLabels() {\r
+        return Collections.emptyMap();\r
+    }\r
+\r
+    @Override\r
+    public int getCategory() {\r
+        return category;\r
+    }\r
+\r
+    public void setCategory(int category) {\r
+        this.category = category;\r
+    }\r
+\r
+    @Override\r
+    public Modifier getModifier(ModificationContext modificationContext, String key) {\r
+        return null;\r
+    }\r
+\r
+    @Override\r
+    public void setListener(LabelerListener listener) {\r
+        //this.listener = listener;\r
+    }\r
+\r
+}\r