de.mguennewig.pobjform.swing
Class SwingButtonElement

java.lang.Object
  extended by de.mguennewig.pobjform.AbstractFormElement
      extended by de.mguennewig.pobjform.AbstractButtonElement
          extended by de.mguennewig.pobjform.swing.SwingButtonElement
All Implemented Interfaces:
ButtonElement, FormElement, SwingFormElement, java.awt.event.ActionListener, java.util.EventListener

public class SwingButtonElement
extends AbstractButtonElement
implements SwingFormElement, java.awt.event.ActionListener

Class description goes here.

Author:
Michael Günnewig

Constructor Summary
SwingButtonElement(PObjSwingForm form, ButtonEntry entry)
          Creates a new SwingButtonElement.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 javax.swing.JComponent getComponent()
          Returns the Swing component for the input element.
 javax.swing.JComponent getErrorComponent()
          Returns the Swing component to display any errors.
 javax.swing.JLabel getLabelComponent()
          Returns the Swing component to display the label.
 boolean hasPressed()
          Tests whether the button has been pressed by the user.
 void resetPressed()
          Clears the currently set pressed status.
 void setButtonLabel(java.lang.String buttonLabel)
          Sets the label that will be displayed within the button.
 void setVisible(boolean visible)
          Sets whether the button is visible.
 void updateErrorComponent()
          Updates the error messages that are displayed by the error component.
 
Methods inherited from class de.mguennewig.pobjform.AbstractButtonElement
getButtonLabel, hasChanged, isMandatory, isVisible, validate
 
Methods inherited from class de.mguennewig.pobjform.AbstractFormElement
appendToList, getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, isPulledIn, omitRowHeader, setLabel, setProperty, setPullInPrefix, startsNewCell
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.mguennewig.pobjform.FormElement
appendToList, getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, hasChanged, isMandatory, isPulledIn, isVisible, omitRowHeader, setLabel, setProperty, setPullInPrefix, startsNewCell, validate
 

Constructor Detail

SwingButtonElement

public SwingButtonElement(PObjSwingForm form,
                          ButtonEntry entry)
Creates a new SwingButtonElement.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

hasPressed

public final boolean hasPressed()
Tests whether the button has been pressed by the user.

Specified by:
hasPressed in interface ButtonElement

resetPressed

public final void resetPressed()
Clears the currently set pressed status.

Specified by:
resetPressed in interface ButtonElement

setButtonLabel

public void setButtonLabel(java.lang.String buttonLabel)
Sets the label that will be displayed within the button.

Specified by:
setButtonLabel in interface ButtonElement
Overrides:
setButtonLabel in class AbstractButtonElement

setVisible

public void setVisible(boolean visible)
Sets whether the button is visible.

Specified by:
setVisible in interface ButtonElement
Specified by:
setVisible in interface FormElement
Overrides:
setVisible in class AbstractButtonElement

getComponent

public final javax.swing.JComponent getComponent()
Description copied from interface: SwingFormElement
Returns the Swing component for the input element.

Specified by:
getComponent in interface SwingFormElement

getErrorComponent

public final javax.swing.JComponent getErrorComponent()
Description copied from interface: SwingFormElement
Returns the Swing component to display any errors.

This method must return a valid component for any element that can have an error even if currently no error exists.

Specified by:
getErrorComponent in interface SwingFormElement
Returns:
A Swing component if this element can have any errors, otherwise null is acceptable.
See Also:
SwingFormElement.updateErrorComponent()

getLabelComponent

public javax.swing.JLabel getLabelComponent()
Description copied from interface: SwingFormElement
Returns the Swing component to display the label.

Specified by:
getLabelComponent in interface SwingFormElement

updateErrorComponent

public void updateErrorComponent()
Description copied from interface: SwingFormElement
Updates the error messages that are displayed by the error component.

To prevent layout changes of the dialog the error component is always present in the dialog even if no error currently exists. This method will be called every time possible error messages have been added to the form.

Specified by:
updateErrorComponent in interface SwingFormElement
See Also:
SwingFormElement.getErrorComponent(), PObjForm.addMessage(String,de.mguennewig.pobjform.Message)