public static final class Models.CompoundModel extends Object implements ReorderableTreeModel, ExtendedNodeModel, CheckNodeModel, DnDNodeModel, NodeActionsProvider, TableHTMLModel, TreeExpansionModel, TableRendererModel, TablePropertyEditorsModel
| Modifier and Type | Method and Description |
|---|---|
void |
addModelListener(ModelListener l)
Registers given listener.
|
Executor |
asynchronous(AsynchronousModelFilter.CALL asynchCall,
Object node) |
boolean |
canCopy(Object node)
Test whether this node permits copying.
|
boolean |
canCut(Object node)
Test whether this node permits cutting.
|
boolean |
canEditCell(Object node,
String columnID)
Test whether this renderer can edit the given cell.
|
boolean |
canRename(Object node)
Test whether this node permits renaming.
|
boolean |
canRenderCell(Object node,
String columnID)
Test whether this renderer can render the given cell.
|
boolean |
canReorder(Object parent)
Provide if this model implementation can reorder children nodes.
|
Transferable |
clipboardCopy(Object node)
Called when a node is to be copied to the clipboard.
|
Transferable |
clipboardCut(Object node)
Called when a node is to be cut to the clipboard.
|
Transferable |
drag(Object node)
Initiate a drag operation.
|
Action[] |
getActions(Object node)
Returns set of actions for given node.
|
int |
getAllowedDragActions()
Action constants from
DnDConstants. |
int |
getAllowedDropActions(Transferable t)
Action constants from
DnDConstants. |
TableCellEditor |
getCellEditor(Object node,
String columnID)
Get the editor of the given cell
|
TableCellRenderer |
getCellRenderer(Object node,
String columnID)
Get the renderer of the given cell
|
Object[] |
getChildren(Object parent,
int from,
int to)
Returns children for given parent on given indexes.
|
int |
getChildrenCount(Object node)
Returns number of children for given node.
|
ColumnModel[] |
getColumns()
Returns sorted array of
ColumnModels. |
String |
getDisplayName(Object node)
Returns display name for given node.
|
PasteType |
getDropType(Object node,
Transferable t,
int action,
int index)
Determines if there is a paste operation that can be performed
on provided transferable when drop is done.
|
String |
getHelpId()
Get a help ID for this model.
|
String |
getHTMLValueAt(Object node,
String columnID)
Get the HTML value.
|
String |
getIconBase(Object node)
Returns icon for given node.
|
String |
getIconBaseWithExtension(Object node)
Returns icon resource with extension for given node.
|
PasteType[] |
getPasteTypes(Object node,
Transferable t)
Determine which paste operations are allowed when a given transferable is in the clipboard.
|
PropertyEditor |
getPropertyEditor(Object node,
String columnID)
Get the property editor for the given table cell.
|
Object |
getRoot()
Returns the root node of the tree or null, if the tree is empty.
|
String |
getShortDescription(Object node)
Returns tool tip for given node.
|
Object |
getValueAt(Object node,
String columnID)
Returns value to be displayed in column
columnID
and row identified by node. |
boolean |
hasHTMLValueAt(Object node,
String columnID)
Test if the model has a HTML value.
|
boolean |
isCheckable(Object node)
Tell the renderer to display the check-box.
|
boolean |
isCheckEnabled(Object node)
Provide the enabled state of the check-box.
|
boolean |
isExpanded(Object node)
Defines default state (collapsed, expanded) of given node.
|
boolean |
isLeaf(Object node)
Returns true if node is leaf.
|
boolean |
isReadOnly(Object node,
String columnID)
Returns true if value displayed in column
columnID
and row node is read only. |
Boolean |
isSelected(Object node)
Provide the selected state of the check-box.
|
void |
nodeCollapsed(Object node)
Called when given node is collapsed.
|
void |
nodeExpanded(Object node)
Called when given node is expanded.
|
void |
performDefaultAction(Object node)
Performs default action for given node.
|
void |
removeModelListener(ModelListener l)
Unregisters given listener.
|
void |
reorder(Object parent,
int[] perm)
Reorder children nodes with a given permutation.
|
void |
setName(Object node,
String name)
Sets a new name for given node.
|
void |
setSelected(Object node,
Boolean selected)
Called by the renderer when the check-box gets selected/unselected
|
void |
setValueAt(Object node,
String columnID,
Object value)
Changes a value displayed in column
columnID
and row node. |
String |
toString() |
public String getHelpId()
null.public Object getRoot()
public Object[] getChildren(Object parent, int from, int to) throws UnknownTypeException
getChildren in interface TreeModelparent - a parent of returned nodesfrom - a start indexto - a end indexUnknownTypeException - if this TreeModel implementation is not
able to resolve children for given node typeTreeModel.getChildrenCount(java.lang.Object)public int getChildrenCount(Object node) throws UnknownTypeException
getChildrenCount in interface TreeModelnode - the parent nodeUnknownTypeException - if this TreeModel implementation is not
able to resolve children for given node typeTreeModel.getChildren(java.lang.Object, int, int)public boolean isLeaf(Object node) throws UnknownTypeException
isLeaf in interface TreeModelUnknownTypeException - if this TreeModel implementation is not
able to resolve children for given node typepublic boolean canReorder(Object parent) throws UnknownTypeException
ReorderableTreeModelcanReorder in interface ReorderableTreeModelparent - The parent node of children that are test for reordertrue if this model can handle reordering of children,
false otherwiseUnknownTypeException - if this model implementation is not
able to decide the reorder capability for given node typepublic void reorder(Object parent, int[] perm) throws UnknownTypeException
ReorderableTreeModelreorder in interface ReorderableTreeModelparent - The parent node of children that are being reorderedperm - permutation with the length of current child nodes. The permutation
lists the new positions of the original nodes, that is, for nodes
[A,B,C,D] and permutation [0,3,1,2], the final
order would be [A,C,D,B].UnknownTypeException - if this model implementation is not
able to perform the reorder for given node typepublic String getDisplayName(Object node) throws UnknownTypeException
getDisplayName in interface NodeModelUnknownTypeException - if this NodeModel implementation is not
able to resolve display name for given node typepublic String getShortDescription(Object node) throws UnknownTypeException
getShortDescription in interface NodeModelUnknownTypeException - if this NodeModel implementation is not
able to resolve tool tip for given node typepublic String getIconBase(Object node) throws UnknownTypeException
getIconBase in interface NodeModelUnknownTypeException - if this NodeModel implementation is not
able to resolve icon for given node typepublic void performDefaultAction(Object node) throws UnknownTypeException
performDefaultAction in interface NodeActionsProviderUnknownTypeException - if this NodeActionsProvider implementation
is not able to resolve actions for given node typepublic Action[] getActions(Object node) throws UnknownTypeException
getActions in interface NodeActionsProviderUnknownTypeException - if this NodeActionsProvider implementation
is not able to resolve actions for given node typepublic ColumnModel[] getColumns()
ColumnModels.public Object getValueAt(Object node, String columnID) throws UnknownTypeException
TableModelcolumnID
and row identified by node. Column ID is defined in by
ColumnModel.getID(), and rows are defined by values returned from
TreeModel.getChildren(java.lang.Object, int, int).getValueAt in interface TableModelnode - a object returned from
TreeModel.getChildren(java.lang.Object, int, int) for this rowcolumnID - a id of column defined by ColumnModel.getID()UnknownTypeException - if there is no TableModel defined for given
parameter typepublic boolean isReadOnly(Object node, String columnID) throws UnknownTypeException
TableModelcolumnID
and row node is read only. Column ID is defined in by
ColumnModel.getID(), and rows are defined by values returned from
TreeModel.getChildren(java.lang.Object, int, int).isReadOnly in interface TableModelnode - a object returned from TreeModel.getChildren(java.lang.Object, int, int) for this rowcolumnID - a id of column defined by ColumnModel.getID()UnknownTypeException - if there is no TableModel defined for given
parameter typepublic void setValueAt(Object node, String columnID, Object value) throws UnknownTypeException
TableModelcolumnID
and row node. Column ID is defined in by
ColumnModel.getID(), and rows are defined by values returned from
TreeModel.getChildren(java.lang.Object, int, int).setValueAt in interface TableModelnode - a object returned from TreeModel.getChildren(java.lang.Object, int, int) for this rowcolumnID - a id of column defined by ColumnModel.getID()value - a new value of variable on given positionUnknownTypeException - if there is no TableModel defined for given
parameter typepublic boolean isExpanded(Object node) throws UnknownTypeException
isExpanded in interface TreeExpansionModelnode - a nodeUnknownTypeExceptionpublic void nodeExpanded(Object node)
nodeExpanded in interface TreeExpansionModelnode - a expanded nodepublic void nodeCollapsed(Object node)
nodeCollapsed in interface TreeExpansionModelnode - a collapsed nodepublic void addModelListener(ModelListener l)
addModelListener in interface NodeModeladdModelListener in interface TableModeladdModelListener in interface TableRendererModeladdModelListener in interface TreeModell - the listener to addpublic void removeModelListener(ModelListener l)
removeModelListener in interface NodeModelremoveModelListener in interface TableModelremoveModelListener in interface TableRendererModelremoveModelListener in interface TreeModell - the listener to removepublic boolean canRename(Object node) throws UnknownTypeException
ExtendedNodeModelcanRename in interface ExtendedNodeModeltrue if soUnknownTypeExceptionpublic boolean canCopy(Object node) throws UnknownTypeException
ExtendedNodeModelcanCopy in interface ExtendedNodeModeltrue if soUnknownTypeExceptionpublic boolean canCut(Object node) throws UnknownTypeException
ExtendedNodeModelcanCut in interface ExtendedNodeModeltrue if soUnknownTypeExceptionpublic Transferable clipboardCopy(Object node) throws IOException, UnknownTypeException
ExtendedNodeModelclipboardCopy in interface ExtendedNodeModelnode - The node objectIOException - when the copy cannot be performedUnknownTypeExceptionpublic Transferable clipboardCut(Object node) throws IOException, UnknownTypeException
ExtendedNodeModelclipboardCut in interface ExtendedNodeModelnode - The node objectIOException - when the cut cannot be performedUnknownTypeExceptionpublic int getAllowedDragActions()
DnDNodeModelDnDConstants.
No actions are allowed by default.getAllowedDragActions in interface DnDNodeModelpublic int getAllowedDropActions(Transferable t)
DnDNodeModelDnDConstants.
No actions are allowed by default.getAllowedDropActions in interface DnDNodeModelt - The transferable for which the allowed drop actions are requested,
or null to get actions for the creation of DropTarget for the view.public Transferable drag(Object node) throws IOException, UnknownTypeException
DnDNodeModeldrag in interface DnDNodeModelnode - The node to dragIOException - when the drag cannot be performedUnknownTypeException - if this model implementation is not
able to perform drag for given node typepublic PasteType[] getPasteTypes(Object node, Transferable t) throws UnknownTypeException
ExtendedNodeModelgetPasteTypes in interface ExtendedNodeModelnode - The node objectt - the transferable in the clipboardUnknownTypeExceptionpublic PasteType getDropType(Object node, Transferable t, int action, int index) throws UnknownTypeException
DnDNodeModelgetDropType in interface DnDNodeModelnode - The node where to dropt - the transferable to dropaction - the Drag and Drop action from DnDConstantsindex - index between children the drop occured at or -1 if not specifiedUnknownTypeException - if this model implementation is not
able to perform drop for given node typepublic void setName(Object node, String name) throws UnknownTypeException
ExtendedNodeModelsetName in interface ExtendedNodeModelnode - The object to set the new name to.name - The new name for the given nodeUnknownTypeExceptionpublic String getIconBaseWithExtension(Object node) throws UnknownTypeException
ExtendedNodeModelspi.viewmodel.NodeModel.getIconBasegetIconBaseWithExtension in interface ExtendedNodeModelnode - The node objectUnknownTypeException - if this NodeModel implementation is not
able to resolve icon for given node typepublic boolean isCheckable(Object node) throws UnknownTypeException
CheckNodeModelisCheckable in interface CheckNodeModelnode - the tree node objecttrue if the check-box should be displayed, false otherwise.UnknownTypeExceptionpublic boolean isCheckEnabled(Object node) throws UnknownTypeException
CheckNodeModelisCheckEnabled in interface CheckNodeModelnode - the tree node objecttrue if the check-box should be enabled, false otherwise.UnknownTypeExceptionpublic Boolean isSelected(Object node) throws UnknownTypeException
CheckNodeModelisSelected in interface CheckNodeModelnode - the tree node objecttrue if the check-box should be selected,
false if it should be unselected and
null if the state is unknown.UnknownTypeExceptionpublic void setSelected(Object node, Boolean selected) throws UnknownTypeException
CheckNodeModelsetSelected in interface CheckNodeModelnode - the tree node objectselected - true if the check-box was selected,
false if the check-box was unselected.UnknownTypeExceptionpublic Executor asynchronous(AsynchronousModelFilter.CALL asynchCall, Object node) throws UnknownTypeException
UnknownTypeExceptionpublic boolean canRenderCell(Object node, String columnID) throws UnknownTypeException
TableRendererModelcanRenderCell in interface TableRendererModelnode - Tree node representing the rowcolumnID - The column nametrue if the implementation can render the given cell, false otherwiseUnknownTypeException - If the implementation can not decide whether to render the given cell.public TableCellRenderer getCellRenderer(Object node, String columnID) throws UnknownTypeException
TableRendererModelgetCellRenderer in interface TableRendererModelnode - Tree node representing the rowcolumnID - The column nameUnknownTypeException - If the implementation can not render the given cell.public boolean canEditCell(Object node, String columnID) throws UnknownTypeException
TableRendererModelcanEditCell in interface TableRendererModelnode - Tree node representing the rowcolumnID - The column nametrue if the implementation can edit the given cell, false otherwiseUnknownTypeException - If the implementation can not decide whether to edit the given cell.public TableCellEditor getCellEditor(Object node, String columnID) throws UnknownTypeException
TableRendererModelgetCellEditor in interface TableRendererModelnode - Tree node representing the rowcolumnID - The column nameUnknownTypeException - If the implementation can not edit the given cell.public boolean hasHTMLValueAt(Object node, String columnID) throws UnknownTypeException
TableHTMLModelfalse,
HTML value is is taken from the String value, if it contains some.
If this is not desired, return true here and null from
TableHTMLModel.getHTMLValueAt(java.lang.Object, java.lang.String).hasHTMLValueAt in interface TableHTMLModelnode - an object returned from TreeModel.getChildren(java.lang.Object, int, int)
for this rowcolumnID - an id of column defined by ColumnModel.getID()true if there is some HTML value to be returned
from TableHTMLModel.getHTMLValueAt(java.lang.Object, java.lang.String),
false otherwise.
When false is returned,
TableHTMLModel.getHTMLValueAt(java.lang.Object, java.lang.String) is not called.UnknownTypeException - if there is nothing to be provided for the given
parameter typepublic String getHTMLValueAt(Object node, String columnID) throws UnknownTypeException
TableHTMLModelgetHTMLValueAt in interface TableHTMLModelnode - an object returned from TreeModel.getChildren(java.lang.Object, int, int)
for this rowcolumnID - an id of column defined by ColumnModel.getID()null when no HTML value is provided.UnknownTypeException - if there is nothing to be provided for the given
parameter typeTableHTMLModel.hasHTMLValueAt(java.lang.Object, java.lang.String)public PropertyEditor getPropertyEditor(Object node, String columnID) throws UnknownTypeException
TablePropertyEditorsModelgetPropertyEditor in interface TablePropertyEditorsModelnode - an object returned from TreeModel.getChildren(java.lang.Object, int, int)
for this rowcolumnID - an id of column defined by ColumnModel.getID()null to use the column default one.UnknownTypeException - if there is nothing to be provided for the given
parameter typeBuilt on May 21 2013. | Portions Copyright 1997-2013 Oracle. All rights reserved.