org.openpermis.editor.policy.gui.checklist
Class CheckListModel<T>

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.openpermis.editor.policy.gui.checklist.CheckListModel<T>
Type Parameters:
T - type of the items in the check list model.
All Implemented Interfaces:
Serializable, TableModel

public class CheckListModel<T>
extends AbstractTableModel

Creates a model that manages a pool of items and a selection list from the pool.

See Also:
Serialized Form
Since:
0.1.0

Nested Class Summary
(package private) static class CheckListModel.ColumnType
          Describes the type of a column, including getters and setters.
private  class CheckListModel.PoolListener
          Synchronizes the check list model if a change in the pool list occurs.
private  class CheckListModel.SelectionListener
          Synchronizes the check list model if a change in the selection list occurs.
 
Field Summary
private  org.jdesktop.observablecollections.ObservableList<T> pool
          The pool of available items that can be chosen.
private  CheckListModel.PoolListener poolListener
          Listener that synchronizes the state of the table model and the pool list.
private  org.jdesktop.observablecollections.ObservableList<T> selection
          The currently selected items from the pool.
private  CheckListModel.SelectionListener selectionListener
          Listener that refreshes the check list whenever a change occurs.
private static long serialVersionUID
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
CheckListModel(org.jdesktop.observablecollections.ObservableList<T> pool, org.jdesktop.observablecollections.ObservableList<T> selection)
          Creates a new check list model.
 
Method Summary
 void configureListeners()
          Adds listeners to synchronize the list with the table model.
 Class<?> getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int columnIndex)
           
private  CheckListModel.ColumnType getColumnType(int columnIndex)
          Returns the type of the column at the specified index.
 int getRowCount()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void setValueAt(Object value, int rowIndex, int columnIndex)
           
 void unconfigureListeners()
          Removes the listeners to synchronize the list with the table model added in configureListeners().
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Constant Field Value:
4791486544723792077L
Since:
0.3.0

pool

private final org.jdesktop.observablecollections.ObservableList<T> pool
The pool of available items that can be chosen.

Since:
0.1.0

poolListener

private final CheckListModel.PoolListener poolListener
Listener that synchronizes the state of the table model and the pool list.

Since:
0.1.0

selection

private final org.jdesktop.observablecollections.ObservableList<T> selection
The currently selected items from the pool.

Since:
0.1.0

selectionListener

private final CheckListModel.SelectionListener selectionListener
Listener that refreshes the check list whenever a change occurs.

Since:
0.1.0
Constructor Detail

CheckListModel

public CheckListModel(org.jdesktop.observablecollections.ObservableList<T> pool,
                      org.jdesktop.observablecollections.ObservableList<T> selection)
Creates a new check list model.

Parameters:
pool - the poolof available items that can be chosen.
selection - the currently selected items from the pool.
Since:
0.1.0
Method Detail

configureListeners

public void configureListeners()
Adds listeners to synchronize the list with the table model.

Since:
0.1.0

unconfigureListeners

public void unconfigureListeners()
Removes the listeners to synchronize the list with the table model added in configureListeners().

Since:
0.1.0

getColumnType

private CheckListModel.ColumnType getColumnType(int columnIndex)
Returns the type of the column at the specified index.

Parameters:
columnIndex - the index for which to retrieve the column type.
Returns:
the type requested.
Since:
0.1.0

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel
Since:
0.1.0

getColumnClass

public Class<?> getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
Since:
0.1.0

getColumnName

public String getColumnName(int columnIndex)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Since:
0.1.0

getColumnCount

public int getColumnCount()
Since:
0.1.0

getRowCount

public int getRowCount()
Since:
0.1.0

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Since:
0.1.0

setValueAt

public void setValueAt(Object value,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel
Since:
0.1.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:48
Copyright (c) 2002-2007 Ergon Informatik AG