当前位置: 首页>>代码示例>>Java>>正文


Java ActionPlaces.isMainMenuOrActionSearch方法代码示例

本文整理汇总了Java中com.intellij.openapi.actionSystem.ActionPlaces.isMainMenuOrActionSearch方法的典型用法代码示例。如果您正苦于以下问题:Java ActionPlaces.isMainMenuOrActionSearch方法的具体用法?Java ActionPlaces.isMainMenuOrActionSearch怎么用?Java ActionPlaces.isMainMenuOrActionSearch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.actionSystem.ActionPlaces的用法示例。


在下文中一共展示了ActionPlaces.isMainMenuOrActionSearch方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
public void update(@NotNull AnActionEvent e) {
  boolean enable = false;

  JavaStackFrame stackFrame = PopFrameAction.getStackFrame(e);
  if (stackFrame != null && stackFrame.getDescriptor().getUiIndex() == 0) {
    enable = stackFrame.getStackFrameProxy().getVirtualMachine().canForceEarlyReturn();
  }

  if (ActionPlaces.isMainMenuOrActionSearch(e.getPlace()) || ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) {
    e.getPresentation().setEnabled(enable);
  }
  else {
    e.getPresentation().setVisible(enable);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ForceEarlyReturnAction.java

示例2: update

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
public void update(@NotNull AnActionEvent e) {
  boolean enable = false;

  StackFrameProxyImpl proxy = getStackFrameProxy(e);
  if (proxy != null && !proxy.isBottom() && isAtBreakpoint(e)) {
    enable = proxy.getVirtualMachine().canPopFrames();
  }

  if(ActionPlaces.isMainMenuOrActionSearch(e.getPlace()) || ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) {
    e.getPresentation().setEnabled(enable);
  }
  else {
    e.getPresentation().setVisible(enable);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PopFrameAction.java

示例3: update

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(final AnActionEvent e) {
  super.update(e);
  boolean mainMenu = ActionPlaces.isMainMenuOrActionSearch(e.getPlace());
  final ModuleGroup[] moduleGroups = ModuleGroup.ARRAY_DATA_KEY.getData(e.getDataContext());
  final Module[] modules = e.getData(LangDataKeys.MODULE_CONTEXT_ARRAY);
  e.getPresentation().setVisible(!mainMenu && ((moduleGroups != null && moduleGroups.length > 0) ||
                                 (modules != null && modules.length > 0)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:NewModuleInGroupAction.java

示例4: setSelected

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void setSelected(@Nullable AnActionEvent e, boolean selected) {

  if (e == null) return;
  boolean macMainMenu = SystemInfo.isMac && ActionPlaces.isMainMenuOrActionSearch(e.getPlace());

  if (!selected && !macMainMenu) {
    return;
  }

  final Project project = findProject();
  if (project == null) {
    return;
  }
  final JFrame projectFrame = WindowManager.getInstance().getFrame(project);
  final int frameState = projectFrame.getExtendedState();

  if (macMainMenu && !(e.getInputEvent().getSource() instanceof ActionMenuItem) && (projectFrame.getExtendedState() & Frame.ICONIFIED) != 0) {
    // On Mac minimized window should not be restored this way
    return;
  }

  if (BitUtil.isSet(frameState, Frame.ICONIFIED)) {
    // restore the frame if it is minimized
    projectFrame.setExtendedState(frameState ^ Frame.ICONIFIED);
  }
  projectFrame.toFront();
  projectFrame.requestFocus();
  //ProjectUtil.focusProjectWindow(project, true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ProjectWindowAction.java

示例5: update

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public void update(@NotNull AnActionEvent e) {
  if (SystemInfo.isMac && ActionPlaces.isMainMenuOrActionSearch(e.getPlace())) {
    // It's called from Preferences in App menu.
    e.getPresentation().setVisible(false);
  }
  if (e.getPlace().equals(ActionPlaces.WELCOME_SCREEN)) {
    e.getPresentation().setText(CommonBundle.settingsTitle());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ShowSettingsAction.java

示例6: update

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
protected void update(@NotNull Presentation presentation, @NotNull Project project,
                      @NotNull Editor editor, @NotNull PsiFile file, @NotNull DataContext dataContext, @Nullable String actionPlace) {
  // avoid evaluating isValidFor several times unnecessary
  
  CodeInsightActionHandler handler = getValidHandler(editor, file);
  presentation.setEnabled(handler != null);
  if (handler instanceof ContextAwareActionHandler && !ActionPlaces.isMainMenuOrActionSearch(actionPlace)) {
    presentation.setVisible(((ContextAwareActionHandler)handler).isAvailableForQuickList(editor, file, dataContext));
  }

  if (presentation.isVisible() && handler instanceof PresentableCodeInsightActionHandler) {
    ((PresentableCodeInsightActionHandler)handler).update(editor, file, presentation);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PresentableActionHandlerBasedAction.java

示例7: update

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public final void update(final AnActionEvent event){
  final Presentation presentation = event.getPresentation();
  if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
    presentation.setText(IdeBundle.message("action.browse.call.hierarchy"));
  }

  super.update(event);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:BrowseCallHierarchyAction.java

示例8: update

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public final void update(final AnActionEvent event){
  final Presentation presentation = event.getPresentation();
  if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
    presentation.setText(IdeBundle.message("action.browse.method.hierarchy"));
  }
  super.update(event);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BrowseMethodHierarchyAction.java

示例9: update

import com.intellij.openapi.actionSystem.ActionPlaces; //导入方法依赖的package包/类
@Override
public final void update(final AnActionEvent event){
  final Presentation presentation = event.getPresentation();
  if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
    presentation.setText(IdeBundle.message("action.browse.type.hierarchy"));
  }
  super.update(event);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BrowseTypeHierarchyAction.java


注:本文中的com.intellij.openapi.actionSystem.ActionPlaces.isMainMenuOrActionSearch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。