1 11 package org.eclipse.pde.internal.runtime.registry; 12 13 import java.util.Vector ; 14 15 import org.eclipse.core.runtime.IConfigurationElement; 16 import org.eclipse.ui.views.properties.*; 17 18 public class ConfigurationElementPropertySource extends RegistryPropertySource { 19 private IConfigurationElement config; 20 21 public ConfigurationElementPropertySource(IConfigurationElement config) { 22 this.config = config; 23 } 24 public IPropertyDescriptor[] getPropertyDescriptors() { 25 Vector result = new Vector (); 26 27 String [] atts = config.getAttributeNames(); 28 for (int i=0; i<atts.length; i++) { 29 result.addElement(new PropertyDescriptor(atts[i], atts[i])); 30 } 31 return toDescriptorArray(result); 32 } 33 public Object getPropertyValue(Object name) { 34 return config.getAttribute(name.toString()); 35 } 36 } 37 | Popular Tags |