Package org.eclipse.ui.views.properties
Class ComboBoxPropertyDescriptor
- java.lang.Object
-
- org.eclipse.ui.views.properties.PropertyDescriptor
-
- org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor
-
- All Implemented Interfaces:
IPropertyDescriptor
public class ComboBoxPropertyDescriptor extends PropertyDescriptor
Descriptor for a property that has a value which should be edited with a combo box cell editor. This class provides a defaultILabelProvider
that will render the label of the given descriptor as theString
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);
- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CellEditor
createPropertyEditor(Composite parent)
TheComboBoxPropertyDescriptor
implementation of thisIPropertyDescriptor
method creates and returns a newComboBoxCellEditor
.ILabelProvider
getLabelProvider()
TheComboBoxPropertyDescriptor
implementation of thisIPropertyDescriptor
method returns the value set by thesetProvider
method or, if no value has been set it returns aComboBoxLabelProvider
created from the valuesArray of thisComboBoxPropertyDescriptor
.-
Methods inherited from class org.eclipse.ui.views.properties.PropertyDescriptor
getAlwaysIncompatible, getCategory, getDescription, getDisplayName, getFilterFlags, getHelpContextIds, getId, getValidator, isCompatibleWith, isLabelProviderSet, setAlwaysIncompatible, setCategory, setDescription, setFilterFlags, setHelpContextIds, setLabelProvider, setValidator
-
-
-
-
Constructor Detail
-
ComboBoxPropertyDescriptor
public 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.- Parameters:
id
- the id of the propertydisplayName
- the name to display for the propertylabelsArray
- the labels to display in the combo box
-
-
Method Detail
-
createPropertyEditor
public CellEditor createPropertyEditor(Composite parent)
TheComboBoxPropertyDescriptor
implementation of thisIPropertyDescriptor
method creates and returns a newComboBoxCellEditor
.The editor is configured with the current validator if there is one.
- Specified by:
createPropertyEditor
in interfaceIPropertyDescriptor
- Overrides:
createPropertyEditor
in classPropertyDescriptor
- Parameters:
parent
- the parent widget for the cell editor- Returns:
- the cell editor for this property, or
null
if this property cannot be edited
-
getLabelProvider
public ILabelProvider getLabelProvider()
TheComboBoxPropertyDescriptor
implementation of thisIPropertyDescriptor
method returns the value set by thesetProvider
method or, if no value has been set it returns aComboBoxLabelProvider
created from the valuesArray of thisComboBoxPropertyDescriptor
.- Specified by:
getLabelProvider
in interfaceIPropertyDescriptor
- Overrides:
getLabelProvider
in classPropertyDescriptor
- Returns:
- the label provider used to display this property
- See Also:
PropertyDescriptor.setLabelProvider(ILabelProvider)
-
-