1 11 package org.eclipse.pde.internal.runtime.registry; 12 13 import java.util.Vector ; 14 15 import org.eclipse.core.runtime.IExtension; 16 import org.eclipse.pde.internal.runtime.PDERuntimeMessages; 17 import org.eclipse.ui.views.properties.*; 18 19 public class ExtensionPropertySource extends RegistryPropertySource { 20 private IExtension extension; 21 public static final String P_NAME = "name"; public static final String P_ID = "id"; public static final String P_POINT = "point"; public ExtensionPropertySource(IExtension extension) { 25 this.extension = extension; 26 } 27 public IPropertyDescriptor[] getPropertyDescriptors() { 28 Vector result = new Vector (); 29 30 result.addElement(new PropertyDescriptor(P_NAME, PDERuntimeMessages.RegistryView_extensionPR_name)); 31 result.addElement(new PropertyDescriptor(P_ID, PDERuntimeMessages.RegistryView_extensionPR_id)); 32 result.addElement(new PropertyDescriptor(P_POINT, PDERuntimeMessages.RegistryView_extensionPR_point)); 33 return toDescriptorArray(result); 34 } 35 public Object getPropertyValue(Object name) { 36 if (name.equals(P_NAME)) 37 return extension.getLabel(); 38 if (name.equals(P_ID)) 39 return extension.getUniqueIdentifier(); 40 if (name.equals(P_POINT)) 41 return extension.getExtensionPointUniqueIdentifier(); 42 return null; 43 } 44 } 45 | Popular Tags |