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