Package com.nomagic.actions
Class ActionsMenuCreator.AMC_ActionsVisitor
- java.lang.Object
-
- com.nomagic.actions.ActionsMenuCreator.AMC_ActionsVisitor
-
- All Implemented Interfaces:
ActionsVisitor
- Enclosing class:
- ActionsMenuCreator
protected class ActionsMenuCreator.AMC_ActionsVisitor extends java.lang.Object implements ActionsVisitor
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AMC_ActionsVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
addCategoryHeader(ActionsCategory category)
private void
addInvisibleSeparator(ActionsCategory category)
private javax.swing.JComponent
createMenuHeader(java.lang.String headerText, javax.swing.Icon icon)
Create header component for a menu with a given text.private javax.swing.JSeparator
createSeparator(ActionsCategory category)
private ActionsMenuCreator.MutableActionListener
findListener(java.util.Collection<ActionsMenuCreator.MutableActionListener> mutableListeners, java.awt.Container menu, ActionsCategory category)
private boolean
isEmpty(ActionsCategory category)
Check if this category is empty recursively - contains no actions or contains only empty other categoriesprivate boolean
isLastComponentVisibleSeparator()
void
visit(ActionsCategory category)
Visits ActionsCategory.void
visit(NMAction action)
Visits action.void
visit(NMStateAction action)
Visits NMStateAction.
-
-
-
Method Detail
-
visit
public void visit(ActionsCategory category)
Description copied from interface:ActionsVisitor
Visits ActionsCategory.- Specified by:
visit
in interfaceActionsVisitor
- Parameters:
category
- the category to visit.
-
visit
public void visit(NMAction action)
Description copied from interface:ActionsVisitor
Visits action.- Specified by:
visit
in interfaceActionsVisitor
- Parameters:
action
- the action to visit.
-
visit
public void visit(NMStateAction action)
Description copied from interface:ActionsVisitor
Visits NMStateAction.- Specified by:
visit
in interfaceActionsVisitor
- Parameters:
action
- the action to visit.
-
findListener
@CheckForNull private ActionsMenuCreator.MutableActionListener findListener(java.util.Collection<ActionsMenuCreator.MutableActionListener> mutableListeners, java.awt.Container menu, ActionsCategory category)
-
isEmpty
private boolean isEmpty(ActionsCategory category)
Check if this category is empty recursively - contains no actions or contains only empty other categories- Parameters:
category
- category- Returns:
- true if empty
-
isLastComponentVisibleSeparator
private boolean isLastComponentVisibleSeparator()
- Returns:
- true if last visible component is a visible separator or there is no last visible component at all
-
addInvisibleSeparator
private void addInvisibleSeparator(ActionsCategory category)
-
createSeparator
private javax.swing.JSeparator createSeparator(ActionsCategory category)
-
addCategoryHeader
private boolean addCategoryHeader(ActionsCategory category)
-
createMenuHeader
@CheckForNull private javax.swing.JComponent createMenuHeader(@CheckForNull java.lang.String headerText, @CheckForNull javax.swing.Icon icon)
Create header component for a menu with a given text.- Parameters:
headerText
- text to add- Returns:
- header component or null if header text is null
-
-