Package ghidra.framework.cmd

# Class CompoundBackgroundCommand

java.lang.Object
ghidra.framework.cmd.BackgroundCommand
ghidra.framework.cmd.CompoundBackgroundCommand

All Implemented Interfaces:
  `Command`

public class CompoundBackgroundCommand extends BackgroundCommand
Compound command to handle multiple background commands.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CompoundBackgroundCommand(String name, boolean modal, boolean canCancel)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(BackgroundCommand cmd)`
  Add a background command to this compound background command.
  `void`
  `add(Command cmd)`
  Add a command to this compound background command.
  `boolean`
  `applyTo(DomainObject obj, TaskMonitor monitor)`
  Method called when this command is to apply changes to the given domain object.
  `boolean`
  `isEmpty()`
  `int`
  `size()`
  Get the number of background commands in this compound background command.

  ### Methods inherited from class ghidra.framework.cmd.BackgroundCommand

  `applyTo, canCancel, dispose, getName, getStatusMsg, hasProgress, isModal, setStatusMsg, taskCompleted, toString`

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

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

- ## Constructor Details

  - ### CompoundBackgroundCommand

    public CompoundBackgroundCommand(String name, boolean modal, boolean canCancel)
    Constructor
    Parameters:
      `name` - name of the command
      `modal` - true means the monitor dialog is modal and the command has to complete or be canceled before any other action can occur
      `canCancel` - true means the command can be canceled

- ## Method Details

  - ### applyTo

    public boolean applyTo(DomainObject obj, TaskMonitor monitor)
    Description copied from class: `BackgroundCommand`
    Method called when this command is to apply changes to the given domain object. A monitor is provided to display status information about the command as it executes in the background.
    Specified by:
      `applyTo` in class `BackgroundCommand`
    Parameters:
      `obj` - domain object that will be affected by the command
      `monitor` - monitor to show progress of the command
    Returns:
      true if the command applied successfully

  - ### add

    public void add(BackgroundCommand cmd)
    Add a background command to this compound background command.

  - ### add

    public void add(Command cmd)
    Add a command to this compound background command.

  - ### size

    public int size()
    Get the number of background commands in this compound background command.

  - ### isEmpty

    public boolean isEmpty()
    Returns:
      true if no sub-commands have been added