本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例15: preload
import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; //导入依赖的package包/类
@Override
public void preload() {
((ActionManagerImpl) ActionManager.getInstance()).preloadActionGroup(IdeActions.GROUP_GENERATE);
}