de.mguennewig.pobjform
Class AbstractButtonElement

java.lang.Object
  extended by de.mguennewig.pobjform.AbstractFormElement
      extended by de.mguennewig.pobjform.AbstractButtonElement
All Implemented Interfaces:
ButtonElement, FormElement
Direct Known Subclasses:
HtmlButtonElement, SwingButtonElement

public abstract class AbstractButtonElement
extends AbstractFormElement
implements ButtonElement

Abstract implementation for a button form element.

Author:
Michael Günnewig

Constructor Summary
AbstractButtonElement(PObjForm form, ButtonEntry entry)
          Creates a new AbstractButtonElement.
 
Method Summary
 java.lang.String getButtonLabel()
          Returns the label that is displayed within the button.
 boolean hasChanged()
          Tests whether the data for this element has been changed.
 boolean isMandatory()
          Tests whether data for this element must be entered.
 boolean isVisible()
          Tests whether this element will write anything visible.
 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 validate()
          Checks for a valid value in this form element and any possible children.
 
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.ButtonElement
hasPressed, resetPressed
 
Methods inherited from interface de.mguennewig.pobjform.FormElement
appendToList, getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, isPulledIn, omitRowHeader, setLabel, setProperty, setPullInPrefix, startsNewCell
 

Constructor Detail

AbstractButtonElement

public AbstractButtonElement(PObjForm form,
                             ButtonEntry entry)
Creates a new AbstractButtonElement.

Method Detail

isMandatory

public final boolean isMandatory()
Tests whether data for this element must be entered.

Specified by:
isMandatory in interface FormElement

isVisible

public final boolean isVisible()
Tests whether this element will write anything visible.

Specified by:
isVisible in interface FormElement

hasChanged

public final boolean hasChanged()
Tests whether the data for this element has been changed.

Specified by:
hasChanged in interface FormElement
Returns:
always false as this element can't change.

validate

public final void validate()
Checks for a valid value in this form element and any possible children.

For this form element we need to do nothing.

Specified by:
validate in interface FormElement

getButtonLabel

public final java.lang.String getButtonLabel()
Returns the label that is displayed within the button.

Specified by:
getButtonLabel 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

setVisible

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

Specified by:
setVisible in interface ButtonElement
Specified by:
setVisible in interface FormElement