1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.diagram.symbolcontribution;
14 import org.simantics.diagram.symbollibrary.ISymbolGroup;
15 import org.simantics.diagram.symbollibrary.ISymbolItem;
16 import org.simantics.g2d.element.ElementClass;
17 import org.simantics.utils.datastructures.cache.ProvisionException;
18 import org.simantics.utils.datastructures.hints.IHintObservable;
21 * An ISymbolItem proxy version that allows changing the ISymbolGroup returned
22 * by {@link #getGroup()}.
24 * @author Tuukka Lehtonen
26 public class GroupProxySymbolItem implements ISymbolItem {
28 private final ISymbolItem proxy;
29 private final ISymbolGroup group;
31 public GroupProxySymbolItem(ISymbolItem item, ISymbolGroup group) {
33 throw new NullPointerException("null item");
35 throw new NullPointerException("null group");
41 public String getName() {
42 return proxy.getName();
46 public String getDescription() {
47 return proxy.getDescription();
51 public Object getAdapter(Class adapter) {
52 return proxy.getAdapter(adapter);
56 public ElementClass getElementClass(IHintObservable hints) throws ProvisionException {
57 return proxy.getElementClass(hints);
61 public ISymbolGroup getGroup() {
66 public int hashCode() {
67 return proxy.hashCode();
71 public boolean equals(Object obj) {
72 return proxy.equals(obj);