Package com.ribs.helpers
Class JMenuItemHpr
- java.lang.Object
-
- com.ribs.RJHelper
-
- com.ribs.helpers.JMenuItemHpr
-
public class JMenuItemHpr extends RJHelper
A RJHelper implementation for JMenuItem (with specific support for subclasses: JMenu, JCheckBoxMenuItem).
-
-
Constructor Summary
Constructors Constructor Description JMenuItemHpr()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfromXML(javax.swing.JComponent aComponent, RXArchiver anArchiver, RXElement anElement)XML unarchival.booleangetBoolValue(javax.swing.JComponent aComponent)Returns whether menu item is selected (or state if check box menu item).javax.swing.JComponentgetComponent(javax.swing.JComponent aComponent, int anIndex)Returns the Ribs-relevant child component at the given index.intgetComponentCount(javax.swing.JComponent aComponent)Returns the Ribs-relevant child component count.floatgetFloatValue(javax.swing.JComponent aComponent)Returns the menu item's text as an int.java.lang.StringgetImageName(javax.swing.JComponent aComponent)Returns the image name for this button's icon.intgetIntValue(javax.swing.JComponent aComponent)Returns the menu item's text as an int.static javax.swing.KeyStrokegetKeyStroke(java.lang.String aString)This utility method tries to get a keystroke from a string and tries to be more forgiving than KeyStroke.getKeyStroke().static java.lang.StringgetKeyText(javax.swing.KeyStroke aKeyStroke)This utility method returns key text for a key stroke and tries to make it more conforming.java.lang.StringgetStringValue(javax.swing.JComponent aComponent)Returns the menu item's text.voidinitInstance(javax.swing.JComponent aComponent)Initializes the given instance (actually called the first time an owner is set).java.lang.ObjectnewInstance(RXElement anElement)Creates a new instance of class for given element.voidsetImageName(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.voidsetValue(javax.swing.JComponent aComponent, boolean aValue)Sets whether the menu item is selected (or state if check box menu item).voidsetValue(javax.swing.JComponent aComponent, java.lang.String aValue)Sets the menu item's text.RXElementtoXML(javax.swing.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
-
-
-
-
Method Detail
-
newInstance
public java.lang.Object newInstance(RXElement anElement)
Creates a new instance of class for given element.- Overrides:
newInstancein classRJHelper
-
initInstance
public void initInstance(javax.swing.JComponent aComponent)
Initializes the given instance (actually called the first time an owner is set).- Overrides:
initInstancein classRJHelper
-
getComponentCount
public int getComponentCount(javax.swing.JComponent aComponent)
Returns the Ribs-relevant child component count.- Overrides:
getComponentCountin classRJHelper
-
getComponent
public javax.swing.JComponent getComponent(javax.swing.JComponent aComponent, int anIndex)Returns the Ribs-relevant child component at the given index.- Overrides:
getComponentin classRJHelper
-
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:
getStringValuein classRJHelper
-
setValue
public void setValue(javax.swing.JComponent aComponent, java.lang.String aValue)Sets the menu item's text.
-
getBoolValue
public boolean getBoolValue(javax.swing.JComponent aComponent)
Returns whether menu item is selected (or state if check box menu item).- Overrides:
getBoolValuein classRJHelper
-
setValue
public void setValue(javax.swing.JComponent aComponent, boolean aValue)Sets whether the menu item is selected (or state if check box menu item).
-
getIntValue
public int getIntValue(javax.swing.JComponent aComponent)
Returns the menu item's text as an int.- Overrides:
getIntValuein classRJHelper
-
getFloatValue
public float getFloatValue(javax.swing.JComponent aComponent)
Returns the menu item's text as an int.- Overrides:
getFloatValuein classRJHelper
-
toXML
public RXElement toXML(javax.swing.JComponent aComponent, RXArchiver anArchiver)
XML archival.
-
fromXML
public void fromXML(javax.swing.JComponent aComponent, RXArchiver anArchiver, RXElement anElement)XML unarchival.
-
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().
-
-