jaxx.runtime.validator.swing
Class SwingValidatorMessageTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
- All Implemented Interfaces:
- Serializable, EventListener, TableModel, org.nuiton.validator.bean.BeanValidatorListener
public class SwingValidatorMessageTableModel
- extends AbstractTableModel
- implements org.nuiton.validator.bean.BeanValidatorListener
The model of the table of errors.
The model listens validators messages and update his internal model from it.
- Since:
- 1.3
- Author:
- tchemit
- See Also:
- Serialized Form
|
Method Summary |
protected void |
addMessages(JComponent editor,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
boolean sort,
String... messages)
|
void |
addMessages(JComponent editor,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
String... messages)
|
protected void |
addMessages(SwingValidator<?> validator,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
boolean sort,
String... messages)
|
void |
addMessages(SwingValidator<?> validator,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
String... messages)
|
void |
clear()
|
void |
clearValidators()
|
protected void |
ensureColumnIndex(int index)
|
protected void |
ensureRowIndex(int rowIndex)
|
Class<?> |
getColumnClass(int columnIndex)
|
int |
getColumnCount()
|
String |
getColumnName(int column)
|
SwingValidatorMessage |
getRow(int rowIndex)
Obtain the message for a given row. |
int |
getRowCount()
|
Object |
getValueAt(int rowIndex,
int columnIndex)
|
boolean |
isCellEditable(int row,
int column)
|
void |
onFieldChanged(org.nuiton.validator.bean.BeanValidatorEvent event)
|
void |
registerValidator(SwingValidator<?> validator)
Register a validator for this model. |
void |
removeMessages(JComponent editor,
org.nuiton.validator.NuitonValidatorScope scope)
|
void |
removeMessages(JComponent editor,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope)
|
protected void |
removeMessages(JComponent editor,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
boolean notify)
|
protected void |
removeMessages(SwingValidator<?> validator,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
boolean notify,
String... messages)
|
void |
removeMessages(SwingValidator<?> validator,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
String... messages)
|
| Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
columnNames
public static final String[] columnNames
columnClasses
public static final Class<?>[] columnClasses
validators
protected transient List<SwingValidator<?>> validators
- list of registred validators
data
protected List<SwingValidatorMessage> data
- list of messages actual displayed
SwingValidatorMessageTableModel
public SwingValidatorMessageTableModel()
registerValidator
public void registerValidator(SwingValidator<?> validator)
- Register a validator for this model.
Note: a validator can not be register twice in the same model.
- Parameters:
validator - the validator to register
addMessages
public void addMessages(SwingValidator<?> validator,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
String... messages)
addMessages
public void addMessages(JComponent editor,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
String... messages)
removeMessages
public void removeMessages(JComponent editor,
org.nuiton.validator.NuitonValidatorScope scope)
removeMessages
public void removeMessages(SwingValidator<?> validator,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
String... messages)
removeMessages
public void removeMessages(JComponent editor,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope)
clear
public void clear()
clearValidators
public void clearValidators()
getRow
public SwingValidatorMessage getRow(int rowIndex)
- Obtain the message for a given row.
- Parameters:
rowIndex - the row index
- Returns:
- the message for the given row index
isCellEditable
public boolean isCellEditable(int row,
int column)
- Specified by:
isCellEditable in interface TableModel- Overrides:
isCellEditable in class AbstractTableModel
getColumnClass
public Class<?> getColumnClass(int columnIndex)
- Specified by:
getColumnClass in interface TableModel- Overrides:
getColumnClass in class AbstractTableModel
getColumnName
public String getColumnName(int column)
- Specified by:
getColumnName in interface TableModel- Overrides:
getColumnName in class AbstractTableModel
onFieldChanged
public void onFieldChanged(org.nuiton.validator.bean.BeanValidatorEvent event)
- Specified by:
onFieldChanged in interface org.nuiton.validator.bean.BeanValidatorListener
getRowCount
public int getRowCount()
- Specified by:
getRowCount in interface TableModel
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount in interface TableModel
getValueAt
public Object getValueAt(int rowIndex,
int columnIndex)
- Specified by:
getValueAt in interface TableModel
ensureRowIndex
protected void ensureRowIndex(int rowIndex)
throws ArrayIndexOutOfBoundsException
- Throws:
ArrayIndexOutOfBoundsException
ensureColumnIndex
protected void ensureColumnIndex(int index)
throws ArrayIndexOutOfBoundsException
- Throws:
ArrayIndexOutOfBoundsException
addMessages
protected void addMessages(SwingValidator<?> validator,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
boolean sort,
String... messages)
addMessages
protected void addMessages(JComponent editor,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
boolean sort,
String... messages)
removeMessages
protected void removeMessages(SwingValidator<?> validator,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
boolean notify,
String... messages)
removeMessages
protected void removeMessages(JComponent editor,
String fieldName,
org.nuiton.validator.NuitonValidatorScope scope,
boolean notify)
Copyright © 2008-2012 CodeLutin. All Rights Reserved.