com.dlsc.flexgantt.policy.treetable
Interface INodeEditPolicy

All Superinterfaces:
IPolicy
All Known Implementing Classes:
DefaultNodeEditPolicy

public interface INodeEditPolicy
extends IPolicy

A policy for specifying the editing capabilities within the tree table.

Since:
1.0
Author:
Dirk Lemmermann

Method Summary
 ICommand getChangeKeyCommand(java.lang.Object node, ITreeTableModel model, java.lang.Object key)
          Returns a command object that will perform the modification of the key value of the given node.
 ICommand getChangeValueCommand(java.lang.Object node, ITreeTableModel model, java.lang.Object value, int index)
          Returns a command object that will perform the modification of the key value of the given node.
 ICommand getCreateNodeCommand(java.lang.Object parentNode, ITreeTableModel model, java.lang.Object key, java.lang.Object[] values)
          Returns a command object that will perform the creation of a new tree / hierarchy node in the given tree table model.
 ICommand getDeleteNodeCommand(java.lang.Object node, ITreeTableModel model)
          Returns a command object that will perform the actual deletion of the given node.
 boolean isCreateEnabled(ITreeTableModel model)
          Determines if the tree table supports the creation of new tree nodes by the user.
 boolean isDeletable(java.lang.Object node, ITreeTableModel model)
          Determines if the node can be deleted by the user.
 boolean isKeyEditable(java.lang.Object node, ITreeTableModel model)
          Determines if the key value of the given tree / hierarchy node can be edited by the user.
 boolean isSelectable(java.lang.Object node, ITreeTableModel model)
          Determines if the node can be selected by the user.
 boolean isValueEditable(java.lang.Object node, ITreeTableModel model, int modelIndex)
          Determines if the column value with the given model index can be edited by the user.
 

Method Detail

isKeyEditable

boolean isKeyEditable(java.lang.Object node,
                      ITreeTableModel model)
Determines if the key value of the given tree / hierarchy node can be edited by the user.

Parameters:
node - the node that is the target of the editing operation
model - the tree table model to which the node belongs
Returns:
TRUE if the key value can be modified by the user
Since:
1.0

isValueEditable

boolean isValueEditable(java.lang.Object node,
                        ITreeTableModel model,
                        int modelIndex)
Determines if the column value with the given model index can be edited by the user.

Parameters:
node - the node that is the target of the editing operation
model - the tree table model to which the node belongs
modelIndex - the model index under which the column value can be looked up and stored
Returns:
TRUE if the column value can be modified by the user
Since:
1.0

isSelectable

boolean isSelectable(java.lang.Object node,
                     ITreeTableModel model)
Determines if the node can be selected by the user.

Parameters:
node - the node that will be selected
model - the tree table model to which the node belongs
Returns:
TRUE if the node can be selected by the user
Since:
1.0

isDeletable

boolean isDeletable(java.lang.Object node,
                    ITreeTableModel model)
Determines if the node can be deleted by the user.

Parameters:
node - the node that will be deleted
model - the tree table model to which the node belongs
Returns:
TRUE if the node can be deleted by the user
Since:
1.0

isCreateEnabled

boolean isCreateEnabled(ITreeTableModel model)
Determines if the tree table supports the creation of new tree nodes by the user.

Parameters:
model - the tree table model that will be modified if a new node gets created
Returns:
TRUE if the user can create new nodes in the tree table
Since:
1.0

getDeleteNodeCommand

ICommand getDeleteNodeCommand(java.lang.Object node,
                              ITreeTableModel model)
Returns a command object that will perform the actual deletion of the given node. This method will only get called if the node is deletable.

Parameters:
node - the node that needs to be deleted
model - the model from which the node will be removed
Returns:
a command object that will perform the node's deletion
Since:
1.0
See Also:
isDeletable(Object, ITreeTableModel)

getCreateNodeCommand

ICommand getCreateNodeCommand(java.lang.Object parentNode,
                              ITreeTableModel model,
                              java.lang.Object key,
                              java.lang.Object[] values)
Returns a command object that will perform the creation of a new tree / hierarchy node in the given tree table model.

Parameters:
parentNode - the parent node to which the new node will be added
model - the tree table model to which the node will be added
key - the initial key value of the new node
values - the initial column values of the new node
Returns:
a command object that will create the new node
Since:
1.0

getChangeKeyCommand

ICommand getChangeKeyCommand(java.lang.Object node,
                             ITreeTableModel model,
                             java.lang.Object key)
Returns a command object that will perform the modification of the key value of the given node.

Parameters:
node - the node that will be modified
model - the model to which the node belongs
key - the new value of the node's key
Returns:
a command object that will change the node's key value
Since:
1.0

getChangeValueCommand

ICommand getChangeValueCommand(java.lang.Object node,
                               ITreeTableModel model,
                               java.lang.Object value,
                               int index)
Returns a command object that will perform the modification of the key value of the given node.

Parameters:
node - the node that will be modified
model - the model to which the node belongs
value - the new column value
index - the model index of the column value
Returns:
a command object that will change the node's key value
Since:
1.0