@Override
 public void update(final AnActionEvent e) {
   e.getPresentation().setIcon(myTabs.isEditorTabs() ? myNewIcon : myIcon);
   e.getPresentation().setHoveredIcon(myTabs.isEditorTabs() ? myNewHoveredIcon : myHoveredIcon);
   e.getPresentation().setVisible(UISettings.getInstance().SHOW_CLOSE_BUTTON);
   e.getPresentation().setText("Close. Alt-click to close others.");
 }
 @Override
 public void update(@NotNull AnActionEvent e) {
   myHadSeveralContents =
       myHadSeveralContents || myToolWindow.getContentManager().getContentCount() > 1;
   super.update(e);
   e.getPresentation().setVisible(myHadSeveralContents);
 }
 @Override
 public void update(@NotNull AnActionEvent e) {
   super.update(e);
   if (SystemInfo.isMac) {
     e.getPresentation().setEnabledAndVisible(false);
   }
 }
    public void actionPerformed(final AnActionEvent e) {
      final FileEditorManagerEx mgr = FileEditorManagerEx.getInstanceEx(myProject);
      EditorWindow window;
      final VirtualFile file = (VirtualFile) myTabInfo.getObject();
      if (ActionPlaces.EDITOR_TAB.equals(e.getPlace())) {
        window = myWindow;
      } else {
        window = mgr.getCurrentWindow();
      }

      if (window != null) {
        if ((e.getModifiers() & InputEvent.ALT_MASK) != 0) {
          window.closeAllExcept(file);
        } else {
          if (window.findFileComposite(file) != null) {
            mgr.closeFile(file, window);
          }
        }
      }
    }
Exemple #5
0
    @Override
    public void update(AnActionEvent e) {
      Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
      e.getPresentation().setEnabled(false);
      if (focusOwner instanceof JComponent
          && SpeedSearchBase.hasActiveSpeedSearch((JComponent) focusOwner)) {
        return;
      }

      if (StackingPopupDispatcher.getInstance().isPopupFocused()) return;

      if (focusOwner instanceof JTree) {
        JTree tree = (JTree) focusOwner;
        if (!tree.isEditing()) {
          e.getPresentation().setEnabled(true);
        }
      } else if (focusOwner instanceof JTable) {
        JTable table = (JTable) focusOwner;
        if (!table.isEditing()) {
          e.getPresentation().setEnabled(true);
        }
      }
    }
 @Override
 public final void update(@NotNull final AnActionEvent event) {
   final Presentation presentation = event.getPresentation();
   presentation.setEnabled(myInfo.isVisible());
 }
Exemple #7
0
 @Override
 public void actionPerformed(AnActionEvent e) {
   myWrapper.doCancelAction(e.getInputEvent());
 }