01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.elements;
11:
12: import org.eclipse.swt.graphics.Image;
13:
14: public class NamedElement extends DefaultElement {
15: protected Image image;
16:
17: private String name;
18:
19: private IPDEElement parent;
20:
21: public NamedElement(String name) {
22: this (name, null, null);
23: }
24:
25: public NamedElement(String name, Image icon) {
26: this (name, icon, null);
27: }
28:
29: public NamedElement(String name, Image image, IPDEElement parent) {
30: this .name = name;
31: this .image = image;
32: this .parent = parent;
33: }
34:
35: public Image getImage() {
36: return image;
37: }
38:
39: public String getLabel() {
40: return name;
41: }
42:
43: public Object getParent() {
44: return parent;
45: }
46:
47: public String toString() {
48: return getLabel();
49: }
50: }
|