1 package net.sourceforge.phpeclipse.wiki.editor;
3 import org.eclipse.ui.views.properties.IPropertyDescriptor;
4 import org.eclipse.ui.views.properties.IPropertySource;
5 import org.eclipse.ui.views.properties.IResourcePropertyConstants;
6 import org.eclipse.ui.views.properties.PropertyDescriptor;
8 public class WPPropertySource implements IPropertySource {
9 // final boolean isWPFile;
12 * The <code>IResource</code> property key for Wikipedia timestamp.
14 public static final String P_TIMESTAMP = "net.sourceforge.phpeclipse.wiki.timestamp"; //$NON-NLS-1$
16 private static PropertyDescriptor wpEditorDescriptor;
18 wpEditorDescriptor = new PropertyDescriptor(P_TIMESTAMP, "Wikipedia Timestamp");
19 wpEditorDescriptor.setAlwaysIncompatible(true);
20 wpEditorDescriptor.setCategory(IResourcePropertyConstants.P_FILE_SYSTEM_CATEGORY);
23 public WPPropertySource(WikiEditor source) {
25 // if (file.getFileExtension().equalsIgnoreCase("wp")) {
35 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
37 public IPropertyDescriptor[] getPropertyDescriptors() {
38 IPropertyDescriptor[] p = new IPropertyDescriptor[1];
39 p[0] = wpEditorDescriptor;
42 // IPropertyDescriptor[] sp = super.getPropertyDescriptors();
43 // IPropertyDescriptor[] p = new IPropertyDescriptor[sp.length+1];
44 // System.arraycopy(sp,0,p,0,sp.length);
45 // p[sp.length] = wpEditorDescriptor;
48 // return super.getPropertyDescriptors();
54 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
56 public Object getPropertyValue(Object key) {
57 // Object returnValue = super.getPropertyValue(key);
59 // if (returnValue != null)
60 // return returnValue;
62 if (key.equals(P_TIMESTAMP))
68 * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
70 public Object getEditableValue() {
71 // TODO Auto-generated method stub
75 * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
77 public boolean isPropertySet(Object id) {
78 return id.equals(P_TIMESTAMP);
81 * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
83 public void resetPropertyValue(Object id) {
87 * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
89 public void setPropertyValue(Object id, Object value) {