de.mguennewig.pobjform.swing
Class SwingInputElement

java.lang.Object
  extended by de.mguennewig.pobjform.AbstractFormElement
      extended by de.mguennewig.pobjform.AbstractValueElement
          extended by de.mguennewig.pobjform.AbstractInputElement
              extended by de.mguennewig.pobjform.swing.SwingInputElement
All Implemented Interfaces:
FormElement, InputElement, SwingFormElement, ValueElement
Direct Known Subclasses:
SwingCheckboxElement, SwingReferenceElement, SwingStringElement, SwingTextAreaElement

public abstract class SwingInputElement
extends AbstractInputElement
implements SwingFormElement

Class description goes here.

Author:
Michael Günnewig

Field Summary
 
Fields inherited from interface de.mguennewig.pobjform.InputElement
MAX_INPUT_SIZE, RENDER_AS_DISABLED, RENDER_AS_HIDDEN, RENDER_AS_HIDDEN_WITH_LABEL, RENDER_AS_INPUT, RENDER_AS_TEXT
 
Constructor Summary
SwingInputElement(PObjSwingForm form, InputEntry entry)
          Creates a new SwingInputElement.
 
Method Summary
 javax.swing.JComponent getErrorComponent()
          Returns the Swing component to display any errors.
 java.lang.Object getInitialObject()
          Returns the initial object.
 java.lang.String getInitialString()
          Returns the string representation of the initial object.
 javax.swing.JLabel getLabelComponent()
          Returns the Swing component to display the label.
 boolean hasChanged()
          Tests whether the data for this element has been changed.
 void setCurrentAsInitialState()
          Copies the current state to the initial state.
 void setInitialString(java.lang.String initial)
           
 void setLabel(java.lang.String label)
          Sets the label of this form element to a new value.
 void setRenderAs(int renderAs)
          
 void updateErrorComponent()
          Updates the error messages that are displayed by the error component.
 
Methods inherited from class de.mguennewig.pobjform.AbstractInputElement
addChangeListener, getChangeListeners, getInputEntry, getObject, getRenderAs, getType, getVisualString, isHiddenInput, isMandatory, isRightAligned, isVisible, removeChangeListener, setMandatory, setObject, setRightAligned, setVisible, validate
 
Methods inherited from class de.mguennewig.pobjform.AbstractFormElement
appendToList, getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, isPulledIn, omitRowHeader, 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.swing.SwingFormElement
getComponent
 
Methods inherited from interface de.mguennewig.pobjform.FormElement
appendToList, getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, isMandatory, isPulledIn, isVisible, omitRowHeader, setProperty, setPullInPrefix, setVisible, startsNewCell, validate
 
Methods inherited from interface de.mguennewig.pobjform.ValueElement
getCurrentString
 

Constructor Detail

SwingInputElement

public SwingInputElement(PObjSwingForm form,
                         InputEntry entry)
Creates a new SwingInputElement.

Method Detail

setLabel

public void setLabel(java.lang.String label)
Sets the label of this form element to a new value.

Specified by:
setLabel in interface FormElement
Overrides:
setLabel in class AbstractFormElement

setRenderAs

public void setRenderAs(int renderAs)

Specified by:
setRenderAs in interface InputElement
Overrides:
setRenderAs in class AbstractInputElement

hasChanged

public boolean hasChanged()
Description copied from interface: FormElement
Tests whether the data for this element has been changed.

Specified by:
hasChanged in interface FormElement

getInitialObject

public java.lang.Object getInitialObject()
Description copied from interface: ValueElement
Returns the initial object.

Specified by:
getInitialObject in interface ValueElement

getInitialString

public final java.lang.String getInitialString()
Description copied from interface: ValueElement
Returns the string representation of the initial object.

Specified by:
getInitialString in interface ValueElement

setInitialString

public void setInitialString(java.lang.String initial)

setCurrentAsInitialState

public void setCurrentAsInitialState()
Description copied from interface: ValueElement
Copies the current state to the initial state.

Specified by:
setCurrentAsInitialState in interface ValueElement

getLabelComponent

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

Specified by:
getLabelComponent 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()

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)