Package com.nomagic.actions
Class ActionsCommandBarCreator
- java.lang.Object
-
- com.nomagic.actions.ActionsCommandBarCreator
-
- All Implemented Interfaces:
ActionsVisitor
,com.nomagic.magicdraw.ui.actions.MainActionsVisitor
@OpenApiAll public abstract class ActionsCommandBarCreator extends java.lang.Object implements ActionsVisitor, com.nomagic.magicdraw.ui.actions.MainActionsVisitor
The abstract class for creating toolbars from actions. This class provides common framework for toolbar creation, but does not implement specific methods for buttons creation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ActionsCommandBarCreator.ButtonFactory
Buttons factory used to create a buttonstatic class
ActionsCommandBarCreator.FontFaceCellRenderer
The renderer used to represent some font face name.static class
ActionsCommandBarCreator.ListComboBox
Class for representing list action as combo box.static class
ActionsCommandBarCreator.NMJideButtonFactory
static class
ActionsCommandBarCreator.NMJideSplitButtonFactory
static interface
ActionsCommandBarCreator.SplitButtonFactory
Buttons factory used to create a button
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.JComponent
currentToolbar
The toolbar to add buttons into during the visit actions.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ActionsCommandBarCreator()
Creates new creator with Jide buttons factoryprotected
ActionsCommandBarCreator(ActionsCommandBarCreator.ButtonFactory factory)
Creates new creator with given buttons factoryprotected
ActionsCommandBarCreator(ActionsCommandBarCreator.ButtonFactory factory, ActionsCommandBarCreator.SplitButtonFactory splitButtonFactory)
Creates new creator with given buttons factory
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
acceptChildren(ActionsManager manager)
For all categories in manager calls accept this visitor.protected void
acceptChildren(NMAction parent)
Calls accept for all actions in given action.protected void
addFlexibleSeparator()
Adds a flexible separator into the current toolbar.protected abstract void
addToCurrentToolbar(java.awt.Component c)
protected void
addToJideSplitButton(ActionsCategory category)
protected javax.swing.AbstractButton
createComponent(NMAction action)
Creates NMActionButton for given action.protected javax.swing.AbstractButton
createComponent(NMStateAction action)
Creates MDStateActionButton from MDStateAction.protected java.awt.Component
createComponent(com.nomagic.magicdraw.uml.symbols.actions.ChangeFontAction action)
protected java.awt.Component
createComponent(com.nomagic.magicdraw.uml.symbols.actions.ChangeZoomAction category)
protected com.nomagic.awt.NMJideSplitButton
createJideSplitButton(NMAction a)
protected void
createPropertyActionComponent(PropertyAction action)
com.nomagic.awt.ActionIconProvider
getIconProvider()
void
setIconProvider(com.nomagic.awt.ActionIconProvider iconProvider)
abstract void
visit(ActionsCategory category)
Visits ActionsCategory.void
visit(NMAction action)
Visits action.void
visit(NMStateAction action)
Visits NMStateAction.void
visit(SelectItemAction action)
void
visit(PropertyAction action)
void
visit(com.nomagic.magicdraw.uml.symbols.actions.ChangeFontAction action)
void
visit(com.nomagic.magicdraw.uml.symbols.actions.ChangeZoomAction category)
-
-
-
Constructor Detail
-
ActionsCommandBarCreator
protected ActionsCommandBarCreator()
Creates new creator with Jide buttons factory
-
ActionsCommandBarCreator
protected ActionsCommandBarCreator(ActionsCommandBarCreator.ButtonFactory factory)
Creates new creator with given buttons factory- Parameters:
factory
- factory
-
ActionsCommandBarCreator
protected ActionsCommandBarCreator(ActionsCommandBarCreator.ButtonFactory factory, ActionsCommandBarCreator.SplitButtonFactory splitButtonFactory)
Creates new creator with given buttons factory- Parameters:
factory
- factory
-
-
Method Detail
-
acceptChildren
protected void acceptChildren(ActionsManager manager)
For all categories in manager calls accept this visitor.- Parameters:
manager
- manager from which categories will be collected.
-
addFlexibleSeparator
protected void addFlexibleSeparator()
Adds a flexible separator into the current toolbar. It should move other buttons to the most right/bottom position
-
addToJideSplitButton
protected void addToJideSplitButton(ActionsCategory category)
-
createJideSplitButton
protected com.nomagic.awt.NMJideSplitButton createJideSplitButton(NMAction a)
-
acceptChildren
protected void acceptChildren(NMAction parent)
Calls accept for all actions in given action.- Parameters:
parent
- container of actions.
-
createComponent
protected javax.swing.AbstractButton createComponent(NMAction action)
Creates NMActionButton for given action.- Parameters:
action
- action source for button.- Returns:
- created button.
-
createComponent
protected javax.swing.AbstractButton createComponent(NMStateAction action)
Creates MDStateActionButton from MDStateAction.- Parameters:
action
- source for creating button.- Returns:
- created button.
-
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.
-
visit
public abstract 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(SelectItemAction action)
- Specified by:
visit
in interfacecom.nomagic.magicdraw.ui.actions.MainActionsVisitor
-
visit
public void visit(com.nomagic.magicdraw.uml.symbols.actions.ChangeFontAction action)
- Specified by:
visit
in interfacecom.nomagic.magicdraw.ui.actions.MainActionsVisitor
-
createComponent
protected java.awt.Component createComponent(com.nomagic.magicdraw.uml.symbols.actions.ChangeFontAction action)
-
visit
public void visit(com.nomagic.magicdraw.uml.symbols.actions.ChangeZoomAction category)
- Specified by:
visit
in interfacecom.nomagic.magicdraw.ui.actions.MainActionsVisitor
-
createComponent
protected java.awt.Component createComponent(com.nomagic.magicdraw.uml.symbols.actions.ChangeZoomAction category)
-
visit
public void visit(PropertyAction action)
- Specified by:
visit
in interfacecom.nomagic.magicdraw.ui.actions.MainActionsVisitor
-
createPropertyActionComponent
protected void createPropertyActionComponent(PropertyAction action)
-
getIconProvider
public com.nomagic.awt.ActionIconProvider getIconProvider()
-
setIconProvider
public void setIconProvider(com.nomagic.awt.ActionIconProvider iconProvider)
-
addToCurrentToolbar
protected abstract void addToCurrentToolbar(java.awt.Component c)
-
-