@OpenApiAll public class ActionsMenuCreator extends java.lang.Object implements ActionsVisitor
Modifier and Type | Class and Description |
---|---|
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) 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 |
static java.lang.String |
POPUP_HEADER_ITEM_NAME |
Constructor and Description |
---|
ActionsMenuCreator() |
Modifier and Type | Method and Description |
---|---|
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 given pop up menu.
|
void |
appendMenuItems(javax.swing.JPopupMenu popup,
ActionsManager manager,
boolean addSeparator)
Appends menu items to given popup.
|
javax.swing.JPopupMenu |
createPopupMenu(ActionsManager manager)
Creates popup menu for given actions manager
|
com.nomagic.actions.MenuComponentFactory |
getFactory()
Return menu component factory
|
static boolean |
isSeparatorComponent(java.awt.Component component) |
void |
setFactory(com.nomagic.actions.MenuComponentFactory factory)
Set menu component factory
|
void |
setIndex(int index)
Sets index attribute with the given index.
|
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. |
void |
visit(ActionsCategory category)
Creates menu of nested category or appends separator for not nested.
|
void |
visit(NMAction action)
Constructs the JMenuItem from this action.
|
void |
visit(NMStateAction action)
Visits state action and creates JCheckBoxMenuItem.
|
public static final java.lang.String HIDDEN_ALWAYS
public static final java.lang.String ACTION
public static final java.lang.String CATEGORY_HEADER
public static final java.lang.String POPUP_HEADER_ITEM_NAME
public void appendMenuItems(javax.swing.JPopupMenu popup, ActionsManager manager, boolean addSeparator)
popup
- where items will be appended.manager
- manager from which actions menu items will be created.addSeparator
- add separator after last item in the given popup or not.public void appendMenuItems(javax.swing.JPopupMenu popup, ActionsManager manager)
popup
- where items will be appended.manager
- manager from which actions menu items will be created.public javax.swing.JPopupMenu createPopupMenu(ActionsManager manager)
manager
- managerpublic void appendMenuItems(java.awt.Container container, ActionsManager manager)
container
- container where items will be appended.manager
- manager from which actions items will be created.public void visit(NMStateAction action)
visit
in interface ActionsVisitor
action
- action to visit.public void setIndex(int index)
index
- The given index.public void visit(NMAction action)
visit
in interface ActionsVisitor
action
- action to visit.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 visit(ActionsCategory category)
visit
in interface ActionsVisitor
category
- category to visit.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)