com.izforge.izpack.panels.userinput.field
Class ChoiceField

java.lang.Object
  extended by com.izforge.izpack.panels.userinput.field.Field
      extended by com.izforge.izpack.panels.userinput.field.ChoiceField
Direct Known Subclasses:
ComboField, RadioField

public abstract class ChoiceField
extends Field

A field with a number of pre-defined choices.

Author:
Tim Anderson

Constructor Summary
ChoiceField(ChoiceFieldConfig config, InstallData installData)
          Constructs a ChoiceField.
 
Method Summary
 List<Choice> getChoices()
          Returns the choices.
 int getSelectedIndex()
          Returns the selected choice.
 
Methods inherited from class com.izforge.izpack.panels.userinput.field.Field
getDefaultValue, getDescription, getDescription, getInitialValue, getInstallData, getLabel, getLabel, getOmitFromAuto, getOsModels, getPacks, getProcessors, getSize, getSummaryKey, getTooltip, getValue, getVariable, isConditionTrue, isEffectiveDisplayHidden, isEffectiveReadonly, replaceVariables, setSaving, setValue, setVariable, validate, validate, wrapDefaultValue, wrapInitialValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChoiceField

public ChoiceField(ChoiceFieldConfig config,
                   InstallData installData)
Constructs a ChoiceField.

Parameters:
config - the field configuration
installData - the installation data
Method Detail

getChoices

public List<Choice> getChoices()
Returns the choices.

Returns:
the choices. The key is the choice identifier, the value, the display text

getSelectedIndex

public int getSelectedIndex()
Returns the selected choice.

Returns:
the selected choice, or -1 if no choice is selected


Copyright © 2018. All rights reserved.