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
TableEditorValidationHandlerinterface.This implementation simply concatenates all error messages contained in the passed in
FormValidatorResultsobjects and displays them in a message box. (For this purpose the application'sMessageOutputobject 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 ApplicationgetApplication()Returns a reference to theApplicationobject.MessageOutputgetOutput()Returns the message output object used for displaying message boxes.voidsetApplication(Application app)Initializes this object with a reference to the centralApplicationobject.voidsetOutput(MessageOutput output)Sets the message output object to be used for displaying message boxes.booleanvalidationPerformed(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 theApplicationobject. This object is used internally for accessing some global information.- Returns:
- a reference to the used
Applicationobject (can be null)
-
setApplication
public void setApplication(Application app)
Initializes this object with a reference to the centralApplicationobject. If noMessageOutputobject has been set so far, this implementation obtains theMessageOutputfrom the application. It will be used invalidationPerformed()for displaying error messages. TheApplicationobject itself is stored, too because it is needed for accessing some global information. If you want to use a differentMessageOutputobject than the one associated with the application, you have to callsetOutput()explicitly.- Parameters:
app- the centralApplicationobject
-
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 centralApplicationobject has been initialized, a message box will be displayed.- Specified by:
validationPerformedin 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)
-
-