本文整理汇总了Java中com.intellij.openapi.keymap.KeymapUtil.getKeystrokeText方法的典型用法代码示例。如果您正苦于以下问题:Java KeymapUtil.getKeystrokeText方法的具体用法?Java KeymapUtil.getKeystrokeText怎么用?Java KeymapUtil.getKeystrokeText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.keymap.KeymapUtil
的用法示例。
在下文中一共展示了KeymapUtil.getKeystrokeText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ChooseByNamePopup
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
protected ChooseByNamePopup(@Nullable final Project project,
@NotNull ChooseByNameModel model,
@NotNull ChooseByNameItemProvider provider,
@Nullable ChooseByNamePopup oldPopup,
@Nullable final String predefinedText,
boolean mayRequestOpenInCurrentWindow,
int initialIndex) {
super(project, model, provider, oldPopup != null ? oldPopup.getEnteredText() : predefinedText, initialIndex);
myOldPopup = oldPopup;
if (oldPopup != null) { //inherit old focus owner
myOldFocusOwner = oldPopup.myPreviouslyFocusedComponent;
}
myMayRequestCurrentWindow = mayRequestOpenInCurrentWindow;
myAdText = myMayRequestCurrentWindow ? "Press " +
KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK)) +
" to open in current window" : null;
}
示例2: ChooseByNamePopup
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
protected ChooseByNamePopup(@Nullable final Project project,
@Nonnull ChooseByNameModel model,
@Nonnull ChooseByNameItemProvider provider,
@Nullable ChooseByNamePopup oldPopup,
@Nullable final String predefinedText,
boolean mayRequestOpenInCurrentWindow,
int initialIndex) {
super(project, model, provider, oldPopup != null ? oldPopup.getEnteredText() : predefinedText, initialIndex);
myOldPopup = oldPopup;
if (oldPopup != null) { //inherit old focus owner
myOldFocusOwner = oldPopup.myPreviouslyFocusedComponent;
}
myMayRequestCurrentWindow = mayRequestOpenInCurrentWindow;
myAdText = myMayRequestCurrentWindow ? "Press " +
KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK)) +
" to open in current window" : null;
}
示例3: updateIcon
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
private void updateIcon() {
if (isActive()) {
boolean changes = false;
if (!isVisible()) {
setVisible(true);
changes = true;
}
Icon icon = UISettings.getInstance().HIDE_TOOL_STRIPES ? AllIcons.General.TbShown : AllIcons.General.TbHidden;
if (icon != getIcon()) {
setIcon(icon);
changes = true;
}
Set<Integer> vks = ToolWindowManagerImpl.getActivateToolWindowVKs();
String text = "Click to show or hide the tool window bars";
if (vks.size() == 1) {
Integer stroke = vks.iterator().next();
String keystrokeText = KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke(stroke.intValue(), 0));
text += ".\nDouble-press and hold " + keystrokeText + " to show tool window bars when hidden.";
}
if (!text.equals(getToolTipText())) {
setToolTipText(text);
changes = true;
}
if (changes) {
revalidate();
repaint();
}
}
else {
setVisible(false);
setToolTipText(null);
}
}
示例4: toString
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
@Override
public String toString() {
String s = getType() == KeyboardGestureAction.ModifierType.dblClick ? "Press, release and hold " : "Hold ";
s += KeymapUtil.getKeystrokeText(this.getStroke());
return s;
}
示例5: getTextByKeyStroke
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
static String getTextByKeyStroke(KeyStroke keyStroke) {
if(keyStroke == null) {
return "";
}
return KeymapUtil.getKeystrokeText(keyStroke);
}
示例6: NewLineAction
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
public NewLineAction() {
super(null, "New line (" + KeymapUtil.getKeystrokeText(NEW_LINE_KEYSTROKE) + ")", AllIcons.Actions.SearchNewLine);
}