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 TypeMethodDescriptionvoidfromXML(JComponent aComponent, RXArchiver anArchiver, RXElement anElement) XML unarchival.booleangetBoolValue(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.intgetComponentCount(JComponent aComponent) Returns the Ribs-relevant child component count.floatgetFloatValue(JComponent aComponent) Returns the menu item's text as an int.getImageName(JComponent aComponent) Returns the image name for this button's icon.intgetIntValue(JComponent aComponent) Returns the menu item's text as an int.static KeyStrokegetKeyStroke(String aString) This utility method tries to get a keystroke from a string and tries to be more forgiving than KeyStroke.getKeyStroke().static StringgetKeyText(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.voidinitInstance(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.voidsetImageName(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.voidsetValue(JComponent aComponent, boolean aValue) Sets whether the menu item is selected (or state if check box menu item).voidsetValue(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:
newInstancein classRJHelper
-
initInstance
Initializes the given instance (actually called the first time an owner is set).- Overrides:
initInstancein classRJHelper
-
getComponentCount
Returns the Ribs-relevant child component count.- Overrides:
getComponentCountin classRJHelper
-
getComponent
Returns the Ribs-relevant child component at the given index.- Overrides:
getComponentin 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:
getStringValuein classRJHelper
-
setValue
Sets the menu item's text. -
getBoolValue
Returns whether menu item is selected (or state if check box menu item).- Overrides:
getBoolValuein 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:
getIntValuein classRJHelper
-
getFloatValue
Returns the menu item's text as an int.- Overrides:
getFloatValuein 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().
-