com.izforge.izpack.panels.userinput.field.check
Class CheckField

java.lang.Object
  extended by com.izforge.izpack.panels.userinput.field.Field
      extended by com.izforge.izpack.panels.userinput.field.check.CheckField

public class CheckField
extends Field

Check box field.

Author:
Tim Anderson

Constructor Summary
CheckField(CheckFieldConfig config, InstallData installData)
          Constructs a CheckField.
 
Method Summary
 String getFalseValue()
          Returns the value to assign to the associated variable when the checkbox is selected (i.e.
 boolean getInitialSelection()
          Returns the initial selection of the check box.
 String getTrueValue()
          Returns the value to assign to the associated variable when the checkbox is selected (i.e.
 String wrapDefaultValue(String originalValue)
          Wrap the default value of a field, which is the value of the default attribute in the field's spec to the effective value to be assigned to the variable.
 String wrapInitialValue(String originalValue)
          Wrap the initial value of a field, which is the value of the set attribute in the field's spec to the effective value to be assigned to the variable.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckField

public CheckField(CheckFieldConfig config,
                  InstallData installData)
Constructs a CheckField.

Parameters:
config - the configuration to get field information from
installData - the installation data
Throws:
IzPackException - if the field cannot be read
Method Detail

getTrueValue

public String getTrueValue()
Returns the value to assign to the associated variable when the checkbox is selected (i.e. is 'true').

Returns:
the 'true' value

getFalseValue

public String getFalseValue()
Returns the value to assign to the associated variable when the checkbox is selected (i.e. is 'false').

Returns:
the 'false' value

getInitialSelection

public boolean getInitialSelection()
Returns the initial selection of the check box.

The initial selection is determined by the initial value. If this is the same as the 'true value' or "true" then the check box should be selected.

Returns:
true if the check box should be selected, false if it should be deselected.

wrapInitialValue

public String wrapInitialValue(String originalValue)
Description copied from class: Field
Wrap the initial value of a field, which is the value of the set attribute in the field's spec to the effective value to be assigned to the variable. This can be used for enumeration type conversions.

This method can be optionally overridden by several user input field types.

Example: The set attribute in the checkbox user input field has a boolean value, the value should be wrapped to the value of the true attribute in case of set="true" or to the value of the false attribute in case of set="false".

Overrides:
wrapInitialValue in class Field
Parameters:
originalValue - the original value of the set attribute
Returns:
the wrapped value
See Also:
CheckField

wrapDefaultValue

public String wrapDefaultValue(String originalValue)
Description copied from class: Field
Wrap the default value of a field, which is the value of the default attribute in the field's spec to the effective value to be assigned to the variable. This can be used for enumeration type conversions. To be overridden by several user input field types.

This method can be optionally overridden by several user input field types.

Example: The set attribute in the checkbox user input field has a boolean value, the value should be wrapped to the value of the true attribute in case of default="true" or to the value of the false attribute in case of default="false".

Overrides:
wrapDefaultValue in class Field
Parameters:
originalValue - the original value of the default attribute
Returns:
the wrapped value
See Also:
CheckField, CheckField


Copyright © 2018. All rights reserved.