Package org.eclipse.emf.compare.command

# Class DelegatingCommandStack

java.lang.Object
com.google.common.collect.ForwardingObject
org.eclipse.emf.compare.command.DelegatingCommandStack

All Implemented Interfaces:
  `CommandStack`

Direct Known Subclasses:
  `CompareCommandStack`

public abstract class DelegatingCommandStack extends com.google.common.collect.ForwardingObject implements CommandStack
Abstract implementation that forward method calls to a `delegatating` `CommandStack`.

Since:
  4.0

## Constructor Summary

Constructors
Constructor
Description
`DelegatingCommandStack()`
Default constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`addCommandStackListener(CommandStackListener listener)`
`boolean`
`canRedo()`
`boolean`
`canUndo()`
`protected abstract CommandStack`
`delegate()`
Returns the backing delegate instance that methods are forwarded to.
`void`
`execute(Command command)`
`void`
`flush()`
`Command`
`getMostRecentCommand()`
`Command`
`getRedoCommand()`
`Command`
`getUndoCommand()`
`protected void`
`notifyListeners(Object source)`
This is called to ensure that `CommandStackListener.commandStackChanged(java.util.EventObject)` is called for each listener.
`void`
`redo()`
`void`
`removeCommandStackListener(CommandStackListener listener)`
`void`
`undo()`

### Methods inherited from class com.google.common.collect.ForwardingObject

`toString`

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

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

## Constructor Details

### DelegatingCommandStack

public DelegatingCommandStack()
Default constructor.

## Method Details

### delegate

protected abstract CommandStack delegate()
Returns the backing delegate instance that methods are forwarded to.

Specified by:
  `delegate` in class `com.google.common.collect.ForwardingObject`
Returns:
  the backing delegate instance that methods are forwarded to.

### execute

public void execute(Command command)

Specified by:
  `execute` in interface `CommandStack`
See Also:
  - `CommandStack.execute(org.eclipse.emf.common.command.Command)`

### canUndo

public boolean canUndo()

Specified by:
  `canUndo` in interface `CommandStack`
See Also:
  - `CommandStack.canUndo()`

### undo

public void undo()

Specified by:
  `undo` in interface `CommandStack`
See Also:
  - `CommandStack.undo()`

### canRedo

public boolean canRedo()

Specified by:
  `canRedo` in interface `CommandStack`
See Also:
  - `CommandStack.canRedo()`

### getUndoCommand

public Command getUndoCommand()

Specified by:
  `getUndoCommand` in interface `CommandStack`
See Also:
  - `CommandStack.getUndoCommand()`

### getRedoCommand

public Command getRedoCommand()

Specified by:
  `getRedoCommand` in interface `CommandStack`
See Also:
  - `CommandStack.getRedoCommand()`

### getMostRecentCommand

public Command getMostRecentCommand()

Specified by:
  `getMostRecentCommand` in interface `CommandStack`
See Also:
  - `CommandStack.getMostRecentCommand()`

### redo

public void redo()

Specified by:
  `redo` in interface `CommandStack`
See Also:
  - `CommandStack.redo()`

### flush

public void flush()

Specified by:
  `flush` in interface `CommandStack`
See Also:
  - `CommandStack.flush()`

### addCommandStackListener

public void addCommandStackListener(CommandStackListener listener)

Specified by:
  `addCommandStackListener` in interface `CommandStack`
See Also:
  - `CommandStack.addCommandStackListener(org.eclipse.emf.common.command.CommandStackListener)`

### removeCommandStackListener

public void removeCommandStackListener(CommandStackListener listener)

Specified by:
  `removeCommandStackListener` in interface `CommandStack`
See Also:
  - `CommandStack.removeCommandStackListener(org.eclipse.emf.common.command.CommandStackListener)`

### notifyListeners

protected void notifyListeners(Object source)
This is called to ensure that `CommandStackListener.commandStackChanged(java.util.EventObject)` is called for each listener.

Parameters:
  `source` - the source of the notification