Class JMenuItemHpr<T extends javax.swing.JMenuItem>

  • Direct Known Subclasses:
    JMenuHpr

    public class JMenuItemHpr<T extends javax.swing.JMenuItem>
    extends JComponentHpr<T>
    A helper implementation for JMenuItem (with specific support for subclasses: JCheckBoxMenuItem,JRadioButtonMenuItem).
    • Constructor Detail

      • JMenuItemHpr

        public JMenuItemHpr()
    • Method Detail

      • getChildCount

        public int getChildCount​(T anObj)
        Override to suppress children.
        Overrides:
        getChildCount in class JComponentHpr<T extends javax.swing.JMenuItem>
      • initUI

        public void initUI​(T aMenuItem,
                           UIOwner anOwner)
        Override to enable Action event.
        Overrides:
        initUI in class JComponentHpr<T extends javax.swing.JMenuItem>
      • getPropertyNameMapped

        public java.lang.String getPropertyNameMapped​(T anObj,
                                                      java.lang.String aName)
        Returns a mapped property name.
        Overrides:
        getPropertyNameMapped in class UIHelper<T extends javax.swing.JMenuItem>
      • createMenuItem

        public static javax.swing.JMenuItem createMenuItem​(java.lang.String aName,
                                                           java.lang.String theText,
                                                           java.lang.String aKey)
        Creates a JMenuItem for name and text and key accelerator description.
      • getKeyText

        public static java.lang.String getKeyText​(javax.swing.KeyStroke aKeyStroke)
        This utility method returns key text for a key stroke and tries to make it more conforming.
      • getKeyStroke

        public static javax.swing.KeyStroke getKeyStroke​(java.lang.String aString)
        This utility method tries to get a keystroke from a string and tries to be more forgiving than KeyStroke.getKeyStroke().