public final class JaxoMenuUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isChecked(javax.swing.JMenuItem m)
Checks whether the given JMenuItem is selected.
|
static javax.swing.JMenuItem |
newCheckmarkMenuItem()
=newCheckmarMenuItem(null).
|
static javax.swing.JMenuItem |
newCheckmarkMenuItem(java.lang.String text)
Depending on configuration, a JCheckBoxMenuItem or a JMenuItem with custom Icon.
|
static void |
setAccelerator(javax.swing.JMenuItem m,
char keyChar)
Sets the Keyboard Accelerator of a JMenuItem to the specified character.
|
static void |
setAccelerator(javax.swing.JMenuItem m,
int keyCode,
int modifiers)
Sets the Keyboard Accelerator of a JMenuItem to a KeyStroke
given by a numeric key code and a set of modifiers.
|
static void |
setActionCommand(javax.swing.JMenuItem m,
int mode)
Sets the ActionCommand of a JMenuItem to the given mode.
|
static void |
setChecked(javax.swing.JMenuItem m,
boolean value)
Sets the given JMenuItem as selected.
|
static void |
setLanguageKey(javax.swing.JMenuItem m,
java.lang.String key)
Set the i18n key of a JMenuItem.
|
static void |
updateLanguage(javax.swing.JMenuItem m)
Update the text of a JMenuItem.
|
public static javax.swing.JMenuItem newCheckmarkMenuItem()
public static javax.swing.JMenuItem newCheckmarkMenuItem(java.lang.String text)
text - The text of the JMenuItem.public static boolean isChecked(javax.swing.JMenuItem m)
m - The JMenuItem to check.newCheckmarkMenuItem()public static void setChecked(javax.swing.JMenuItem m,
boolean value)
m - The JMenuItem to check.value - True to set the JMenuItem as selected.newCheckmarkMenuItem()public static void updateLanguage(javax.swing.JMenuItem m)
m - The JMenuItem.public static void setLanguageKey(javax.swing.JMenuItem m,
java.lang.String key)
m - The JMenuItem.key - the language key.public static void setAccelerator(javax.swing.JMenuItem m,
char keyChar)
m - The JMenuItem.keyChar - the character value for a keyboard keyKeyStroke.getKeyStroke(char)public static void setAccelerator(javax.swing.JMenuItem m,
int keyCode,
int modifiers)
m - The JMenuItem.keyCode - an int specifying the numeric code for a keyboard key.modifiers - a bitwise-ored combination of any modifiers.KeyStroke.getKeyStroke(int,int)public static void setActionCommand(javax.swing.JMenuItem m,
int mode)
m - The JMenuItem.mode - A mode as defined in JaxoConstants.JaxoConstants.getModeAsString(int)Licensed under GPL. For more information, see http://jaxodraw.sourceforge.net/license.html or the LICENSE file in the jaxodraw distribution.