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


Java DefaultKeymap类代码示例

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


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

示例1: updateShortcuts

import com.intellij.openapi.keymap.impl.DefaultKeymap; //导入依赖的package包/类
private static void updateShortcuts(StringBuffer text) {
  int lastIndex = 0;
  while(true) {
    lastIndex = text.indexOf(SHORTCUT_ENTITY, lastIndex);
    if (lastIndex < 0) return;
    final int actionIdStart = lastIndex + SHORTCUT_ENTITY.length();
    int actionIdEnd = text.indexOf(";", actionIdStart);
    if (actionIdEnd < 0) {
      return;
    }
    final String actionId = text.substring(actionIdStart, actionIdEnd);
    String shortcutText = getShortcutText(actionId, KeymapManager.getInstance().getActiveKeymap());
    if (shortcutText == null) {
      Keymap defKeymap = KeymapManager.getInstance().getKeymap(DefaultKeymap.getInstance().getDefaultKeymapName());
      if (defKeymap != null) {
        shortcutText = getShortcutText(actionId, defKeymap);
        if (shortcutText != null) {
          shortcutText += " in default keymap";
        }
      }
    }
    if (shortcutText == null) {
      shortcutText = "<no shortcut for action " + actionId + ">";
    }
    text.replace(lastIndex, actionIdEnd + 1, shortcutText);
    lastIndex += shortcutText.length();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:TipUIUtil.java

示例2: applyKeymap

import com.intellij.openapi.keymap.impl.DefaultKeymap; //导入依赖的package包/类
private void applyKeymap(@Nonnull String keymapName) {
  if(myInitial) {
    return;
  }

  KeymapManagerEx keymapManager = KeymapManagerEx.getInstanceEx();
  DefaultKeymap defaultKeymap = DefaultKeymap.getInstance();
  Keymap[] keymaps = defaultKeymap.getKeymaps();
  for (Keymap keymap : keymaps) {
    if (keymapName.equals(keymap.getName())) {
      keymapManager.setActiveKeymap(keymap);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:CustomizeKeyboardSchemeStepPanel.java

示例3: updateShortcuts

import com.intellij.openapi.keymap.impl.DefaultKeymap; //导入依赖的package包/类
private static void updateShortcuts(StringBuilder text) {
  int lastIndex = 0;
  while (true) {
    lastIndex = text.indexOf(SHORTCUT_ENTITY, lastIndex);
    if (lastIndex < 0) return;
    final int actionIdStart = lastIndex + SHORTCUT_ENTITY.length();
    int actionIdEnd = text.indexOf(";", actionIdStart);
    if (actionIdEnd < 0) {
      return;
    }
    final String actionId = text.substring(actionIdStart, actionIdEnd);
    String shortcutText = getShortcutText(actionId, KeymapManager.getInstance().getActiveKeymap());
    if (shortcutText == null) {
      Keymap defKeymap = KeymapManager.getInstance().getKeymap(DefaultKeymap.getInstance().getDefaultKeymapName());
      if (defKeymap != null) {
        shortcutText = getShortcutText(actionId, defKeymap);
        if (shortcutText != null) {
          shortcutText += " in default keymap";
        }
      }
    }
    if (shortcutText == null) {
      shortcutText = "<no shortcut for action " + actionId + ">";
    }
    text.replace(lastIndex, actionIdEnd + 1, shortcutText);
    lastIndex += shortcutText.length();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:29,代码来源:TipUIUtil.java


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