this.commandStack = editModelCommandStack;
editModelCommandStack.addCommandStackListener(new CommandStackListener() {
public void commandStackChanged(EventObject event) {
if (ignoreEvents) return;
if (event instanceof SharedCommandStackChangedEvent) {
SharedCommandStackChangedEvent e = (SharedCommandStackChangedEvent)event;
// Finish up the change in progress before we execute something else
if (e.getProperty() == SharedCommandStackListener.EVENT_START_EXECUTE) {
applyCurrentChange();
}
// FIXME: what about redo?
if(e.getProperty() == SharedCommandStackListener.EVENT_START_UNDO) {
if(commandStack.getUndoCommand() instanceof PlaceHolderCommand) {
// TODO: what is this for again?
if(currentChange != null)
currentChange.restoreOldState();
}