]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/model/Decorator.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / modelBrowser / model / Decorator.java
diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/model/Decorator.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/model/Decorator.java
new file mode 100644 (file)
index 0000000..e6e9060
--- /dev/null
@@ -0,0 +1,91 @@
+/*******************************************************************************\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.modeling.ui.modelBrowser.model;\r
+\r
+import java.util.Collection;\r
+\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.simantics.browsing.ui.content.Labeler.Modifier;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+@Deprecated\r
+public class Decorator implements INode {\r
+\r
+    INode base;\r
+\r
+    public Decorator(INode base) {\r
+        this.base = base;\r
+    }\r
+\r
+    @Override\r
+    public Collection<?> getChildren(ReadGraph g) throws DatabaseException {\r
+        return base.getChildren(g);\r
+    }\r
+\r
+    @Override\r
+    public ImageDescriptor getImage(ReadGraph g) throws DatabaseException {\r
+        return base.getImage(g);\r
+    }\r
+\r
+    @Override\r
+    public String getLabel(ReadGraph g) throws DatabaseException {\r
+        return base.getLabel(g);\r
+    }\r
+\r
+    @Override\r
+    public int getCategory(ReadGraph graph) throws DatabaseException {\r
+        return base.getCategory(graph);\r
+    }\r
+\r
+    @Override\r
+    public boolean hasChildren(ReadGraph g) throws DatabaseException {\r
+        return base.hasChildren(g);\r
+    }\r
+\r
+    @Override\r
+    public Object getAdapter(Class adapter) {\r
+        return base.getAdapter(adapter);\r
+    }\r
+\r
+    @Override\r
+    public boolean equals(Object obj) {\r
+        if(this == obj)\r
+            return true;\r
+        if(obj == null)\r
+            return false;\r
+        return getClass().equals(obj.getClass()) && base.equals(((Decorator)obj).base);\r
+    }\r
+\r
+    @Override\r
+    public int hashCode() {\r
+        return getClass().hashCode() + 31 * base.hashCode();\r
+    }\r
+\r
+    @Override\r
+    public void handleDrop(Session session, ISelection selection) {\r
+        base.handleDrop(session, selection);\r
+    }\r
+\r
+    @Override\r
+    public void handleDelete(WriteGraph graph) throws DatabaseException {\r
+        base.handleDelete(graph);\r
+    }\r
+\r
+    @Override\r
+    public Modifier getModifier(Session session, String columnId) {\r
+        return base.getModifier(session, null);\r
+    }\r
+}\r