public class ComboBoxPropertyDescriptor extends PropertyDescriptor
ILabelProvider that will render the label of the given
descriptor as the String found in the labels array at the
currently selected index.
The value of the property is a 0-based Integer index into
the labels array.
This class may be instantiated; it is not intended to be subclassed.
Example:
String[] values = {"Top left", "Top right", "Bottom left", "Bottom right"};
IPropertyDescriptor pd = new ComboBoxPropertyDescriptor("origin", "Origin", values);
| Constructor and Description |
|---|
ComboBoxPropertyDescriptor(Object id,
String displayName,
String[] labelsArray)
Creates an property descriptor with the given id, display name, and list
of value labels to display in the combo box cell editor.
|
| Modifier and Type | Method and Description |
|---|---|
CellEditor |
createPropertyEditor(Composite parent)
The
ComboBoxPropertyDescriptor implementation of this
IPropertyDescriptor method creates and returns a new
ComboBoxCellEditor. |
ILabelProvider |
getLabelProvider()
The
ComboBoxPropertyDescriptor implementation of this
IPropertyDescriptor method returns the value set by
the setProvider method or, if no value has been set
it returns a ComboBoxLabelProvider created from the
valuesArray of this ComboBoxPropertyDescriptor. |
getAlwaysIncompatible, getCategory, getDescription, getDisplayName, getFilterFlags, getHelpContextIds, getId, getValidator, isCompatibleWith, isLabelProviderSet, setAlwaysIncompatible, setCategory, setDescription, setFilterFlags, setHelpContextIds, setLabelProvider, setValidatorpublic ComboBoxPropertyDescriptor(Object id, String displayName, String[] labelsArray)
id - the id of the propertydisplayName - the name to display for the propertylabelsArray - the labels to display in the combo boxpublic CellEditor createPropertyEditor(Composite parent)
ComboBoxPropertyDescriptor implementation of this
IPropertyDescriptor method creates and returns a new
ComboBoxCellEditor.
The editor is configured with the current validator if there is one.
createPropertyEditor in interface IPropertyDescriptorcreatePropertyEditor in class PropertyDescriptorparent - the parent widget for the cell editornull if this
property cannot be editedpublic ILabelProvider getLabelProvider()
ComboBoxPropertyDescriptor implementation of this
IPropertyDescriptor method returns the value set by
the setProvider method or, if no value has been set
it returns a ComboBoxLabelProvider created from the
valuesArray of this ComboBoxPropertyDescriptor.getLabelProvider in interface IPropertyDescriptorgetLabelProvider in class PropertyDescriptorPropertyDescriptor.setLabelProvider(org.eclipse.jface.viewers.ILabelProvider)Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.