Package jmri.util.swing
Class JMenuUtil
- java.lang.Object
-
- jmri.util.swing.GuiUtilBase
-
- jmri.util.swing.JMenuUtil
-
public class JMenuUtil extends GuiUtilBase
Common utility methods for working with JMenus.Chief among these is the loadMenu method, for creating a set of menus from an XML definition
- Since:
- 2.9.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.util.swing.GuiUtilBase
GuiUtilBase.CallingAbstractAction
-
-
Constructor Summary
Constructors Constructor Description JMenuUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static int
convertStringToKeyEvent(java.lang.String st)
(package private) static javax.swing.JMenu
createMenuGroupFromElement(org.jdom2.Element main, WindowInterface wi, java.lang.Object context)
(package private) static javax.swing.JMenu
jMenuFromElement(org.jdom2.Element main, WindowInterface wi, java.lang.Object context)
static javax.swing.JMenu[]
loadMenu(java.lang.String path, WindowInterface wi, java.lang.Object context)
static boolean
replaceMenuItem(javax.swing.JMenuItem orginalMenuItem, javax.swing.JMenuItem replacementMenuItem)
replace a menu item in its parent with another menu item(package private) static void
setMenuItemInterAction(java.lang.Object context, java.lang.String ref, javax.swing.JMenuItem menuItem)
-
Methods inherited from class jmri.util.swing.GuiUtilBase
actionFromNode, createActionInCallingWindow, createEmptyMenuItem, rootFromName, setParameters
-
-
-
-
Constructor Detail
-
JMenuUtil
public JMenuUtil()
-
-
Method Detail
-
loadMenu
public static javax.swing.JMenu[] loadMenu(java.lang.String path, WindowInterface wi, java.lang.Object context)
-
jMenuFromElement
@Nonnull static javax.swing.JMenu jMenuFromElement(@CheckForNull org.jdom2.Element main, WindowInterface wi, java.lang.Object context)
-
createMenuGroupFromElement
@Nonnull static javax.swing.JMenu createMenuGroupFromElement(@CheckForNull org.jdom2.Element main, WindowInterface wi, java.lang.Object context)
-
setMenuItemInterAction
static void setMenuItemInterAction(@Nonnull java.lang.Object context, java.lang.String ref, javax.swing.JMenuItem menuItem)
-
convertStringToKeyEvent
static int convertStringToKeyEvent(@Nonnull java.lang.String st)
-
replaceMenuItem
public static boolean replaceMenuItem(@Nonnull javax.swing.JMenuItem orginalMenuItem, @Nonnull javax.swing.JMenuItem replacementMenuItem)
replace a menu item in its parent with another menu item(at the same position in the parent menu)
- Parameters:
orginalMenuItem
- the original menu item to be replacedreplacementMenuItem
- the menu item to replace it with- Returns:
- true if the original menu item was found and replaced
-
-