com.jgoodies.validation.view
Class ValidationResultListAdapter

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by com.jgoodies.validation.view.ValidationResultListAdapter
All Implemented Interfaces:
Serializable, ListModel

public final class ValidationResultListAdapter
extends AbstractListModel

Converts a ValidationResultModel into a ListModel. Useful to bind JLists and JTables to a validation result model.

Version:
$Revision: 1.12 $
Author:
Karsten Lentzsch
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
ValidationResultListAdapter(ValidationResultModel model)
          Constructs a ValidationResultListAdapter that converts the given model into a ListModel.
 
Method Summary
 Object getElementAt(int index)
          Returns the validation result message at the given index.
 int getSize()
          Returns the number of validation result messages.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationResultListAdapter

public ValidationResultListAdapter(ValidationResultModel model)
Constructs a ValidationResultListAdapter that converts the given model into a ListModel. Observes the given model to update this adapter every time the validation result changes.

Parameters:
model - the model that provides the validation result
Method Detail

getElementAt

public Object getElementAt(int index)
Returns the validation result message at the given index.

Parameters:
index - the index of the message to return
Returns:
the validation result message at the given index
See Also:
ListModel.getElementAt(int)

getSize

public int getSize()
Returns the number of validation result messages.

Returns:
the number of validation result messages
See Also:
ListModel.getSize()


Copyright © 2003-2011 JGoodies Karsten Lentzsch. All Rights Reserved.