com.dlsc.flexgantt.command.treetable

## Class DefaultDeleteNodeCommand

- java.lang.Object
- - com.dlsc.flexgantt.command.AbstractCommand
  - - com.dlsc.flexgantt.command.treetable.DefaultDeleteNodeCommand

- All Implemented Interfaces:
    ICommand, Serializable

      public class DefaultDeleteNodeCommand
      extends AbstractCommand

  A command that deletes a tree table node from the model. This command can only be used in situations where the tree table model is an instance of `DefaultTreeTableModel` and the deleted child node and its parent node are both implementors of the `IMutableTreeTableNode` interface.
  Since:
    1.0
  Version:
    $Revision: 1.6 $
  Author:
    Dirk Lemmermann
  See Also:
    `INodeEditPolicy.isDeletable(Object, com.dlsc.flexgantt.model.treetable.ITreeTableModel)`, `INodeEditPolicy.getDeleteNodesCommand(java.util.List, com.dlsc.flexgantt.model.treetable.ITreeTableModel)`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultDeleteNodeCommand(IMutableTreeTableNode child, DefaultTreeTableModel model)` Constructs a new command.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `executeCommand(IProgressMonitor monitor)` Executes the command.
    `int` | `getChildIndex()` Returns the index of the deleted child node within the list of children of the parent node.
    `IMutableTreeTableNode` | `getChildNode()` Returns the deleted child node.
    `DefaultTreeTableModel` | `getModel()` Returns the model to which the parent and the child node belong.
    `IMutableTreeTableNode` | `getParentNode()` Returns the parent node of the node that will be / was deleted.
    `void` | `undoCommand(IProgressMonitor monitor)` Undos the command.

    - ### Methods inherited from class com.dlsc.flexgantt.command.AbstractCommand

      `getName, isRedoable, isRelevant, isUndoable, redoCommand, setName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultDeleteNodeCommand

          public DefaultDeleteNodeCommand(IMutableTreeTableNode child,
                                          DefaultTreeTableModel model)

      Constructs a new command.
      Parameters:
        `child` - the child node that will be deleted
        `model` - the model to which the node belongs
      Since:
        1.0

  - ### Method Detail

    - #### executeCommand

          public void executeCommand(IProgressMonitor monitor)
                              throws CommandException

      Description copied from interface: `ICommand`
      Executes the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong

    - #### undoCommand

          public void undoCommand(IProgressMonitor monitor)
                           throws CommandException

      Description copied from interface: `ICommand`
      Undos the command.
      Parameters:
        `monitor` - a progress monitor
      Throws:
        `CommandException` - if anything during the execution of the command has gone wrong

    - #### getChildIndex

          public int getChildIndex()

      Returns the index of the deleted child node within the list of children of the parent node.
      Returns:
        the deleted node's child index
      Since:
        1.0

    - #### getChildNode

          public IMutableTreeTableNode getChildNode()

      Returns the deleted child node.
      Returns:
        the deleted child node
      Since:
        1.0

    - #### getModel

          public DefaultTreeTableModel getModel()

      Returns the model to which the parent and the child node belong.
      Returns:
        the nodes' model
      Since:
        1.0

    - #### getParentNode

          public IMutableTreeTableNode getParentNode()

      Returns the parent node of the node that will be / was deleted.
      Returns:
        the deleted node's parent node
      Since:
        1.0

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.