@Override
 public void update(@NotNull AnActionEvent e) {
   myHadSeveralContents =
       myHadSeveralContents || myToolWindow.getContentManager().getContentCount() > 1;
   super.update(e);
   e.getPresentation().setVisible(myHadSeveralContents);
 }
 @Override
 public void update(AnActionEvent e) {
   super.update(e);
   if (myFilter != null) {
     e.getPresentation().setEnabled(!myFilter.isEmpty());
   }
 }
 @Override
 public void update(@NotNull AnActionEvent e) {
   super.update(e);
   XDebugSession session = XDebugSession.DATA_KEY.getData(e.getDataContext());
   e.getPresentation()
       .setEnabledAndVisible(session != null && !session.getDebugProcess().isValuesCustomSorted());
 }
 @Override
 public void update(@NotNull AnActionEvent e) {
   super.update(e);
   if (SystemInfo.isMac) {
     e.getPresentation().setEnabledAndVisible(false);
   }
 }
  @Override
  public void update(@NotNull AnActionEvent e) {
    super.update(e);

    Presentation presentation = e.getPresentation();
    DataContext context = e.getDataContext();
    EditorWindow window = getEditorWindow(context);
    if (window == null || window.getOwner().isPreview()) {
      presentation.setEnabledAndVisible(false);
    } else {
      if (getFile(context) != null) {
        presentation.setEnabledAndVisible(true);
      } else {
        Content content = getContent(context);
        presentation.setEnabledAndVisible(content != null && content.isPinnable());
      }
    }

    if (ActionPlaces.EDITOR_TAB_POPUP.equals(e.getPlace())
        || ViewContext.CELL_POPUP_PLACE.equals(e.getPlace())) {
      presentation.setText(
          isSelected(e)
              ? IdeBundle.message("action.unpin.tab")
              : IdeBundle.message("action.pin.tab"));
    } else {
      presentation.setText(
          isSelected(e)
              ? IdeBundle.message("action.unpin.active.tab")
              : IdeBundle.message("action.pin.active.tab"));
    }
  }
  @Override
  public void update(final AnActionEvent e) {
    super.update(e);

    e.getPresentation().setIcon(myIcon);
    e.getPresentation().setText((getHiders().get(myClass) ? "Hide " : "Show ") + myText);

    e.getPresentation().setEnabled(getHiders() != null && getHiders().get(myClass) != null);
  }
 @Override
 public void update(final AnActionEvent e) {
   super.update(e);
   final Presentation presentation = e.getPresentation();
   presentation.setIcon(SvnIcons.ShowIntegratedFrom);
   presentation.setText(SvnBundle.message("committed.changes.action.enable.merge.highlighting"));
   presentation.setDescription(
       SvnBundle.message("committed.changes.action.enable.merge.highlighting.description.text"));
 }
예제 #8
0
    @Override
    public void update(AnActionEvent e) {
      super.update(e);

      boolean enabled = isEnabled();
      Icon icon = enabled ? myIcon : UIManager.getLookAndFeel().getDisabledIcon(null, myIcon);
      if (icon == null) {
        icon = myIcon;
      }
      e.getPresentation().setIcon(icon);
    }
 @Override
 public void update(AnActionEvent e) {
   super.update(e);
   final Project project = e.getData(CommonDataKeys.PROJECT);
   e.getPresentation()
       .setEnabled(
           project != null
               && ModuleExtensionHelper.getInstance(project)
                       .getModuleExtensions(AndroidModuleExtension.class)
                       .size()
                   > 0);
 }
 @Override
 public void update(@NotNull final AnActionEvent e) {
   super.update(e);
   final Presentation presentation = e.getPresentation();
   DebugProcessImpl process = getCurrentDebugProcess(e.getProject());
   if (process == null || process.canGetMethodReturnValue()) {
     presentation.setEnabled(true);
     presentation.setText(myText);
   } else {
     presentation.setEnabled(false);
     presentation.setText(myTextUnavailable);
   }
 }
예제 #11
0
 @Override
 public void update(final AnActionEvent event) {
   super.update(event);
   final Presentation presentation = event.getPresentation();
   final boolean isRunning = myProcessHandler != null && !myProcessHandler.isProcessTerminated();
   if (isRunning) {
     presentation.setEnabled(true);
   } else {
     enableConsole(true);
     presentation.putClientProperty(SELECTED_PROPERTY, false);
     presentation.setEnabled(false);
   }
 }
  @Override
  public void update(final AnActionEvent e) {
    super.update(e);
    Presentation presentation = e.getPresentation();
    Object property = presentation.getClientProperty(CUSTOM_COMPONENT_PROPERTY);
    if (property instanceof JCheckBox) {
      JCheckBox checkBox = (JCheckBox) property;

      checkBox.setText(presentation.getText());
      checkBox.setToolTipText(presentation.getDescription());
      checkBox.setMnemonic(presentation.getMnemonic());
      checkBox.setDisplayedMnemonicIndex(presentation.getDisplayedMnemonicIndex());
      checkBox.setSelected(Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY)));

      checkBox.setEnabled(presentation.isEnabled());
      checkBox.setVisible(presentation.isVisible());
    }
  }
 @Override
 public void update(AnActionEvent e) {
   super.update(e);
   e.getPresentation().setIcon(myConfiguration.SOFT_WRAPS_IN_SHORT_DIFF ? myIcon : null);
 }
 @Override
 public void update(AnActionEvent e) {
   super.update(e);
   Presentation presentation = e.getPresentation();
   presentation.setEnabled(myContainerNodes.size() > 1);
 }
 public void update(final AnActionEvent e) {
   super.update(e);
 }
 public void update(final AnActionEvent e) {
   super.update(e);
   e.getPresentation().setEnabled(mySettings.UI_SHOW_MODULES);
 }
 @Override
 public void update(@NotNull final AnActionEvent e) {
   super.update(e);
 }
 @Override
 public final void update(@NotNull final AnActionEvent event) {
   super.update(event);
   final Presentation presentation = event.getPresentation();
   presentation.setEnabled(isValidBase());
 }
 public void update(final AnActionEvent e) {
   super.update(e);
   e.getPresentation().setVisible(myCanGroupByChangeList);
 }
 public void update(final AnActionEvent e) {
   super.update(e);
   e.getPresentation().setEnabled(!myGroupByChangeList);
 }