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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.modeling.ui.modelBrowser.model;
\r
14 import java.util.Collection;
\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
25 public class Decorator implements INode {
\r
29 public Decorator(INode base) {
\r
34 public Collection<?> getChildren(ReadGraph g) throws DatabaseException {
\r
35 return base.getChildren(g);
\r
39 public ImageDescriptor getImage(ReadGraph g) throws DatabaseException {
\r
40 return base.getImage(g);
\r
44 public String getLabel(ReadGraph g) throws DatabaseException {
\r
45 return base.getLabel(g);
\r
49 public int getCategory(ReadGraph graph) throws DatabaseException {
\r
50 return base.getCategory(graph);
\r
54 public boolean hasChildren(ReadGraph g) throws DatabaseException {
\r
55 return base.hasChildren(g);
\r
59 public Object getAdapter(Class adapter) {
\r
60 return base.getAdapter(adapter);
\r
64 public boolean equals(Object obj) {
\r
69 return getClass().equals(obj.getClass()) && base.equals(((Decorator)obj).base);
\r
73 public int hashCode() {
\r
74 return getClass().hashCode() + 31 * base.hashCode();
\r
78 public void handleDrop(Session session, ISelection selection) {
\r
79 base.handleDrop(session, selection);
\r
83 public void handleDelete(WriteGraph graph) throws DatabaseException {
\r
84 base.handleDelete(graph);
\r
88 public Modifier getModifier(Session session, String columnId) {
\r
89 return base.getModifier(session, null);
\r