KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > runtime > registry > ExtensionPointPropertySource


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 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.runtime.registry;
12
13 import java.util.Vector JavaDoc;
14
15 import org.eclipse.core.runtime.IExtensionPoint;
16 import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
17 import org.eclipse.ui.views.properties.*;
18
19 public class ExtensionPointPropertySource extends RegistryPropertySource {
20     private IExtensionPoint extensionPoint;
21     public static final String JavaDoc P_NAME = "name"; //$NON-NLS-1$
22
public static final String JavaDoc P_ID = "id"; //$NON-NLS-1$
23

24 public ExtensionPointPropertySource(IExtensionPoint extensionPoint) {
25     this.extensionPoint = extensionPoint;
26 }
27 public IPropertyDescriptor[] getPropertyDescriptors() {
28     Vector JavaDoc result = new Vector JavaDoc();
29
30     result.addElement(new PropertyDescriptor(P_NAME, PDERuntimeMessages.RegistryView_extensionPointPR_name));
31     result.addElement(new PropertyDescriptor(P_ID, PDERuntimeMessages.RegistryView_extensionPointPR_id));
32     return toDescriptorArray(result);
33 }
34 public Object JavaDoc getPropertyValue(Object JavaDoc name) {
35     if (name.equals(P_NAME))
36         return extensionPoint.getLabel();
37     if (name.equals(P_ID))
38         return extensionPoint.getUniqueIdentifier();
39     return null;
40 }
41 }
42
Popular Tags