Class DefaultTableEditorValidationHandler
- java.lang.Object
-
- net.sf.jguiraffe.gui.builder.components.tags.table.DefaultTableEditorValidationHandler
-
- All Implemented Interfaces:
TableEditorValidationHandler
public class DefaultTableEditorValidationHandler extends Object implements TableEditorValidationHandler
A default implementation of the
TableEditorValidationHandler
interface.This implementation simply concatenates all error messages contained in the passed in
FormValidatorResults
objects and displays them in a message box. (For this purpose the application'sMessageOutput
object is used.) If validation was successful, no action is performed.- Since:
- 1.3
- Version:
- $Id$
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description DefaultTableEditorValidationHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Application
getApplication()
Returns a reference to theApplication
object.MessageOutput
getOutput()
Returns the message output object used for displaying message boxes.void
setApplication(Application app)
Initializes this object with a reference to the centralApplication
object.void
setOutput(MessageOutput output)
Sets the message output object to be used for displaying message boxes.boolean
validationPerformed(Object table, Form editForm, TableTag tableTag, FormValidatorResults results, int row, int col)
Reacts on a validation.
-
-
-
Method Detail
-
getOutput
public MessageOutput getOutput()
Returns the message output object used for displaying message boxes.- Returns:
- the output object
-
setOutput
public void setOutput(MessageOutput output)
Sets the message output object to be used for displaying message boxes. This object can be null, then no messages will be displayed.- Parameters:
output
- the output object to be used
-
getApplication
public Application getApplication()
Returns a reference to theApplication
object. This object is used internally for accessing some global information.- Returns:
- a reference to the used
Application
object (can be null)
-
setApplication
public void setApplication(Application app)
Initializes this object with a reference to the centralApplication
object. If noMessageOutput
object has been set so far, this implementation obtains theMessageOutput
from the application. It will be used invalidationPerformed()
for displaying error messages. TheApplication
object itself is stored, too because it is needed for accessing some global information. If you want to use a differentMessageOutput
object than the one associated with the application, you have to callsetOutput()
explicitly.- Parameters:
app
- the centralApplication
object
-
validationPerformed
public boolean validationPerformed(Object table, Form editForm, TableTag tableTag, FormValidatorResults results, int row, int col)
Reacts on a validation. If some fields are invalid, and the current message output object is not null, and the reference to the centralApplication
object has been initialized, a message box will be displayed.- Specified by:
validationPerformed
in interfaceTableEditorValidationHandler
- Parameters:
table
- the table component (this is expected to be of classjavax.swing.JTable
)editForm
- the editor formtableTag
- the tag with the table definitionresults
- the object with the validation resultsrow
- the current row indexcol
- the current column index- Returns:
- a flag whether field values have been modified (this implementation always returns false)
-
-