Class MenuExtensions


  • public final class MenuExtensions
    extends java.lang.Object
    The class MenuExtensions.
    • Constructor Summary

      Constructors 
      Constructor Description
      MenuExtensions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void setAccelerator​(javax.swing.JMenuItem jmi, char keyChar)
      Sets the accelerator for the given menuitem and the given key char.
      static void setAccelerator​(javax.swing.JMenuItem jmi, int keyCode, int modifiers)
      Sets the accelerator for the given menuitem and the given key code and the given modifiers.
      static void setAccelerator​(javax.swing.JMenuItem jmi, int keyCode, int modifiers, boolean onKeyRelease)
      Sets the accelerator for the given menuitem and the given keyCode and the given modifiers.
      static void setAccelerator​(javax.swing.JMenuItem jmi, java.lang.Character keyChar, int modifiers)
      Sets the accelerator for the given menuitem and the given key char and the given modifiers.
      static void setAccelerator​(javax.swing.JMenuItem jmi, java.lang.String parsableKeystrokeString)
      Sets the accelerator for the given menuitem and the given parsable keystroke string.
      static void setAltAccelerator​(javax.swing.JMenuItem jmi, char accelerator)
      Sets the accelerator for the given menuitem and the given character with the ALT.
      static void setCtrlAccelerator​(javax.swing.JMenuItem jmi, char accelerator)
      Sets the accelerator for the given menuitem and the given character with the CTRL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MenuExtensions

        public MenuExtensions()
    • Method Detail

      • setAccelerator

        public static void setAccelerator​(javax.swing.JMenuItem jmi,
                                          char keyChar)
        Sets the accelerator for the given menuitem and the given key char.
        Parameters:
        jmi - The JMenuItem.
        keyChar - the key char
      • setAccelerator

        public static void setAccelerator​(javax.swing.JMenuItem jmi,
                                          java.lang.Character keyChar,
                                          int modifiers)
        Sets the accelerator for the given menuitem and the given key char and the given modifiers.
        Parameters:
        jmi - The JMenuItem.
        keyChar - the key char
        modifiers - the modifiers
      • setAccelerator

        public static void setAccelerator​(javax.swing.JMenuItem jmi,
                                          int keyCode,
                                          int modifiers)
        Sets the accelerator for the given menuitem and the given key code and the given modifiers.
        Parameters:
        jmi - The JMenuItem.
        keyCode - the key code
        modifiers - the modifiers
      • setAccelerator

        public static void setAccelerator​(javax.swing.JMenuItem jmi,
                                          int keyCode,
                                          int modifiers,
                                          boolean onKeyRelease)
        Sets the accelerator for the given menuitem and the given keyCode and the given modifiers.
        Parameters:
        jmi - The JMenuItem.
        keyCode - the key code
        modifiers - the modifiers
        onKeyRelease - true if the KeyStroke should represent a key release, false otherwise.
      • setAccelerator

        public static void setAccelerator​(javax.swing.JMenuItem jmi,
                                          java.lang.String parsableKeystrokeString)
        Sets the accelerator for the given menuitem and the given parsable keystroke string.
        Parameters:
        jmi - The JMenuItem.
        parsableKeystrokeString - the parsable keystroke string
      • setAltAccelerator

        public static void setAltAccelerator​(javax.swing.JMenuItem jmi,
                                             char accelerator)
        Sets the accelerator for the given menuitem and the given character with the ALT. The accelerator are combined with the given character and the ALT.
        Parameters:
        jmi - The JMenuItem.
        accelerator - The character that have to push together with the ALT.
      • setCtrlAccelerator

        public static void setCtrlAccelerator​(javax.swing.JMenuItem jmi,
                                              char accelerator)
        Sets the accelerator for the given menuitem and the given character with the CTRL. The accelerator are combined with the given character and the CTRL.
        Parameters:
        jmi - The JMenuItem.
        accelerator - The character that have to push together with the CTRL.