Gridarta Editor
net.sf.gridarta.gui.utils.MenuUtils Class Reference

Utility class implementing menu related functions. More...

+ Collaboration diagram for net.sf.gridarta.gui.utils.MenuUtils:

Static Public Member Functions

static void disposeMenuElement (@NotNull final MenuElement menuElement)
 Remove all actions attached to menu entries in a given menu element and its children. More...
 
static JMenu findMenu (@NotNull final MenuElement menuElement, @NotNull final String key)
 Returns a JMenu by action key. More...
 
static JMenu getMenu (@NotNull final JMenuBar menuBar, @NotNull final String name)
 Returns a named JMenu entry of a JMenuBar. More...
 
static void removeAll (@NotNull final JMenu menu)
 Remove all menu entries. More...
 
static void removeAllFromSeparator (@NotNull final JMenu menu)
 Remove all menu entries from (but not including) the last separator. More...
 
static void removeAllToSeparator (@NotNull final JMenu menu)
 Remove all menu entries up to (but not including) the first separator. More...
 

Private Member Functions

 MenuUtils ()
 Private constructor to prevent instantiation. More...
 

Static Private Attributes

static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
 The ActionBuilder. More...
 

Detailed Description

Utility class implementing menu related functions.

Author
Andreas Kirschbaum

Definition at line 39 of file MenuUtils.java.

Constructor & Destructor Documentation

◆ MenuUtils()

net.sf.gridarta.gui.utils.MenuUtils.MenuUtils ( )
private

Private constructor to prevent instantiation.

Definition at line 50 of file MenuUtils.java.

Member Function Documentation

◆ disposeMenuElement()

static void net.sf.gridarta.gui.utils.MenuUtils.disposeMenuElement ( @NotNull final MenuElement  menuElement)
static

Remove all actions attached to menu entries in a given menu element and its children.

Parameters
menuElementthe menu element to process

Definition at line 58 of file MenuUtils.java.

Referenced by net.sf.gridarta.gui.map.mapview.DefaultMapView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.closeNotify(), net.sf.gridarta.gui.utils.MenuUtils.removeAll(), net.sf.gridarta.gui.utils.MenuUtils.removeAllFromSeparator(), and net.sf.gridarta.gui.utils.MenuUtils.removeAllToSeparator().

+ Here is the caller graph for this function:

◆ findMenu()

static JMenu net.sf.gridarta.gui.utils.MenuUtils.findMenu ( @NotNull final MenuElement  menuElement,
@NotNull final String  key 
)
static

Returns a JMenu by action key.

Parameters
menuElementthe menu element to search for the action key
keythe action key to search
Returns
the menu or
null
if not found

Definition at line 136 of file MenuUtils.java.

References net.sf.gridarta.utils.ActionUtils.getActionId().

Referenced by net.sf.gridarta.gui.utils.tabbedpanel.Tab.Tab().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMenu()

static JMenu net.sf.gridarta.gui.utils.MenuUtils.getMenu ( @NotNull final JMenuBar  menuBar,
@NotNull final String  name 
)
static

Returns a named JMenu entry of a JMenuBar.

Parameters
menuBarthe menu bar
namethe name
Returns
the menu or
null
if not found

Definition at line 124 of file MenuUtils.java.

Referenced by net.sf.gridarta.maincontrol.GUIMainControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.GUIMainControl().

+ Here is the caller graph for this function:

◆ removeAll()

static void net.sf.gridarta.gui.utils.MenuUtils.removeAll ( @NotNull final JMenu  menu)
static

◆ removeAllFromSeparator()

static void net.sf.gridarta.gui.utils.MenuUtils.removeAllFromSeparator ( @NotNull final JMenu  menu)
static

Remove all menu entries from (but not including) the last separator.

Parameters
menuthe menu to remove the entries from

Definition at line 100 of file MenuUtils.java.

References net.sf.gridarta.gui.utils.MenuUtils.disposeMenuElement().

Referenced by net.sf.gridarta.gui.mapmenu.MapMenuManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAllToSeparator()

static void net.sf.gridarta.gui.utils.MenuUtils.removeAllToSeparator ( @NotNull final JMenu  menu)
static

Remove all menu entries up to (but not including) the first separator.

Parameters
menuthe menu to remove the entries from

Definition at line 83 of file MenuUtils.java.

References net.sf.gridarta.gui.utils.MenuUtils.disposeMenuElement().

Referenced by net.sf.gridarta.gui.dialog.plugin.PluginView< G, A, R >.updateMenuEntries().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ ACTION_BUILDER

final ActionBuilder net.sf.gridarta.gui.utils.MenuUtils.ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
staticprivate

The ActionBuilder.

Definition at line 45 of file MenuUtils.java.


The documentation for this class was generated from the following file: