@OpenApiAll
public class ActionsMenuCreator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
ActionsMenuCreator.AMC_ActionsVisitor |
static class |
ActionsMenuCreator.CustomJMenuItem |
(package private) static class |
ActionsMenuCreator.MenuItemActionListener
Class which listens for actions changes and updates menu item.
|
class |
ActionsMenuCreator.MutableActionListener
Class for handling ActionsCategory changes.
|
(package private) static class |
ActionsMenuCreator.StateActionListener
Class which listens state action state changes and updates CheckBox component according changes.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION |
static java.lang.String |
CATEGORY_HEADER |
static java.lang.String |
HIDDEN_ALWAYS |
(package private) static java.lang.String |
MUTABLE_ACTION_LISTENERS_LIST |
static java.lang.String |
POPUP_HEADER_ITEM_NAME |
Constructor and Description |
---|
ActionsMenuCreator() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCleanupParticipant(java.lang.Runnable participant) |
protected void |
addJMenuItem(java.awt.Component item,
NMAction action)
Adds menu item, according to index item will be added to end when index less than 0, or to
specified by index position.
|
void |
appendMenuItems(java.awt.Container container,
ActionsManager manager)
Appends menu items to given container.
|
void |
appendMenuItems(javax.swing.JPopupMenu popup,
ActionsManager manager)
Appends menu items to the given pop up menu.
|
void |
appendMenuItems(javax.swing.JPopupMenu popup,
ActionsManager manager,
boolean addSeparator)
Appends menu items to given popup.
|
protected ActionsVisitor |
createActionsVisitor() |
javax.swing.JPopupMenu |
createPopupMenu(ActionsManager manager)
Creates popup menu for given actions manager
|
javax.swing.JPopupMenu |
createPopupMenu(ActionsManager manager,
java.util.function.Supplier<javax.swing.JPopupMenu> factory)
Creates popup menu for given actions manager
|
com.nomagic.actions.MenuComponentFactory |
getFactory()
Return menu component factory
|
protected void |
internalAppendMenuItems(java.awt.Container container,
ActionsManager manager) |
protected void |
internalAppendMenuItems(javax.swing.JPopupMenu popup,
ActionsManager manager,
boolean addSeparator) |
static boolean |
isSeparatorComponent(java.awt.Component component) |
void |
setFactory(com.nomagic.actions.MenuComponentFactory factory)
Set menu component factory
|
static void |
setPropertiesToMenuItem(javax.swing.JMenuItem item,
NMAction action)
Sets properties to given JMenuItem from given action.
|
void |
setUseMenuListener(boolean useMenuListener)
Do we need to use
MenuListener on category? This flag should be set to true only if
software is running on mac and using -Dapple.laf.useScreenMenuBar=true system property. |
public static final java.lang.String HIDDEN_ALWAYS
public static final java.lang.String ACTION
public static final java.lang.String CATEGORY_HEADER
static final java.lang.String MUTABLE_ACTION_LISTENERS_LIST
public static final java.lang.String POPUP_HEADER_ITEM_NAME
public final javax.swing.JPopupMenu createPopupMenu(ActionsManager manager)
manager
- managerpublic final javax.swing.JPopupMenu createPopupMenu(ActionsManager manager, java.util.function.Supplier<javax.swing.JPopupMenu> factory)
manager
- managerfactory
- new popup menu factorypublic final void appendMenuItems(javax.swing.JPopupMenu popup, ActionsManager manager)
popup
- where items will be appendedmanager
- manager from which actions menu items will be createdpublic final void appendMenuItems(javax.swing.JPopupMenu popup, ActionsManager manager, boolean addSeparator)
popup
- where items will be appendedmanager
- manager from which actions menu items will be createdaddSeparator
- add separator after last item in the given popup or notprotected void internalAppendMenuItems(javax.swing.JPopupMenu popup, ActionsManager manager, boolean addSeparator)
public final void appendMenuItems(java.awt.Container container, ActionsManager manager)
container
- container where items will be appendedmanager
- manager from which actions items will be createdprotected ActionsVisitor createActionsVisitor()
protected void internalAppendMenuItems(java.awt.Container container, ActionsManager manager)
protected void addJMenuItem(java.awt.Component item, NMAction action)
item
- item to add.action
- actionpublic static void setPropertiesToMenuItem(javax.swing.JMenuItem item, NMAction action)
item
- item to set properties.action
- for getting properties.public void setUseMenuListener(boolean useMenuListener)
MenuListener
on category? This flag should be set to true only if
software is running on mac and using -Dapple.laf.useScreenMenuBar=true system property.useMenuListener
- true if need to use.public com.nomagic.actions.MenuComponentFactory getFactory()
public void setFactory(com.nomagic.actions.MenuComponentFactory factory)
factory
- factorypublic static boolean isSeparatorComponent(@CheckForNull java.awt.Component component)
protected void addCleanupParticipant(java.lang.Runnable participant)