1 | /******************************************************************************* |
2 | * Copyright (c) 2007, 2009 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.api.tools.internal.descriptors; |
12 | |
13 | |
14 | |
15 | /** |
16 | * Common base class for element descriptors with names. |
17 | * |
18 | * @since 1.0.0 |
19 | */ |
20 | public abstract class NamedElementDescriptorImpl extends ElementDescriptorImpl { |
21 | |
22 | /** |
23 | * element name |
24 | */ |
25 | private String fName; |
26 | |
27 | /** |
28 | * Constructs an element descriptor with the given name and parent. |
29 | * |
30 | * @param name element name |
31 | */ |
32 | NamedElementDescriptorImpl(String name) { |
33 | fName = name; |
34 | } |
35 | |
36 | /** |
37 | * Returns this element's simple name. |
38 | * |
39 | * @return element name |
40 | */ |
41 | public String getName() { |
42 | return fName; |
43 | } |
44 | |
45 | /* (non-Javadoc) |
46 | * @see org.eclipse.pde.api.tools.internal.descriptors.ElementDescriptorImpl#getComparable() |
47 | */ |
48 | protected Comparable getComparable() { |
49 | return getName(); |
50 | } |
51 | } |