blob: a946b29d4ded92b984465d8e9befb3be438391b0 [file] [log] [blame]
gkesslerc2f44ec2007-12-07 23:43:50 +00001/*******************************************************************************
2 * Copyright (c) 2007 Oracle Corporation and others.
3 *
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Oracle Corporation - initial API and implementation
11 *******************************************************************************/
12package org.eclipse.jst.pagedesigner.editors.properties.internal;
13
14import org.eclipse.jface.viewers.CellEditor;
15import org.eclipse.jface.viewers.ILabelProvider;
16import org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor;
17import org.eclipse.swt.widgets.Composite;
18import org.eclipse.ui.views.properties.IPropertyDescriptor;
19
20/**
21 * Adapts the MetadataEnabledFeature <code>org.eclipse.jst.pagedesigner.editors.properties.IPropertyPageDescriptor</code>, to a <code>org.eclipse.ui.views.properties.IPropertyDescriptor</code>
22 *
23 */
24public class PropertyDescriptorAdapter implements IPropertyDescriptor{
25
26 private IPropertyPageDescriptor _ppd;
27
28 /**
29 * Constructor
30 * @param propertyPageDescriptor
31 */
32 public PropertyDescriptorAdapter(IPropertyPageDescriptor propertyPageDescriptor) {
33 _ppd = propertyPageDescriptor;
34 }
35
36 public CellEditor createPropertyEditor(Composite parent) {
37 return _ppd.getCellEditor(parent);
38 }
39
40 public String getCategory() {
41 return _ppd.getCategory();
42 }
43
44 public String getDescription() {
45 return _ppd.getDescription();
46 }
47
48 public String getDisplayName() {
49 return _ppd.getAttributeName();
50 }
51
52 public String[] getFilterFlags() {
53 return null;
54 }
55
56 public Object getHelpContextIds() {
57 return null;//FIXME
58 }
59
60 public Object getId() {
61 return _ppd.getAttributeName();
62 }
63
64 public ILabelProvider getLabelProvider() {
65 return null;//FIXME: do better? Used to supply labels for attribute property sheet (not quick edit)
66 }
67
68 public boolean isCompatibleWith(IPropertyDescriptor anotherProperty) {
69 return false;
70 }
71
72}