Package com.ribs.helpers
Class JMenuItemHpr
java.lang.Object
com.ribs.RJHelper
com.ribs.helpers.JMenuItemHpr
A RJHelper implementation for JMenuItem (with specific support for subclasses: JMenu, JCheckBoxMenuItem).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
fromXML
(JComponent aComponent, RXArchiver anArchiver, RXElement anElement) XML unarchival.boolean
getBoolValue
(JComponent aComponent) Returns whether menu item is selected (or state if check box menu item).getComponent
(JComponent aComponent, int anIndex) Returns the Ribs-relevant child component at the given index.int
getComponentCount
(JComponent aComponent) Returns the Ribs-relevant child component count.float
getFloatValue
(JComponent aComponent) Returns the menu item's text as an int.getImageName
(JComponent aComponent) Returns the image name for this button's icon.int
getIntValue
(JComponent aComponent) Returns the menu item's text as an int.static KeyStroke
getKeyStroke
(String aString) This utility method tries to get a keystroke from a string and tries to be more forgiving than KeyStroke.getKeyStroke().static String
getKeyText
(KeyStroke aKeyStroke) This utility method returns key text for a key stroke and tries to make it more conforming.getStringValue
(JComponent aComponent) Returns the menu item's text.void
initInstance
(JComponent aComponent) Initializes the given instance (actually called the first time an owner is set).newInstance
(RXElement anElement) Creates a new instance of class for given element.void
setImageName
(JComponent aComponent, String aName) Sets the image name for this button's icon and tries to set the icon by asking Ribs for the named icon.void
setValue
(JComponent aComponent, boolean aValue) Sets whether the menu item is selected (or state if check box menu item).void
setValue
(JComponent aComponent, String aValue) Sets the menu item's text.toXML
(JComponent aComponent, RXArchiver anArchiver) XML archival.Methods inherited from class com.ribs.RJHelper
add, focusGained, focusLost, fromXMLDeep, get, getActionListener, getAutoscrolls, getAutosizing, getBackground, getBindKey, getBooleanValue, getCallback, getChangeListener, getColorValue, getFocusListener, getForeground, getMaster, getMaximumSize, getMinimumSize, getOwner, getRibHeight, getRibWidth, getRibX, getRibY, getSendActionOnFocusLost, getSubstitutionClassString, getValue, isOpaque, performBindKeyGet, performBindKeySet, sendAction, setAutoscrolls, setAutosizing, setBackground, setBindKey, setCallback, setForeground, setMaster, setMaximumSize, setMinimumSize, setOpaque, setOwner, setSendActionOnFocusLost, setSubstitutionClassString, setValue, setValue, setValue, setValue, setValue, takeFloatValue, takeIntValue, testOutBeanBag, toXMLDeep
-
Constructor Details
-
JMenuItemHpr
public JMenuItemHpr()
-
-
Method Details
-
newInstance
Creates a new instance of class for given element.- Overrides:
newInstance
in classRJHelper
-
initInstance
Initializes the given instance (actually called the first time an owner is set).- Overrides:
initInstance
in classRJHelper
-
getComponentCount
Returns the Ribs-relevant child component count.- Overrides:
getComponentCount
in classRJHelper
-
getComponent
Returns the Ribs-relevant child component at the given index.- Overrides:
getComponent
in classRJHelper
-
getImageName
Returns the image name for this button's icon. -
setImageName
Sets the image name for this button's icon and tries to set the icon by asking Ribs for the named icon. -
getStringValue
Returns the menu item's text.- Overrides:
getStringValue
in classRJHelper
-
setValue
Sets the menu item's text. -
getBoolValue
Returns whether menu item is selected (or state if check box menu item).- Overrides:
getBoolValue
in classRJHelper
-
setValue
Sets whether the menu item is selected (or state if check box menu item). -
getIntValue
Returns the menu item's text as an int.- Overrides:
getIntValue
in classRJHelper
-
getFloatValue
Returns the menu item's text as an int.- Overrides:
getFloatValue
in classRJHelper
-
toXML
XML archival. -
fromXML
XML unarchival. -
getKeyText
This utility method returns key text for a key stroke and tries to make it more conforming. -
getKeyStroke
This utility method tries to get a keystroke from a string and tries to be more forgiving than KeyStroke.getKeyStroke().
-