Package org.eclipse.pde.ui.templates
Class ComboChoiceOption
java.lang.Object
org.eclipse.pde.ui.templates.TemplateField
org.eclipse.pde.ui.templates.TemplateOption
org.eclipse.pde.ui.templates.AbstractChoiceOption
org.eclipse.pde.ui.templates.ComboChoiceOption
Implementation of the AbstractTemplateOption that allows users to choose a value from
the fixed set of options using a combo box.
- Since:
- 3.2
-
Field Summary
Fields inherited from class org.eclipse.pde.ui.templates.AbstractChoiceOption
fChoices -
Constructor Summary
ConstructorsConstructorDescriptionComboChoiceOption(BaseOptionTemplateSection section, String name, String label, String[][] choices) Constructor for ComboChoiceOption. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateControl(Composite parent, int span) Subclasses must implement this method to create the control of the template field.protected intgetIndexOfChoice(String choice) Get the index (in the collection) of the choiceprotected voidselectOptionChoice(String choice) protected voidsetOptionEnabled(boolean enabled) protected voidsetOptionValue(Object value) Methods inherited from class org.eclipse.pde.ui.templates.AbstractChoiceOption
createComposite, fill, getChoice, isBlocked, selectChoice, setEnabled, setValue, setValueMethods inherited from class org.eclipse.pde.ui.templates.TemplateOption
getMessageLabel, getName, getValue, isEmpty, isEnabled, isRequired, setName, setRequiredMethods inherited from class org.eclipse.pde.ui.templates.TemplateField
createLabel, getLabel, getSection, setLabel
-
Constructor Details
-
ComboChoiceOption
public ComboChoiceOption(BaseOptionTemplateSection section, String name, String label, String[][] choices) Constructor for ComboChoiceOption.- Parameters:
section- the parent section.name- the unique namelabel- the presentable labelchoices- the list of choices from which the value can be chosen. Each array entry should be an array of size 2, where position 0 will be interpeted as the choice unique name, and position 1 as the choice presentable label.
-
-
Method Details
-
createControl
Description copied from class:TemplateFieldSubclasses must implement this method to create the control of the template field.- Specified by:
createControlin classTemplateField- Parameters:
parent- the parent composite the control should be created inspan- number of columns that the control should span
-
setOptionValue
- Specified by:
setOptionValuein classAbstractChoiceOption
-
setOptionEnabled
protected void setOptionEnabled(boolean enabled) - Specified by:
setOptionEnabledin classAbstractChoiceOption
-
selectOptionChoice
- Specified by:
selectOptionChoicein classAbstractChoiceOption
-
getIndexOfChoice
Get the index (in the collection) of the choice- Parameters:
choice- The key of the item- Returns:
- The position in the list, or -1 if not found
- Since:
- 3.4
-