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


Java ActionManagerImpl类代码示例

本文整理汇总了Java中com.intellij.openapi.actionSystem.impl.ActionManagerImpl的典型用法代码示例。如果您正苦于以下问题:Java ActionManagerImpl类的具体用法?Java ActionManagerImpl怎么用?Java ActionManagerImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActionManagerImpl类属于com.intellij.openapi.actionSystem.impl包,在下文中一共展示了ActionManagerImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showContextMenu

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
public void showContextMenu(Component comp, int x, int y, ActionGroup toolWindowGroup, @Nullable Content selectedContent) {
  if (selectedContent == null && toolWindowGroup == null) {
    return;
  }
  DefaultActionGroup group = new DefaultActionGroup();
  if (selectedContent != null) {
    initActionGroup(group, selectedContent);
  }

  if (toolWindowGroup != null) {
    group.addAll(toolWindowGroup);
  }

  final ActionPopupMenu popupMenu =
    ((ActionManagerImpl)ActionManager.getInstance()).createActionPopupMenu(POPUP_PLACE, group, new MenuItemPresentationFactory(true));
  popupMenu.getComponent().show(comp, x, y);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ToolWindowContentUi.java

示例2: processKeymap

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
private static void processKeymap(final Element configurableElement){
  final ActionManager actionManager = ActionManager.getInstance();
  final String componentName = actionManager.getComponentName();
  final SearchableOptionsRegistrar searchableOptionsRegistrar = SearchableOptionsRegistrar.getInstance();
  final Set<String> ids = ((ActionManagerImpl)actionManager).getActionIds();
  final TreeSet<OptionDescription> options = new TreeSet<OptionDescription>();
  for (String id : ids) {
    final AnAction anAction = actionManager.getAction(id);
    final String text = anAction.getTemplatePresentation().getText();
    if (text != null) {
      collectOptions(searchableOptionsRegistrar, options, text, componentName);
    }
    final String description = anAction.getTemplatePresentation().getDescription();
    if (description != null) {
      collectOptions(searchableOptionsRegistrar, options, description, componentName);
    }
  }
  writeOptions(configurableElement, options);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TraverseUIStarter.java

示例3: processActions

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
private boolean processActions(String pattern, boolean everywhere, Processor<MatchedValue> consumer, DataContext dataContext) {
  Set<AnAction> actions = new THashSet<AnAction>(ACTION_OBJECT_HASHING_STRATEGY);
  if (everywhere) {
    for (String id : ((ActionManagerImpl)myActionManager).getActionIds()) {
      ProgressManager.checkCanceled();
      ContainerUtil.addIfNotNull(actions, myActionManager.getAction(id));
    }
  } else {
    actions.addAll(myModel.myActionGroups.keySet());
  }

  List<ActionWrapper> actionWrappers = ContainerUtil.newArrayList();
  for (AnAction action : actions) {
    ProgressManager.checkCanceled();
    MatchMode mode = myModel.actionMatches(pattern, action);
    if (mode != MatchMode.NONE) {
      actionWrappers.add(new ActionWrapper(action, myModel.myActionGroups.get(action), mode, dataContext));
    }
  }
  return processItems(pattern, actionWrappers, consumer);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:GotoActionItemProvider.java

示例4: getNames

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
@Override
@NotNull
public String[] getNames(boolean checkBoxState) {
  final ArrayList<String> result = new ArrayList<String>();
  for (AnAction action : myActionsMap.keySet()) {
    result.add(getActionId(action));
  }
  if (checkBoxState) {
    final Set<String> ids = ((ActionManagerImpl)myActionManager).getActionIds();
    for (String id : ids) {
      result.add(id);
    }
  }
  result.add(SETTINGS_KEY);
  return ArrayUtil.toStringArray(result);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:GotoActionModel.java

示例5: showContextMenu

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
public void showContextMenu(Component comp, int x, int y, ActionGroup toolWindowGroup, @Nullable Content selectedContent) {
  if (selectedContent == null && toolWindowGroup == null) {
    return;
  }
  DefaultActionGroup group = new DefaultActionGroup();
  if (selectedContent != null) {
    initActionGroup(group, selectedContent);
  }

  if (toolWindowGroup != null) {
    group.addAll(toolWindowGroup);
  }

  final ActionPopupMenu popupMenu = ((ActionManagerImpl)ActionManager.getInstance()).createActionPopupMenu(POPUP_PLACE, group, new MenuItemPresentationFactory(true));
  popupMenu.getComponent().show(comp, x, y);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:UnifiedToolWindowContentUI.java

示例6: processActions

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
private boolean processActions(String pattern, boolean everywhere, Processor<MatchedValue> consumer, DataContext dataContext) {
  List<AnAction> actions = ContainerUtil.newArrayList();
  if (everywhere) {
    for (String id : ((ActionManagerImpl)myActionManager).getActionIds()) {
      ProgressManager.checkCanceled();
      ContainerUtil.addIfNotNull(actions, myActionManager.getAction(id));
    }
  } else {
    actions.addAll(myModel.myActionGroups.keySet());
  }

  List<ActionWrapper> actionWrappers = ContainerUtil.newArrayList();
  for (AnAction action : actions) {
    ProgressManager.checkCanceled();
    MatchMode mode = myModel.actionMatches(pattern, action);
    if (mode != MatchMode.NONE) {
      actionWrappers.add(new ActionWrapper(action, myModel.myActionGroups.get(action), mode, dataContext));
    }
  }
  return processItems(pattern, actionWrappers, consumer);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:GotoActionItemProvider.java

示例7: showContextMenu

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
public void showContextMenu(Component comp, int x, int y, ActionGroup toolWindowGroup, @Nullable Content selectedContent) {
  if (selectedContent == null && toolWindowGroup == null) {
    return;
  }
  DefaultActionGroup group = new DefaultActionGroup();
  if (selectedContent != null) {
    initActionGroup(group, selectedContent);
  }

  if (toolWindowGroup != null) {
    group.addAll(toolWindowGroup);
  }

  final ActionPopupMenu popupMenu =
          ((ActionManagerImpl)ActionManager.getInstance()).createActionPopupMenu(POPUP_PLACE, group, new MenuItemPresentationFactory(true));
  popupMenu.getComponent().show(comp, x, y);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:DesktopToolWindowContentUi.java

示例8: showDevicesPopup

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
private void showDevicesPopup(Component component, int x, int y, DefaultActionGroup defaultActionGroup) {
    ActionPopupMenu popupMenu =
            ((ActionManagerImpl) ActionManager.getInstance())
                    .createActionPopupMenu(ToolWindowContentUi.POPUP_PLACE, defaultActionGroup,
                            new MenuItemPresentationFactory(false));// don't set forceHide to true, otherwise icons will be hidden in menu item
    popupMenu.getComponent().show(component, x, y);
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:8,代码来源:RunIOSDevicesAction.java

示例9: onTemplateFinished

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
protected void onTemplateFinished(TemplateManager manager, Editor editor, Template template) {
    // format and add ;
    final ActionManager actionManager = ActionManagerImpl.getInstance();
    final String editorCompleteStatementText = "EditorCompleteStatement";
    final AnAction action = actionManager.getAction(editorCompleteStatementText);
    actionManager.tryToExecute(action, ActionCommand.getInputEvent(editorCompleteStatementText), null, ActionPlaces.UNKNOWN, true);
}
 
开发者ID:cesards,项目名称:HakunaMatataIntelliJPlugin,代码行数:8,代码来源:AbstractRichStringBasedPostfixTemplate.java

示例10: onTemplateFinished

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
@Override
protected void onTemplateFinished(final TemplateManager manager, final Editor editor, Template template) {
    final ActionManager actionManager = ActionManagerImpl.getInstance();
    final String editorCompleteStatementText = "IntroduceField";
    final AnAction action = actionManager.getAction(editorCompleteStatementText);
    actionManager.tryToExecute(action, ActionCommand.getInputEvent(editorCompleteStatementText), null, ActionPlaces.UNKNOWN, true);
}
 
开发者ID:takahirom,项目名称:android-postfix-plugin,代码行数:8,代码来源:FindViewByIdFieldTemplate.java

示例11: onTemplateFinished

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
@Override
protected void onTemplateFinished(final TemplateManager manager, final Editor editor, Template template) {
    final ActionManager actionManager = ActionManagerImpl.getInstance();
    final String editorCompleteStatementText = "IntroduceVariable";
    final AnAction action = actionManager.getAction(editorCompleteStatementText);
    actionManager.tryToExecute(action, ActionCommand.getInputEvent(editorCompleteStatementText), null, ActionPlaces.UNKNOWN, true);
}
 
开发者ID:takahirom,项目名称:android-postfix-plugin,代码行数:8,代码来源:FindViewByIdVariableTemplate.java

示例12: createTitlePanelToolbar

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
private void createTitlePanelToolbar(@Nonnull String dimensionKey) {
  JPanel panel = new NonOpaquePanel();
  panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
  myRestoreSizeButton = new MyToolbarButton("Restore Size", CollapseComponent, CollapseComponentHover, e -> {
    WindowStateService.getInstance(myProject).putSizeFor(myProject, dimensionKey, null);
    myInternalSizeChanged = true;
    pack(true, true);
  }) {
    @Override
    protected boolean isButtonEnabled() {
      return myUserSizeChanged;
    }
  };
  mySettingsButton = new MyToolbarButton("Settings", AllIcons.General.Gear, AllIcons.General.GearHover, e -> {
    final ActionPopupMenu popupMenu = ((ActionManagerImpl)ActionManager.getInstance()).createActionPopupMenu(BRANCH_POPUP, new DefaultActionGroup(mySettingsActions));
    popupMenu.getComponent().show(mySettingsButton, 0, assertNotNull(mySettingsButton).getHeight());
  }) {
    @Override
    protected boolean isButtonEnabled() {
      return !mySettingsActions.isEmpty();
    }
  };
  mySettingsButton.setBorder(JBUI.Borders.emptyLeft(4));

  panel.add(myRestoreSizeButton);
  panel.add(mySettingsButton);
  getTitle().setButtonComponent(new ActiveComponent.Adapter() {
    @Override
    public JComponent getComponent() {
      return panel;
    }
  }, JBUI.Borders.emptyRight(2));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:34,代码来源:BranchActionGroupPopup.java

示例13: showGearPopup

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
private void showGearPopup(Component component, int x, int y) {
    ActionPopupMenu popupMenu =
            ((ActionManagerImpl) ActionManager.getInstance())
                    .createActionPopupMenu(ToolWindowContentUi.POPUP_PLACE, createGearPopupGroup(), new MenuItemPresentationFactory(true));
    popupMenu.getComponent().show(component, x, y);
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:7,代码来源:ShowRNConsoleAction.java

示例14: showGearPopup

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
private void showGearPopup(Component component, int x, int y) {
  ActionPopupMenu popupMenu =
    ((ActionManagerImpl)ActionManager.getInstance())
      .createActionPopupMenu(ToolWindowContentUi.POPUP_PLACE, createGearPopupGroup(), new MenuItemPresentationFactory(true));
  popupMenu.getComponent().show(component, x, y);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:LightToolWindow.java

示例15: preload

import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
@Override
public void preload() {
  ((ActionManagerImpl) ActionManager.getInstance()).preloadActionGroup(IdeActions.GROUP_GENERATE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GenerateAction.java


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