Package org.jppf.ui.treetable
Class AbstractJPPFTreeTableModel
java.lang.Object
org.jppf.ui.treetable.AbstractTreeTableModel
org.jppf.ui.treetable.AbstractJPPFTreeTableModel
- All Implemented Interfaces:
Serializable,TreeModel,TreeTableModel
- Direct Known Subclasses:
JobTreeTableModel,JVMHealthTreeTableModel,NodeTreeTableModel
Abstract tree table model implementation for tree table-based options.
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringBase name for localization bundle lookups.protected LocaleThe locale used to translate coumn headers and cell values.protected final NumberFormatFormatter for cells that contain decimal numbers.protected final NumberFormatFormatter for cells that contain integer numbers.protected final NumberFormatFormatter for cells that contain decimal numbers.Fields inherited from class org.jppf.ui.treetable.AbstractTreeTableModel
listenerList, root -
Constructor Summary
ConstructorsConstructorDescriptionInitialize this model with the specified tree root.AbstractJPPFTreeTableModel(TreeNode root, Locale locale) Initialize this model with the specified tree root. -
Method Summary
Modifier and TypeMethodDescriptionvoidHandle a node update.protected NumberFormatGet a number formatter for the number of tasks for each node.protected NumberFormatGet a number formatter for values expressed in MB.protected NumberFormatGet a number formatter for the number of tasks for each node.abstract StringgetBaseColumnName(int column) Get the non-localized name of the specified column.Return the child at the specified index from the specified parent node.intgetChildCount(Object parent) Get the number of children for the specified node.Class<?>getColumnClass(int column) Determine the class of th specified column.getColumnName(int column) Returns the name for column numbercolumn.getColumnTooltip(int column) Returns the tooltip for column numbercolumn.voidinsertNodeInto(DefaultMutableTreeNode child, DefaultMutableTreeNode parent, int pos) Insert the specified child into the specified parent's list of children at the specified position.booleanisCellEditable(Object node, int column) Tells if a cell can be edited.protected StringGet a localized message given its unique name and the current locale.voidRemove a node from the tree.voidsetValueAt(Object value, Object node, int column) Called when done editing a cell.Methods inherited from class org.jppf.ui.treetable.AbstractTreeTableModel
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChangedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jppf.ui.treetable.TreeTableModel
getColumnCount, getValueAt
-
Field Details
-
i18nBase
Base name for localization bundle lookups. -
locale
The locale used to translate coumn headers and cell values. -
nfInt
Formatter for cells that contain integer numbers. -
nfDec
Formatter for cells that contain decimal numbers. -
nfMB
Formatter for cells that contain decimal numbers.
-
-
Constructor Details
-
AbstractJPPFTreeTableModel
Initialize this model with the specified tree root.- Parameters:
root- the root of the tree.
-
AbstractJPPFTreeTableModel
Initialize this model with the specified tree root.- Parameters:
root- the root of the tree.locale- the locale used to translate coumn headers and cell values.
-
-
Method Details
-
isCellEditable
Tells if a cell can be edited.- Specified by:
isCellEditablein interfaceTreeTableModel- Overrides:
isCellEditablein classAbstractTreeTableModel- Parameters:
node- not used.column- not used.- Returns:
- true if the cell can be edited, false otherwise.
-
setValueAt
Called when done editing a cell. This method has an empty implementation and does nothing.- Specified by:
setValueAtin interfaceTreeTableModel- Overrides:
setValueAtin classAbstractTreeTableModel- Parameters:
value- not used.node- not used.column- not used.
-
getChild
Return the child at the specified index from the specified parent node.- Parameters:
parent- the parent to get the child from.index- the index at which to get the child- Returns:
- the child node, or null if the index is not valid.
-
getChildCount
Get the number of children for the specified node.- Parameters:
parent- the node for which to get the number of children.- Returns:
- the number of children as an int.
-
insertNodeInto
Insert the specified child into the specified parent's list of children at the specified position.- Parameters:
child- the node to insert into the parent.parent- the node into which to insert the child.pos- the position at which to insert the node.
-
removeNodeFromParent
Remove a node from the tree.- Parameters:
node- the node to remove from the parent.
-
changeNode
Handle a node update.- Parameters:
node- the node to update.
-
getColumnClass
Determine the class of th specified column.- Specified by:
getColumnClassin interfaceTreeTableModel- Overrides:
getColumnClassin classAbstractTreeTableModel- Parameters:
column- - the column index.- Returns:
- a
Classinstance.
-
localize
Get a localized message given its unique name and the current locale.- Parameters:
message- the unique name of the localized message.- Returns:
- a message in the current locale, or the default locale if the localization for the current locale is not found.
-
getColumnName
Description copied from interface:TreeTableModelReturns the name for column numbercolumn.- Parameters:
column- the column number.- Returns:
- the name of the column as a string.
-
getColumnTooltip
Description copied from interface:TreeTableModelReturns the tooltip for column numbercolumn.- Specified by:
getColumnTooltipin interfaceTreeTableModel- Overrides:
getColumnTooltipin classAbstractTreeTableModel- Parameters:
column- the column number.- Returns:
- the name of the column as a string.
-
getBaseColumnName
Get the non-localized name of the specified column.- Parameters:
column- the index of the column for which to get a name.- Returns:
- the column name as a string.
-
createNumberFormat
Get a number formatter for the number of tasks for each node.- Returns:
- a
NumberFormatinstance.
-
createDecimalNumberFormat
Get a number formatter for the number of tasks for each node.- Returns:
- a
NumberFormatinstance.
-
createMBFormat
Get a number formatter for values expressed in MB.- Returns:
- a
NumberFormatinstance.
-
getI18nBase
- Returns:
- the base name for localization bundle lookups.
-