/** 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);
   }
 }
 public void setUndoManager(IStructuredTextUndoManager newUndoManager) {
   undoManager = newUndoManager;
   undoManager.setCommandStack(commandStack);
 }