de.mguennewig.pobjform.swing
Class SwingTextElement

java.lang.Object
  extended by de.mguennewig.pobjform.AbstractFormElement
      extended by de.mguennewig.pobjform.AbstractTextElement
          extended by de.mguennewig.pobjform.swing.SwingTextElement
All Implemented Interfaces:
FormElement, SwingFormElement, TextElement

public final class SwingTextElement
extends AbstractTextElement
implements SwingFormElement

Class description goes here.

Author:
Michael Günnewig

Constructor Summary
SwingTextElement(PObjSwingForm form, TextEntry entry)
          Creates a new SwingTextElement.
 
Method Summary
 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.
 void setRightAligned(boolean rightAligned)
          Sets whether the text should be right aligned.
 void setText(java.lang.String text)
          
 void updateErrorComponent()
          Updates the error messages that are displayed by the error component.
 
Methods inherited from class de.mguennewig.pobjform.AbstractTextElement
getText, hasChanged, isMandatory, isRightAligned, isVisible, setVisible, 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, setVisible, startsNewCell, validate
 

Constructor Detail

SwingTextElement

public SwingTextElement(PObjSwingForm form,
                        TextEntry entry)
Creates a new SwingTextElement.

Method Detail

setText

public void setText(java.lang.String text)

Specified by:
setText in interface TextElement
Overrides:
setText in class AbstractTextElement

setRightAligned

public void setRightAligned(boolean rightAligned)
Sets whether the text should be right aligned.

Specified by:
setRightAligned in interface TextElement
Overrides:
setRightAligned in class AbstractTextElement

getComponent

public 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 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)

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