public class MenuUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
disposeMenuElement(@NotNull javax.swing.MenuElement menuElement)
Remove all actions attached to menu entries in a given menu element and
its children.
|
static @Nullable javax.swing.JMenu |
findMenu(@NotNull javax.swing.MenuElement menuElement,
@NotNull java.lang.String key)
Returns a
JMenu by action key. |
static @Nullable javax.swing.JMenu |
getMenu(@NotNull javax.swing.JMenuBar menuBar,
@NotNull java.lang.String name)
Returns a named
JMenu entry of a JMenuBar. |
static void |
removeAll(@NotNull javax.swing.JMenu menu)
Remove all menu entries.
|
static void |
removeAllFromSeparator(@NotNull javax.swing.JMenu menu)
Remove all menu entries from (but not including) the last separator.
|
static void |
removeAllToSeparator(@NotNull javax.swing.JMenu menu)
Remove all menu entries up to (but not including) the first separator.
|
public static void disposeMenuElement(@NotNull
@NotNull javax.swing.MenuElement menuElement)
menuElement - the menu element to processpublic static void removeAll(@NotNull
@NotNull javax.swing.JMenu menu)
menu - the menu to remove the entries frompublic static void removeAllToSeparator(@NotNull
@NotNull javax.swing.JMenu menu)
menu - the menu to remove the entries frompublic static void removeAllFromSeparator(@NotNull
@NotNull javax.swing.JMenu menu)
menu - the menu to remove the entries from@Nullable
public static @Nullable javax.swing.JMenu getMenu(@NotNull
@NotNull javax.swing.JMenuBar menuBar,
@NotNull
@NotNull java.lang.String name)
JMenu entry of a JMenuBar.menuBar - the menu barname - the namenull if not found@Nullable
public static @Nullable javax.swing.JMenu findMenu(@NotNull
@NotNull javax.swing.MenuElement menuElement,
@NotNull
@NotNull java.lang.String key)
JMenu by action key.menuElement - the menu element to search for the action keykey - the action key to searchnull if not found