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


Java KeymapManager.getInstance方法代码示例

本文整理汇总了Java中com.intellij.openapi.keymap.KeymapManager.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java KeymapManager.getInstance方法的具体用法?Java KeymapManager.getInstance怎么用?Java KeymapManager.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.keymap.KeymapManager的用法示例。


在下文中一共展示了KeymapManager.getInstance方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fillActions

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
protected void fillActions(Project project, @NotNull DefaultActionGroup group, @NotNull DataContext dataContext) {
  final KeymapManagerEx manager = (KeymapManagerEx) KeymapManager.getInstance();
  final Keymap current = manager.getActiveKeymap();

  for (final Keymap keymap : manager.getAllKeymaps()) {
    addKeymapAction(group, manager, current, keymap, false);
  }

  Collection<SharedScheme<KeymapImpl>> sharedSchemes = ((KeymapManagerEx)KeymapManagerEx.getInstance()).getSchemesManager().loadSharedSchemes();

  if (!sharedSchemes.isEmpty()) {
    group.add(Separator.getInstance());
    for (SharedScheme<KeymapImpl> sharedScheme : sharedSchemes) {
      addKeymapAction(group, manager,current, sharedScheme.getScheme(), true);
    }
  }

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:QuickChangeKeymapAction.java

示例2: isMouseActionEvent

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
private static boolean isMouseActionEvent(@Nonnull MouseEvent e, String actionId) {
  KeymapManager keymapManager = KeymapManager.getInstance();
  if (keymapManager == null) return false;
  Keymap keymap = keymapManager.getActiveKeymap();
  if (keymap == null) return false;
  MouseShortcut mouseShortcut = KeymapUtil.createMouseShortcut(e);
  String[] mappedActions = keymap.getActionIds(mouseShortcut);
  if (!ArrayUtil.contains(actionId, mappedActions)) return false;
  if (mappedActions.length < 2) return true;
  ActionManager actionManager = ActionManager.getInstance();
  for (String mappedActionId : mappedActions) {
    if (actionId.equals(mappedActionId)) continue;
    AnAction action = actionManager.getAction(mappedActionId);
    AnActionEvent actionEvent =
            AnActionEvent.createFromAnAction(action, e, ActionPlaces.MAIN_MENU, DataManager.getInstance().getDataContext(e.getComponent()));
    if (ActionUtil.lastUpdateAndCheckDumb(action, actionEvent, false)) return false;
  }
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:EditorImpl.java

示例3: fillActionsList

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
private void fillActionsList(MouseShortcut mouseShortcut, boolean isModalContext) {
  myActions.clear();

  // search in main keymap
  if (KeymapManagerImpl.ourKeymapManagerInitialized) {
    final KeymapManager keymapManager = KeymapManager.getInstance();
    if (keymapManager != null) {
      final Keymap keymap = keymapManager.getActiveKeymap();
      final String[] actionIds = keymap.getActionIds(mouseShortcut);

      ActionManager actionManager = ActionManager.getInstance();
      for (String actionId : actionIds) {
        AnAction action = actionManager.getAction(actionId);

        if (action == null) continue;

        if (isModalContext && !action.isEnabledInModalContext()) continue;

        if (!myActions.contains(action)) {
          myActions.add(action);
        }
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:MacGestureSupportForEditor.java

示例4: ExternalSystemKeyMapListener

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
private ExternalSystemKeyMapListener() {
  KeymapManager keymapManager = KeymapManager.getInstance();
  if (keymapManager != null) {
    listenTo(keymapManager.getActiveKeymap());
    keymapManager.addKeymapManagerListener(this, ExternalSystemShortcutsManager.this);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ExternalSystemShortcutsManager.java

示例5: fillActions

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
@Override
protected void fillActions(Project project, @NotNull DefaultActionGroup group, @NotNull DataContext dataContext) {
  KeymapManagerEx manager = (KeymapManagerEx) KeymapManager.getInstance();
  Keymap current = manager.getActiveKeymap();
  for (Keymap keymap : manager.getAllKeymaps()) {
    addKeymapAction(group, manager, current, keymap, false);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:QuickChangeKeymapAction.java

示例6: getShowMoreShortCut

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
private String getShowMoreShortCut() {
  if (myShortcutText == null) {
    final KeymapManager keymapManager = KeymapManager.getInstance();
    if (keymapManager != null) {
      final Keymap keymap = keymapManager.getActiveKeymap();
      myShortcutText =
        keymap == null ? "" : "(" + KeymapUtil.getShortcutsText(keymap.getShortcuts(IdeActions.ACTION_SHOW_ERROR_DESCRIPTION)) + ")";
    }
    else {
      myShortcutText = "";
    }
  }

  return myShortcutText;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:AndroidLintExternalAnnotator.java

示例7: setDefaultMacKeymap

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
private static void setDefaultMacKeymap() {
  KeymapManagerImpl instance = (KeymapManagerImpl)KeymapManager.getInstance();
  Keymap mac105Keymap = getMac105Keymap();
  if (mac105Keymap != null) {
    instance.setActiveKeymap(mac105Keymap);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AndroidInitialConfigurator.java

示例8: initComponent

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
public void initComponent() {
  myModifiersValue = Registry.get("actionSystem.quickAccessModifiers");
  myModifiersValue.addListener(new RegistryValueListener.Adapter() {
    public void afterValueChanged(RegistryValue value) {
      applyModifiersFromRegistry();
    }
  }, this);

  KeymapManager kmMgr = KeymapManager.getInstance();
  kmMgr.addKeymapManagerListener(this);

  activeKeymapChanged(kmMgr.getActiveKeymap());

  applyModifiersFromRegistry();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:QuickAccessSettings.java

示例9: apply

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
public void apply() throws ConfigurationException{
  ensureNonEmptyKeymapNames();
  ensureUniqueKeymapNames();
  final KeymapManagerImpl keymapManager = (KeymapManagerImpl)KeymapManager.getInstance();
  keymapManager.removeAllKeymapsExceptUnmodifiable();
  for(int i = 0; i < myKeymapListModel.getSize(); i++){
    final Keymap modelKeymap = (Keymap)myKeymapListModel.getElementAt(i);
    if(modelKeymap.canModify()) {
      final KeymapImpl keymapToAdd = ((KeymapImpl)modelKeymap).copy(true);
      keymapManager.addKeymap(keymapToAdd);
    }
  }
  keymapManager.setActiveKeymap(mySelectedKeymap);
  ActionToolbarImpl.updateAllToolbarsImmediately();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:KeymapPanel.java

示例10: fillActions

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
@Override
protected void fillActions(Project project, @Nonnull DefaultActionGroup group, @Nonnull DataContext dataContext) {
  KeymapManagerEx manager = (KeymapManagerEx) KeymapManager.getInstance();
  Keymap current = manager.getActiveKeymap();
  for (Keymap keymap : manager.getAllKeymaps()) {
    addKeymapAction(group, manager, current, keymap, false);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:QuickChangeKeymapAction.java

示例11: getKeymapManager

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
@Nullable
private static KeymapManager getKeymapManager() {
  if (ApplicationManager.getApplication().isDisposed()) return null;
  return KeymapManager.getInstance();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ShadowAction.java

示例12: MyKeymapListener

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
public MyKeymapListener() {
  KeymapManager keymapManager = KeymapManager.getInstance();
  listenTo(keymapManager.getActiveKeymap());
  keymapManager.addKeymapManagerListener(this, MavenShortcutsManager.this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:MavenShortcutsManager.java

示例13: activeKeymapChanged

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
public void activeKeymapChanged(Keymap keymap) {
  KeymapManager mgr = KeymapManager.getInstance();
  myKeymap = mgr.getActiveKeymap();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:QuickAccessSettings.java

示例14: MyKeymapListener

import com.intellij.openapi.keymap.KeymapManager; //导入方法依赖的package包/类
public MyKeymapListener() {
  KeymapManager keymapManager = KeymapManager.getInstance();
  listenTo(keymapManager.getActiveKeymap());
  keymapManager.addKeymapManagerListener(this);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:MavenShortcutsManager.java


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