]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
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.modeling.ui.modelBrowser.model;\r
13 \r
14 import java.util.Collection;\r
15 \r
16 import org.eclipse.jface.resource.ImageDescriptor;\r
17 import org.eclipse.jface.viewers.ISelection;\r
18 import org.simantics.browsing.ui.content.Labeler.Modifier;\r
19 import org.simantics.db.ReadGraph;\r
20 import org.simantics.db.Session;\r
21 import org.simantics.db.WriteGraph;\r
22 import org.simantics.db.exception.DatabaseException;\r
23 \r
24 @Deprecated\r
25 public class Decorator implements INode {\r
26 \r
27     INode base;\r
28 \r
29     public Decorator(INode base) {\r
30         this.base = base;\r
31     }\r
32 \r
33     @Override\r
34     public Collection<?> getChildren(ReadGraph g) throws DatabaseException {\r
35         return base.getChildren(g);\r
36     }\r
37 \r
38     @Override\r
39     public ImageDescriptor getImage(ReadGraph g) throws DatabaseException {\r
40         return base.getImage(g);\r
41     }\r
42 \r
43     @Override\r
44     public String getLabel(ReadGraph g) throws DatabaseException {\r
45         return base.getLabel(g);\r
46     }\r
47 \r
48     @Override\r
49     public int getCategory(ReadGraph graph) throws DatabaseException {\r
50         return base.getCategory(graph);\r
51     }\r
52 \r
53     @Override\r
54     public boolean hasChildren(ReadGraph g) throws DatabaseException {\r
55         return base.hasChildren(g);\r
56     }\r
57 \r
58     @Override\r
59     public Object getAdapter(Class adapter) {\r
60         return base.getAdapter(adapter);\r
61     }\r
62 \r
63     @Override\r
64     public boolean equals(Object obj) {\r
65         if(this == obj)\r
66             return true;\r
67         if(obj == null)\r
68             return false;\r
69         return getClass().equals(obj.getClass()) && base.equals(((Decorator)obj).base);\r
70     }\r
71 \r
72     @Override\r
73     public int hashCode() {\r
74         return getClass().hashCode() + 31 * base.hashCode();\r
75     }\r
76 \r
77     @Override\r
78     public void handleDrop(Session session, ISelection selection) {\r
79         base.handleDrop(session, selection);\r
80     }\r
81 \r
82     @Override\r
83     public void handleDelete(WriteGraph graph) throws DatabaseException {\r
84         base.handleDelete(graph);\r
85     }\r
86 \r
87     @Override\r
88     public Modifier getModifier(Session session, String columnId) {\r
89         return base.getModifier(session, null);\r
90     }\r
91 }\r