Java Code Examples for com.intellij.openapi.application.Application#getComponent()

The following examples show how to use com.intellij.openapi.application.Application#getComponent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConsoleLog.java    From aem-ide-tooling-4-intellij with Apache License 2.0 5 votes vote down vote up
protected static ConsoleLog getApplicationComponent() {
    ConsoleLog answer = null;
    Application application = ApplicationManager.getApplication();
    if(application != null) {
        answer = application.getComponent(ConsoleLog.class);
    }
    return answer;
}
 
Example 2
Source File: KeymapUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
public static ShortcutSet getActiveKeymapShortcuts(@Nullable String actionId) {
  Application application = ApplicationManager.getApplication();
  KeymapManager keymapManager = application == null ? null : application.getComponent(KeymapManager.class);
  if (keymapManager == null || actionId == null) {
    return new CustomShortcutSet(Shortcut.EMPTY_ARRAY);
  }
  return new CustomShortcutSet(keymapManager.getActiveKeymap().getShortcuts(actionId));
}
 
Example 3
Source File: CommonShortcuts.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
private static CustomShortcutSet shortcutsById(String actionId) {
  Application application = ApplicationManager.getApplication();
  KeymapManager keymapManager = application == null ? null : application.getComponent(KeymapManager.class);
  if (keymapManager == null) {
    return new CustomShortcutSet(Shortcut.EMPTY_ARRAY);
  }
  return new CustomShortcutSet(keymapManager.getActiveKeymap().getShortcuts(actionId));
}
 
Example 4
Source File: PathMacroManager.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static PathMacroManager getInstance(@Nonnull Application application) {
  return application.getComponent(ApplicationPathMacroManager.class);
}
 
Example 5
Source File: CppSupportSettings.java    From CppTools with Apache License 2.0 4 votes vote down vote up
public static CppSupportSettings getInstance() {
  final Application application = ApplicationManager.getApplication();
  if (application.isUnitTestMode()) return instance;
  return application.getComponent(CppSupportSettings.class);
}