1 /*******************************************************************************
 
   2  * Copyright (c) 2000, 2004 IBM Corporation and others.
 
   3  * All rights reserved. This program and the accompanying materials 
 
   4  * are made available under the terms of the Common Public License v1.0
 
   5  * which accompanies this distribution, and is available at
 
   6  * http://www.eclipse.org/legal/cpl-v10.html
 
   9  *     IBM Corporation - initial API and implementation
 
  10  *******************************************************************************/
 
  12 package net.sourceforge.phpdt.internal.ui;
 
  15 import org.eclipse.jface.viewers.IBasicPropertyConstants;
 
  17 import org.eclipse.ui.views.properties.IPropertyDescriptor;
 
  18 import org.eclipse.ui.views.properties.IPropertySource;
 
  19 import org.eclipse.ui.views.properties.PropertyDescriptor;
 
  21 import net.sourceforge.phpdt.core.IJavaElement;
 
  23 public class JavaElementProperties implements IPropertySource {
 
  25         private IJavaElement fSource;
 
  27         // Property Descriptors
 
  28         static private IPropertyDescriptor[] fgPropertyDescriptors= new IPropertyDescriptor[1];
 
  30                 PropertyDescriptor descriptor;
 
  33                 descriptor= new PropertyDescriptor(IBasicPropertyConstants.P_TEXT, PHPUIMessages.getString("JavaElementProperties.name")); //$NON-NLS-1$
 
  34                 descriptor.setAlwaysIncompatible(true);
 
  35                 fgPropertyDescriptors[0]= descriptor;
 
  38         public JavaElementProperties(IJavaElement source) {
 
  42         public IPropertyDescriptor[] getPropertyDescriptors() {
 
  43                 return fgPropertyDescriptors;
 
  46         public Object getPropertyValue(Object name) {
 
  47                 if (name.equals(IBasicPropertyConstants.P_TEXT)) {
 
  48                         return fSource.getElementName();
 
  53         public void setPropertyValue(Object name, Object value) {
 
  56         public Object getEditableValue() {
 
  60         public boolean isPropertySet(Object property) {
 
  64         public void resetPropertyValue(Object property) {