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, setValidator
public 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 IPropertyDescriptor
createPropertyEditor
in class PropertyDescriptor
parent
- 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 IPropertyDescriptor
getLabelProvider
in class PropertyDescriptor
PropertyDescriptor.setLabelProvider(ILabelProvider)
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.