private void prepareDialog() {

    final boolean silentModeOn = mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL;
    mSilentModeToggle.updateState(silentModeOn ? ToggleAction.State.On : ToggleAction.State.Off);

    mAirplaneModeOn.updateState(mAirplaneState);

    mAdapter.notifyDataSetChanged();
    if (mKeyguardShowing) {
      mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    } else {
      mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
    }
    mDialog.setTitle(R.string.global_actions);
  }
 @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);
   if (SystemInfo.isMac) {
     e.getPresentation().setEnabledAndVisible(false);
   }
 }
 @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);

    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);
   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"));
 }
 @Override
 public void onServiceStateChanged(ServiceState serviceState) {
   final boolean inAirplaneMode = serviceState.getState() == ServiceState.STATE_POWER_OFF;
   mAirplaneState = inAirplaneMode ? ToggleAction.State.On : ToggleAction.State.Off;
   if (mAirplaneModeOn != null && mAdapter != null) {
     mAirplaneModeOn.updateState(mAirplaneState);
     mAdapter.notifyDataSetChanged();
   }
 }
 @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);
   }
 }
  @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());
    }
  }
 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);
 }
 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);
 }
 @Override
 public final void update(@NotNull final AnActionEvent event) {
   super.update(event);
   final Presentation presentation = event.getPresentation();
   presentation.setEnabled(isValidBase());
 }
 @Override
 public void update(@NotNull final AnActionEvent e) {
   super.update(e);
 }
Exemplo n.º 16
0
 @Override
 public void update(AnActionEvent e) {
   super.update(e);
   Presentation presentation = e.getPresentation();
   presentation.setEnabled(myContainerNodes.size() > 1);
 }
 @Override
 public void update(AnActionEvent e) {
   super.update(e);
   e.getPresentation().setIcon(myConfiguration.SOFT_WRAPS_IN_SHORT_DIFF ? myIcon : null);
 }