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;
14 import net.sourceforge.phpdt.core.IJavaElement;
16 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 public class JavaElementProperties implements IPropertySource {
23 private IJavaElement fSource;
25 // Property Descriptors
26 static private IPropertyDescriptor[] fgPropertyDescriptors = new IPropertyDescriptor[1];
28 PropertyDescriptor descriptor;
31 descriptor = new PropertyDescriptor(IBasicPropertyConstants.P_TEXT,
32 PHPUIMessages.getString("JavaElementProperties.name")); //$NON-NLS-1$
33 descriptor.setAlwaysIncompatible(true);
34 fgPropertyDescriptors[0] = descriptor;
37 public JavaElementProperties(IJavaElement source) {
41 public IPropertyDescriptor[] getPropertyDescriptors() {
42 return fgPropertyDescriptors;
45 public Object getPropertyValue(Object name) {
46 if (name.equals(IBasicPropertyConstants.P_TEXT)) {
47 return fSource.getElementName();
52 public void setPropertyValue(Object name, Object value) {
55 public Object getEditableValue() {
59 public boolean isPropertySet(Object property) {
63 public void resetPropertyValue(Object property) {