本文整理汇总了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);
}
}
示例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);
}
}
示例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)));
}
示例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);
}
示例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());
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}