Package org.jppf.ui.treetable
Class AbstractTreeTableModel
java.lang.Object
org.jppf.ui.treetable.AbstractTreeTableModel
- All Implemented Interfaces:
Serializable,TreeModel,TreeTableModel
- Direct Known Subclasses:
AbstractJPPFTreeTableModel,FileSystemModel
An abstract implementation of the TreeTableModel interface, handling the list of listeners.
- Version:
- %I% %G%
- Author:
- Philip Milne
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EventListenerListThe list of event listeners for this tree table model.protected ObjectThe tree root. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTreeTableModel(Object root) Initialize this model with the specified tree root. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidfireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children) Notify all listeners that have registered interest for notification on this event type.protected voidfireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children) Notify all listeners that have registered interest for notification on this event type.protected voidfireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) Notify all listeners that have registered interest for notification on this event type.protected voidfireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) Notify all listeners that have registered interest for notification on this event type.Class<?>getColumnClass(int column) Returns the type for column numbercolumn.getColumnTooltip(int column) Returns the tooltip for column numbercolumn.intgetIndexOfChild(Object parent, Object child) getRoot()booleanisCellEditable(Object node, int column) By default, make the column with the Tree in it the only editable one.booleanvoidvoidsetValueAt(Object aValue, Object node, int column) Sets the value for nodenode, at column numbercolumn.voidvalueForPathChanged(TreePath path, Object newValue) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.tree.TreeModel
getChild, getChildCountMethods inherited from interface org.jppf.ui.treetable.TreeTableModel
getColumnCount, getColumnName, getValueAt
-
Field Details
-
root
The tree root. -
listenerList
The list of event listeners for this tree table model.
-
-
Constructor Details
-
AbstractTreeTableModel
Initialize this model with the specified tree root.- Parameters:
root- the root of the tree.
-
-
Method Details
-
getRoot
-
isLeaf
-
valueForPathChanged
- Specified by:
valueForPathChangedin interfaceTreeModel
-
getIndexOfChild
- Specified by:
getIndexOfChildin interfaceTreeModel
-
addTreeModelListener
- Specified by:
addTreeModelListenerin interfaceTreeModel
-
removeTreeModelListener
- Specified by:
removeTreeModelListenerin interfaceTreeModel
-
fireTreeNodesChanged
protected void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children) Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.- Parameters:
source- the source of the event.path- the path of the parent node whose children have changed.childIndices- the indices of the children that changed.children- an array of the children that changed.- See Also:
-
fireTreeNodesInserted
protected void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children) Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.- Parameters:
source- the source of the event.path- the path of the parent node whose children have changed.childIndices- the indices of the children that were inserted.children- an array of the children that were inserted.- See Also:
-
fireTreeNodesRemoved
protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.- Parameters:
source- the source of the event.path- the path of the parent node whose children have changed.childIndices- the indices of the children that were removed.children- an array of the children that were removed.- See Also:
-
fireTreeStructureChanged
protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.- Parameters:
source- the source of the event.path- the path of the parent node whose children have changed.childIndices- the indices of the children that have changed.children- an array of the children that changed.- See Also:
-
getColumnClass
Description copied from interface:TreeTableModelReturns the type for column numbercolumn.- Specified by:
getColumnClassin interfaceTreeTableModel- Parameters:
column- the column number.- Returns:
- the type of the column.
-
isCellEditable
By default, make the column with the Tree in it the only editable one. Making this column editable causes the JTable to forward mouse and keyboard events in the Tree column to the underlying JTree. Indicates whether the the value for nodenode, at column numbercolumnis editable.- Specified by:
isCellEditablein interfaceTreeTableModel- Parameters:
node- the node to check.column- the column where the value is.- Returns:
- true if the cell is editable, false otherwise.
-
setValueAt
Description copied from interface:TreeTableModelSets the value for nodenode, at column numbercolumn.- Specified by:
setValueAtin interfaceTreeTableModel- Parameters:
aValue- the value to set.node- the node for which to set the value.column- the column where the value is to be set.
-
getColumnTooltip
Description copied from interface:TreeTableModelReturns the tooltip for column numbercolumn.- Specified by:
getColumnTooltipin interfaceTreeTableModel- Parameters:
column- the column number.- Returns:
- the name of the column as a string.
-