1 11 12 package org.eclipse.jdt.internal.ui; 13 14 15 import org.eclipse.jface.viewers.IBasicPropertyConstants; 16 17 import org.eclipse.ui.views.properties.IPropertyDescriptor; 18 import org.eclipse.ui.views.properties.IPropertySource; 19 import org.eclipse.ui.views.properties.PropertyDescriptor; 20 21 import org.eclipse.jdt.core.IJavaElement; 22 23 public class JavaElementProperties implements IPropertySource { 24 25 private IJavaElement fSource; 26 27 private static final IPropertyDescriptor[] fgPropertyDescriptors= new IPropertyDescriptor[1]; 29 static { 30 PropertyDescriptor descriptor; 31 32 descriptor= new PropertyDescriptor(IBasicPropertyConstants.P_TEXT, JavaUIMessages.JavaElementProperties_name); 34 descriptor.setAlwaysIncompatible(true); 35 fgPropertyDescriptors[0]= descriptor; 36 } 37 38 public JavaElementProperties(IJavaElement source) { 39 fSource= source; 40 } 41 42 public IPropertyDescriptor[] getPropertyDescriptors() { 43 return fgPropertyDescriptors; 44 } 45 46 public Object getPropertyValue(Object name) { 47 if (name.equals(IBasicPropertyConstants.P_TEXT)) { 48 return fSource.getElementName(); 49 } 50 return null; 51 } 52 53 public void setPropertyValue(Object name, Object value) { 54 } 55 56 public Object getEditableValue() { 57 return this; 58 } 59 60 public boolean isPropertySet(Object property) { 61 return false; 62 } 63 64 public void resetPropertyValue(Object property) { 65 } 66 } 67 | Popular Tags |