/** * Execute a command within the editing domain. */ public void execute(String label, Command command) { executeViaUndoManager(label, command); }
/** * Execute a command directly on the command stack */ public void executeViaStack(Command command) { getCommandStack().execute(command); }
/** * Execute a command within the editing domain. */ public void execute(Command command) { execute(command.getLabel(), command); }
/** * Execute a command within the editing domain. */ public void executeViaUndoManager(String label, Command command) { if (command.canExecute()) { if (undoManager != null) { undoManager.beginRecording(this, label); command.execute(); undoManager.endRecording(this); } else executeViaStack(command); } }