コード例 #1
0
 public void actionPerformed(AnActionEvent e) {
   if (!ActionMacroManager.getInstance().isRecording()) {
     final ActionMacroManager manager = ActionMacroManager.getInstance();
     manager.startRecording(IdeBundle.message("macro.noname"));
   } else {
     ActionMacroManager.getInstance()
         .stopRecording(PlatformDataKeys.PROJECT.getData(e.getDataContext()));
   }
 }
コード例 #2
0
  public void update(AnActionEvent e) {
    boolean isRecording = ActionMacroManager.getInstance().isRecording();

    e.getPresentation()
        .setText(
            isRecording
                ? IdeBundle.message("action.stop.macro.recording")
                : IdeBundle.message("action.start.macro.recording"));

    if (ActionPlaces.STATUS_BAR_PLACE.equals(e.getPlace())) {
      e.getPresentation()
          .setIcon(
              isRecording
                  ? IconLoader.getIcon("/ide/macro/recording_stop.png")
                  : IconLoader.getIcon("/ide/macro/recording_stop.png"));
    } else {
      e.getPresentation().setIcon(null);
    }
  }