code: public void detachCommandExecutor() {
          if (this.commandExecutor instanceof GuardedActionCommandExecutor) {
              unsubscribeFromGuardedCommandDelegate();
          }
          this.commandExecutor = null;
          setEnabled(false);
          logger.debug("Command delegate detached.");
      }
docs: Detaches the current executor from this command and sets the command to disabled state.