KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > elements > NamedElement


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.elements;
12
13 import org.eclipse.swt.graphics.Image;
14
15 public class NamedElement extends DefaultElement {
16     protected Image image;
17
18     private String JavaDoc name;
19
20     private IPDEElement parent;
21
22     public NamedElement(String JavaDoc name) {
23         this(name, null, null);
24     }
25
26     public NamedElement(String JavaDoc name, Image icon) {
27         this(name, icon, null);
28     }
29
30     public NamedElement(String JavaDoc name, Image image, IPDEElement parent) {
31         this.name = name;
32         this.image = image;
33         this.parent = parent;
34     }
35
36     public Image getImage() {
37         return image;
38     }
39
40     public String JavaDoc getLabel() {
41         return name;
42     }
43
44     public Object JavaDoc getParent() {
45         return parent;
46     }
47
48     public String JavaDoc toString() {
49         return getLabel();
50     }
51 }
52
Popular Tags