Example usage for com.intellij.openapi.keymap KeymapUtil getKeyModifiersTextForMacOSLeopard

List of usage examples for com.intellij.openapi.keymap KeymapUtil getKeyModifiersTextForMacOSLeopard

Introduction

In this page you can find the example usage for com.intellij.openapi.keymap KeymapUtil getKeyModifiersTextForMacOSLeopard.

Prototype

@NotNull
    public static String getKeyModifiersTextForMacOSLeopard(@JdkConstants.InputEventMask int modifiers) 

Source Link

Usage

From source file:com.intellij.ui.plaf.beg.BegMenuItemUI.java

License:Apache License

private String getKeyStrokeText(KeyStroke keystroke) {
    String s1 = "";
    if (keystroke != null) {
        int j1 = keystroke.getModifiers();
        if (j1 > 0) {
            if (SystemInfo.isMac) {
                try {
                    Class appleLaf = Class.forName(AQUA_LOOK_AND_FEEL_CLASS_NAME);
                    Method getModifiers = appleLaf.getMethod(GET_KEY_MODIFIERS_TEXT,
                            new Class[] { int.class, boolean.class });
                    s1 = (String) getModifiers.invoke(appleLaf,
                            new Object[] { new Integer(j1), Boolean.FALSE });
                } catch (Exception e) {
                    if (SystemInfo.isMacOSLeopard) {
                        s1 = KeymapUtil.getKeyModifiersTextForMacOSLeopard(j1);
                    } else {
                        s1 = KeyEvent.getKeyModifiersText(j1) + '+';
                    }/*  w w  w.  jav a  2  s.  c  o  m*/
                }
            } else {
                s1 = KeyEvent.getKeyModifiersText(j1) + '+';
            }

        }
        s1 = s1 + KeyEvent.getKeyText(keystroke.getKeyCode());
    }
    return s1;
}