use of com.intellij.openapi.actionSystem.ex.ActionManagerEx in project intellij-community by JetBrains.
the class XXXXX method processKeyTyped.
private boolean processKeyTyped(char c) {
// [vova] This is patch for Mac OS X. Under Mac "input methods"
// is handled before our EventQueue consume upcoming KeyEvents.
IdeEventQueue queue = IdeEventQueue.getInstance();
if (queue.shouldNotTypeInEditor() || ProgressManager.getInstance().hasModalProgressIndicator()) {
return false;
}
FileDocumentManager manager = FileDocumentManager.getInstance();
final VirtualFile file = manager.getFile(myDocument);
if (file != null && !file.isValid()) {
return false;
}
ActionManagerEx actionManager = ActionManagerEx.getInstanceEx();
DataContext dataContext = getDataContext();
actionManager.fireBeforeEditorTyping(c, dataContext);
MacUIUtil.hideCursor();
EditorActionManager.getInstance().getTypedAction().actionPerformed(this, c, dataContext);
return true;
}
use of com.intellij.openapi.actionSystem.ex.ActionManagerEx in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugHistoricalSnapshotsTest method setUp.
@Before
public void setUp() {
MockApplication application = new MyMockApplicationEx(parent);
ActionManagerEx manager = Mockito.mock(ActionManagerEx.class);
ActionToolbar actionToolbar = Mockito.mock(ActionToolbar.class);
Mockito.when(actionToolbar.getComponent()).thenReturn(new JComponent() {
});
Mockito.when(manager.createActionToolbar(Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean())).thenReturn(actionToolbar);
Mockito.when(manager.createActionToolbar(Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(actionToolbar);
application.addComponent(ActionManager.class, manager);
application.registerService(UISettings.class);
ApplicationManager.setApplication(application, parent);
XDebugSession session = Mockito.mock(XDebugSession.class);
Mockito.when(handler.getProcess()).thenReturn(mockProcess);
Mockito.when(mockProcess.getXDebugSession()).thenReturn(session);
}
use of com.intellij.openapi.actionSystem.ex.ActionManagerEx in project intellij-community by JetBrains.
the class BaseToolKeymapExtension method createGroup.
@Override
public KeymapGroup createGroup(final Condition<AnAction> filtered, final Project project) {
final ActionManagerEx actionManager = ActionManagerEx.getInstanceEx();
String[] ids = actionManager.getActionIds(getActionIdPrefix());
Arrays.sort(ids);
Group group = new Group(getGroupName(), AllIcons.Nodes.KeymapTools);
HashMap<String, Group> toolGroupNameToGroup = new HashMap<>();
for (String id : ids) {
if (filtered != null && !filtered.value(actionManager.getActionOrStub(id)))
continue;
String groupName = getGroupByActionId(id);
if (groupName != null && groupName.trim().length() == 0) {
groupName = null;
}
Group subGroup = toolGroupNameToGroup.get(groupName);
if (subGroup == null) {
subGroup = new Group(groupName, null, null);
toolGroupNameToGroup.put(groupName, subGroup);
if (groupName != null) {
group.addGroup(subGroup);
}
}
subGroup.addActionId(id);
}
Group subGroup = toolGroupNameToGroup.get(null);
if (subGroup != null) {
group.addAll(subGroup);
}
return group;
}
use of com.intellij.openapi.actionSystem.ex.ActionManagerEx in project intellij-community by JetBrains.
the class ActionsTreeUtil method createMacrosGroup.
private static Group createMacrosGroup(Condition<AnAction> filtered) {
final ActionManagerEx actionManager = ActionManagerEx.getInstanceEx();
String[] ids = actionManager.getActionIds(ActionMacro.MACRO_ACTION_PREFIX);
Arrays.sort(ids);
Group group = new Group(KeyMapBundle.message("macros.group.title"), null, null);
for (String id : ids) {
if (filtered == null || filtered.value(actionManager.getActionOrStub(id))) {
group.addActionId(id);
}
}
return group;
}
use of com.intellij.openapi.actionSystem.ex.ActionManagerEx in project intellij-community by JetBrains.
the class ActionsTreeUtil method createPluginsActionsGroup.
private static Group createPluginsActionsGroup(Condition<AnAction> filtered) {
Group pluginsGroup = new Group(KeyMapBundle.message("plugins.group.title"), null, null);
final KeymapManagerEx keymapManager = KeymapManagerEx.getInstanceEx();
ActionManagerEx managerEx = ActionManagerEx.getInstanceEx();
final List<IdeaPluginDescriptor> plugins = new ArrayList<>();
Collections.addAll(plugins, PluginManagerCore.getPlugins());
Collections.sort(plugins, Comparator.comparing(IdeaPluginDescriptor::getName));
List<PluginId> collected = new ArrayList<>();
for (IdeaPluginDescriptor plugin : plugins) {
collected.add(plugin.getPluginId());
Group pluginGroup;
if (plugin.getName().equals("IDEA CORE")) {
continue;
} else {
pluginGroup = new Group(plugin.getName(), null, null);
}
final String[] pluginActions = managerEx.getPluginActions(plugin.getPluginId());
if (pluginActions.length == 0) {
continue;
}
Arrays.sort(pluginActions, Comparator.comparing(ActionsTreeUtil::getTextToCompare));
for (String pluginAction : pluginActions) {
if (keymapManager.getBoundActions().contains(pluginAction))
continue;
final AnAction anAction = managerEx.getActionOrStub(pluginAction);
if (filtered == null || filtered.value(anAction)) {
pluginGroup.addActionId(pluginAction);
}
}
if (pluginGroup.getSize() > 0) {
pluginsGroup.addGroup(pluginGroup);
}
}
for (PluginId pluginId : PluginId.getRegisteredIds().values()) {
if (collected.contains(pluginId))
continue;
Group pluginGroup = new Group(pluginId.getIdString(), null, null);
final String[] pluginActions = managerEx.getPluginActions(pluginId);
if (pluginActions.length == 0) {
continue;
}
for (String pluginAction : pluginActions) {
if (keymapManager.getBoundActions().contains(pluginAction))
continue;
final AnAction anAction = managerEx.getActionOrStub(pluginAction);
if (filtered == null || filtered.value(anAction)) {
pluginGroup.addActionId(pluginAction);
}
}
if (pluginGroup.getSize() > 0) {
pluginsGroup.addGroup(pluginGroup);
}
}
return pluginsGroup;
}
Aggregations