1 11 package org.eclipse.pde.internal.ui.editor.schema; 12 13 import org.eclipse.pde.internal.core.schema.*; 14 import org.eclipse.ui.views.properties.*; 15 import org.eclipse.pde.internal.core.ischema.*; 16 import org.eclipse.pde.internal.ui.*; 17 18 public class CompositorPropertySource extends GrammarPropertySource { 19 public static final String P_KIND = "kind"; public CompositorPropertySource(ISchemaCompositor obj) { 21 super(obj); 22 } 23 public IPropertyDescriptor[] getPropertyDescriptors() { 24 if (descriptors == null) { 25 descriptors = super.getPropertyDescriptorsVector(); 26 PropertyDescriptor cdesc = 27 createComboBoxPropertyDescriptor(P_KIND, PDEUIMessages.SchemaEditor_CompositorPR_kind, ISchemaCompositor.kindTable); 28 if (cdesc instanceof ComboBoxPropertyDescriptor) 29 ((ComboBoxPropertyDescriptor) cdesc).setLabelProvider( 30 new ComboProvider(P_KIND, ISchemaCompositor.kindTable)); 31 descriptors.addElement(cdesc); 32 } 33 return toDescriptorArray(descriptors); 34 } 35 public Object getPropertyValue(Object name) { 36 ISchemaCompositor compositor = (ISchemaCompositor)getSourceObject(); 37 if (name.equals(P_KIND)) { 38 return new Integer (compositor.getKind()); 39 } 40 return super.getPropertyValue(name); 41 } 42 public void setPropertyValue(String name, Object value) { 43 SchemaCompositor compositor = (SchemaCompositor)getSourceObject(); 44 45 if (name.equals(P_KIND)) { 46 compositor.setKind(((Integer )value).intValue()); 47 } 48 else super.setPropertyValue(name, value); 49 } 50 } 51 | Popular Tags |