com.izforge.izpack.panels.userinput.gui
Class GUIField

java.lang.Object
  extended by com.izforge.izpack.panels.userinput.field.AbstractFieldView
      extended by com.izforge.izpack.panels.userinput.gui.GUIField
All Implemented Interfaces:
FieldView
Direct Known Subclasses:
AbstractGUIFileField, GUIButtonField, GUICheckField, GUIComboField, GUICustomField, GUIDivider, GUIMultipleFileField, GUIPasswordGroupField, GUIRadioField, GUIRuleField, GUISearchField, GUISpacer, GUIStaticText, GUITextField, GUITitleField

public abstract class GUIField
extends AbstractFieldView

GUI presentation of a field.

Author:
Tim Anderson

Constructor Summary
GUIField(Field field)
          Constructs a GUIField.
 
Method Summary
protected  void addComponent(JComponent component, Object constraints)
          Adds a component.
protected  void addDescription()
          Adds a field description to the list of UI elements.
protected  void addField(JComponent component)
          Adds the field.
protected  void addLabel()
          Adds the label for the field.
protected  void addLabel(String label)
          Adds a label.
protected  void addText(String text)
          Adds a static text field.
protected  void addTooltip()
          Adds the tooltip to each component in this view.
 List<Component> getComponents()
          Returns the components that make up the view.
abstract  JComponent getFirstFocusableComponent()
          Return a JComponent of this field which is the primary candidate to gain focus.
protected  InstallData getInstallData()
          Returns the installation data.
protected  void notifyUpdateListener()
          Notifies any registered listener that the view has updated.
protected  String replaceVariables(String value)
          Helper to replace variables in a string.
 void setUpdateListener(UpdateListener listener)
          Registers a listener to be notified of field updates.
 boolean translateStaticText()
          Refresh not editable texts to replace variables
 boolean updateField(Prompt prompt)
          Updates the field from the view.
 boolean updateField(Prompt prompt, boolean skipValidation)
          Updates the field from the view.
 boolean updateView()
          Updates the view from the field.
protected  void warning(String message, Prompt prompt)
          Show localized warning message dialog basing on given parameters.
 
Methods inherited from class com.izforge.izpack.panels.userinput.field.AbstractFieldView
getField, getSummaryKey, getVariable, isDisplayed, isReadonly, setDisplayed, setReadonly, setVariable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUIField

public GUIField(Field field)
Constructs a GUIField.

Parameters:
field - the field
Method Detail

updateField

public boolean updateField(Prompt prompt)
Updates the field from the view.

This implementation simply returns true.

Parameters:
prompt - the prompt to display messages
Returns:
true if the field was updated, false if the view is invalid

updateField

public boolean updateField(Prompt prompt,
                           boolean skipValidation)
Updates the field from the view.

This implementation simply returns true.

Parameters:
prompt - the prompt to display messages
Returns:
true if the field was updated, false if the view is invalid

updateView

public boolean updateView()
Updates the view from the field.

This implementation simply returns false.

Returns:
true if the view was updated

getComponents

public List<Component> getComponents()
Returns the components that make up the view.

Returns:
the components

getFirstFocusableComponent

public abstract JComponent getFirstFocusableComponent()
Return a JComponent of this field which is the primary candidate to gain focus.

Returns:
the primary JComponent to gain focus

setUpdateListener

public void setUpdateListener(UpdateListener listener)
Registers a listener to be notified of field updates.

Parameters:
listener - the listener to notify

addField

protected void addField(JComponent component)
Adds the field.

This adds the field description (if any), the field label, and field component.

Parameters:
component - the component

addLabel

protected void addLabel()
Adds the label for the field.


addLabel

protected void addLabel(String label)
Adds a label.

Parameters:
label - the label

addComponent

protected void addComponent(JComponent component,
                            Object constraints)
Adds a component.

Parameters:
component - the component
constraints - the component constraints

translateStaticText

public final boolean translateStaticText()
Refresh not editable texts to replace variables

Returns:
whether the text changed

addTooltip

protected void addTooltip()
Adds the tooltip to each component in this view.


addDescription

protected void addDescription()
Adds a field description to the list of UI elements.

The description spans both columns.


addText

protected void addText(String text)
Adds a static text field.

The text spans both columns and may include html.

Parameters:
text - the text. May be null

notifyUpdateListener

protected void notifyUpdateListener()
Notifies any registered listener that the view has updated.


getInstallData

protected InstallData getInstallData()
Returns the installation data.

Returns:
the installation data

replaceVariables

protected String replaceVariables(String value)
Helper to replace variables in a string.

Parameters:
value - the string to perform variable replacement on. May be null
Returns:
the string with any variables replaced with their values

warning

protected void warning(String message,
                       Prompt prompt)
Show localized warning message dialog basing on given parameters.

Parameters:
message - the message to print out in dialog box.
prompt - the prompt to use


Copyright © 2018. All rights reserved.