Class JMenuItemHpr


  • public class JMenuItemHpr
    extends RJHelper
    A RJHelper implementation for JMenuItem (with specific support for subclasses: JMenu, JCheckBoxMenuItem).
    • Constructor Detail

      • JMenuItemHpr

        public JMenuItemHpr()
    • Method Detail

      • newInstance

        public java.lang.Object newInstance​(RXElement anElement)
        Creates a new instance of class for given element.
        Overrides:
        newInstance in class RJHelper
      • initInstance

        public void initInstance​(javax.swing.JComponent aComponent)
        Initializes the given instance (actually called the first time an owner is set).
        Overrides:
        initInstance in class RJHelper
      • getComponentCount

        public int getComponentCount​(javax.swing.JComponent aComponent)
        Returns the Ribs-relevant child component count.
        Overrides:
        getComponentCount in class RJHelper
      • getComponent

        public javax.swing.JComponent getComponent​(javax.swing.JComponent aComponent,
                                                   int anIndex)
        Returns the Ribs-relevant child component at the given index.
        Overrides:
        getComponent in class RJHelper
      • getImageName

        public java.lang.String getImageName​(javax.swing.JComponent aComponent)
        Returns the image name for this button's icon.
      • setImageName

        public void setImageName​(javax.swing.JComponent aComponent,
                                 java.lang.String aName)
        Sets the image name for this button's icon and tries to set the icon by asking Ribs for the named icon.
      • getStringValue

        public java.lang.String getStringValue​(javax.swing.JComponent aComponent)
        Returns the menu item's text.
        Overrides:
        getStringValue in class RJHelper
      • setValue

        public void setValue​(javax.swing.JComponent aComponent,
                             java.lang.String aValue)
        Sets the menu item's text.
        Overrides:
        setValue in class RJHelper
      • getBoolValue

        public boolean getBoolValue​(javax.swing.JComponent aComponent)
        Returns whether menu item is selected (or state if check box menu item).
        Overrides:
        getBoolValue in class RJHelper
      • setValue

        public void setValue​(javax.swing.JComponent aComponent,
                             boolean aValue)
        Sets whether the menu item is selected (or state if check box menu item).
        Overrides:
        setValue in class RJHelper
      • getIntValue

        public int getIntValue​(javax.swing.JComponent aComponent)
        Returns the menu item's text as an int.
        Overrides:
        getIntValue in class RJHelper
      • getFloatValue

        public float getFloatValue​(javax.swing.JComponent aComponent)
        Returns the menu item's text as an int.
        Overrides:
        getFloatValue in class RJHelper
      • fromXML

        public void fromXML​(javax.swing.JComponent aComponent,
                            RXArchiver anArchiver,
                            RXElement anElement)
        XML unarchival.
        Overrides:
        fromXML in class RJHelper
      • 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().