1 11 package org.eclipse.pde.internal.runtime.registry; 12 13 import java.util.Vector ; 14 15 import org.eclipse.core.runtime.ILibrary; 16 import org.eclipse.pde.internal.runtime.PDERuntimeMessages; 17 import org.eclipse.ui.views.properties.*; 18 19 public class LibraryPropertySource extends RegistryPropertySource { 20 private ILibrary library; 21 public static final String P_PATH = "path"; public static final String P_EXPORTED = "exported"; public static final String P_FULLY_EXPORTED = "fully_exported"; 25 public LibraryPropertySource(ILibrary library) { 26 this.library = library; 27 } 28 public IPropertyDescriptor[] getPropertyDescriptors() { 29 Vector result = new Vector (); 30 31 result.addElement(new PropertyDescriptor(P_PATH, PDERuntimeMessages.RegistryView_libraryPR_path)); 32 result.addElement(new PropertyDescriptor(P_EXPORTED, PDERuntimeMessages.RegistryView_libraryPR_exported)); 33 result.addElement(new PropertyDescriptor(P_FULLY_EXPORTED, PDERuntimeMessages.RegistryView_libraryPR_fullyExported)); 34 return toDescriptorArray(result); 35 } 36 public Object getPropertyValue(Object name) { 37 if (name.equals(P_PATH)) 38 return library.getPath().toString(); 39 if (name.equals(P_EXPORTED)) 40 return library.isExported()?"true":"false"; if (name.equals(P_FULLY_EXPORTED)) 42 return library.isFullyExported()?"true":"false"; return null; 44 } 45 } 46 | Popular Tags |