de.mguennewig.pobjform.swing
Class SwingRecordElement

java.lang.Object
  extended by de.mguennewig.pobjform.AbstractFormElement
      extended by de.mguennewig.pobjform.AbstractValueElement
          extended by de.mguennewig.pobjform.AbstractRecordElement
              extended by de.mguennewig.pobjform.swing.SwingRecordElement
All Implemented Interfaces:
FormElement, RecordElement, SwingFormElement, ValueElement, java.lang.Iterable<java.lang.String>
Direct Known Subclasses:
PClassSwingSearchForm.SwingColumn, PClassSwingSearchForm.SwingCondition

public class SwingRecordElement
extends AbstractRecordElement
implements SwingFormElement

A Swing implementation of an RecordElement.

Author:
Michael Günnewig

Constructor Summary
SwingRecordElement(PObjSwingForm form, RecordEntry entry)
          Creates a new SwingRecordElement.
 
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.
 boolean isVisible()
          Tests whether this element will write anything visible.
 void updateErrorComponent()
          Updates the error messages that are displayed by the error component.
 
Methods inherited from class de.mguennewig.pobjform.AbstractRecordElement
appendToList, getCurrentString, getElement, getInitialObject, getInitialString, getNumElement, getObject, hasChanged, isMandatory, iterator, setCurrentAsInitialState, setObject, setObject, setProperty, setVisible, validate
 
Methods inherited from class de.mguennewig.pobjform.AbstractFormElement
getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, isPulledIn, omitRowHeader, setLabel, 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, omitRowHeader, setLabel, setProperty, setPullInPrefix, setVisible, startsNewCell, validate
 

Constructor Detail

SwingRecordElement

public SwingRecordElement(PObjSwingForm form,
                          RecordEntry entry)
Creates a new SwingRecordElement.

Method Detail

isVisible

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

Specified by:
isVisible in interface FormElement

getComponent

public javax.swing.JComponent getComponent()
Returns the Swing component for the input element.

Specified by:
getComponent in interface SwingFormElement

getErrorComponent

public javax.swing.JComponent getErrorComponent()
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()
Returns the Swing component to display the label.

Specified by:
getLabelComponent in interface SwingFormElement

updateErrorComponent

public void updateErrorComponent()
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)