public class DefaultNodeEditPolicy extends AbstractPolicy implements INodeEditPolicy
INodeEditPolicy
.Constructor and Description |
---|
DefaultNodeEditPolicy() |
Modifier and Type | Method and Description |
---|---|
ICommand |
getChangeKeyCommand(Object node,
ITreeTableModel model,
Object key)
Returns a command object that will perform the modification of the key
value of the given node.
|
ICommand |
getChangeValueCommand(Object node,
ITreeTableModel model,
Object value,
int index)
Returns a command object that will perform the modification of the key
value of the given node.
|
ICommand |
getCreateNodeCommand(Object node,
ITreeTableModel model,
Object key,
Object[] values)
Returns a command object that will perform the creation of a new tree /
hierarchy node in the given tree table model.
|
ICommand |
getDeleteNodesCommand(List<Object> nodes,
ITreeTableModel model)
Returns a command object that will perform the actual deletion of the
given nodes.
|
ICommand |
getInsertNodeCommand(Object node,
int childIndex,
ITreeTableModel model)
Returns a command object that will perform the insertion of a new tree /
hierarchy node in the given tree table model.
|
ICommand |
getReassignmentCommand(Object[] nodes,
Object oldParent,
int[] oldChildIndices,
Object newParent,
int[] newChildIndices,
ITreeTableModel model)
Returns the command that will be used to perform the reassingment of a
set of given nodes from one parent node to a new one.
|
boolean |
isCreateEnabled(ITreeTableModel model)
Determines if the tree table supports the creation of new tree nodes by
the user.
|
boolean |
isDeletable(Object node,
ITreeTableModel model)
Determines if the node can be deleted by the user.
|
boolean |
isKeyEditable(Object node,
ITreeTableModel model)
Determines if the key value of the given tree / hierarchy node can be
edited by the user.
|
boolean |
isReassignable(Object node,
Object newParentNode,
ITreeTableModel model)
Determines whether the first given tree table node can be reassigned to
the second tree table node by the user or not.
|
boolean |
isSelectable(Object node,
ITreeTableModel model)
Determines if the node can be selected by the user.
|
boolean |
isValueEditable(Object node,
ITreeTableModel model,
int modelIndex)
Determines if the column value with the given model index can be edited
by the user.
|
assertClass
public boolean isKeyEditable(Object node, ITreeTableModel model)
INodeEditPolicy
isKeyEditable
in interface INodeEditPolicy
node
- the node that is the target of the editing operationmodel
- the tree table model to which the node belongspublic boolean isValueEditable(Object node, ITreeTableModel model, int modelIndex)
INodeEditPolicy
isValueEditable
in interface INodeEditPolicy
node
- the node that is the target of the editing operationmodel
- the tree table model to which the node belongsmodelIndex
- the model index under which the column value can be looked up
and storedpublic boolean isDeletable(Object node, ITreeTableModel model)
INodeEditPolicy
isDeletable
in interface INodeEditPolicy
node
- the node that will be deletedmodel
- the tree table model to which the node belongspublic boolean isSelectable(Object node, ITreeTableModel model)
INodeEditPolicy
isSelectable
in interface INodeEditPolicy
node
- the node that will be selectedmodel
- the tree table model to which the node belongspublic boolean isCreateEnabled(ITreeTableModel model)
INodeEditPolicy
isCreateEnabled
in interface INodeEditPolicy
model
- the tree table model that will be modified if a new node gets
createdpublic boolean isReassignable(Object node, Object newParentNode, ITreeTableModel model)
INodeEditPolicy
isReassignable
in interface INodeEditPolicy
node
- the tree table node that will be checkednewParentNode
- the node that is the candidate to become the new parent of
nodemodel
- the tree table model to which the node belongspublic ICommand getDeleteNodesCommand(List<Object> nodes, ITreeTableModel model)
INodeEditPolicy
getDeleteNodesCommand
in interface INodeEditPolicy
nodes
- the node that needs to be deletedmodel
- the model from which the node will be removedINodeEditPolicy.isDeletable(Object, ITreeTableModel)
public ICommand getCreateNodeCommand(Object node, ITreeTableModel model, Object key, Object[] values)
INodeEditPolicy
getCreateNodeCommand
in interface INodeEditPolicy
node
- the parent node to which the new node will be addedmodel
- the tree table model to which the node will be addedkey
- the initial key value of the new nodevalues
- the initial column values of the new nodepublic ICommand getInsertNodeCommand(Object node, int childIndex, ITreeTableModel model)
INodeEditPolicy
getInsertNodeCommand
in interface INodeEditPolicy
node
- the parent node to which the new node will be addedchildIndex
- the location of the new node within the list of children nodesmodel
- the tree table model to which the node will be addedpublic ICommand getChangeKeyCommand(Object node, ITreeTableModel model, Object key)
INodeEditPolicy
getChangeKeyCommand
in interface INodeEditPolicy
node
- the node that will be modifiedmodel
- the model to which the node belongskey
- the new value of the node's keypublic ICommand getChangeValueCommand(Object node, ITreeTableModel model, Object value, int index)
INodeEditPolicy
getChangeValueCommand
in interface INodeEditPolicy
node
- the node that will be modifiedmodel
- the model to which the node belongsvalue
- the new column valueindex
- the model index of the column valuepublic ICommand getReassignmentCommand(Object[] nodes, Object oldParent, int[] oldChildIndices, Object newParent, int[] newChildIndices, ITreeTableModel model)
INodeEditPolicy
getReassignmentCommand
in interface INodeEditPolicy
nodes
- the nodes that will be reassignedoldParent
- the tree node that is the current parent nodeoldChildIndices
- the child indices of the nodes that will be reassignednewParent
- the tree node that will be the new parent node of the
reassigned nodesnewChildIndices
- the child indices that will be assigned to the reassigned
nodesmodel
- the tree table model to which the nodes belongCopyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.