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");
40 public ISymbolItem getSubject() {
45 public String getName() {
46 return proxy.getName();
50 public String getDescription() {
51 return proxy.getDescription();
55 public Object getAdapter(Class adapter) {
56 return proxy.getAdapter(adapter);
60 public ElementClass getElementClass(IHintObservable hints) throws ProvisionException {
61 return proxy.getElementClass(hints);
65 public ISymbolGroup getGroup() {
70 public int hashCode() {
71 return proxy.hashCode();
75 public boolean equals(Object obj) {
76 return proxy.equals(obj);