public class DefaultCommandUIFactory extends Object implements CommandUIFactory
DefaultCommandUIFactory
is used to create menu items and tool bar buttons for a given
Command
. It is also used to add context dependent menu items to a menu.Constructor and Description |
---|
DefaultCommandUIFactory()
Constructs a new factory.
|
Modifier and Type | Method and Description |
---|---|
JPopupMenu |
addContextDependentMenuItems(String context,
JPopupMenu popup)
Adds menu items to the given popup menu.
|
JMenuItem |
createMenuItem(CommandGroup commandGroup)
Creates a menu item for the given command group.
|
JMenuItem |
createMenuItem(ExecCommand command)
Creates a menu item for the given executable command.
|
JMenuItem |
createMenuItem(ToolCommand command)
Creates a menu item for the given tool command.
|
AbstractButton |
createToolBarButton(CommandGroup commandGroup)
Creates a tool bar button for the given command group.
|
AbstractButton |
createToolBarButton(ExecCommand command)
Creates a tool bar button for the given executable command.
|
AbstractButton |
createToolBarButton(ToolCommand command)
Creates a tool bar button for the given tool command.
|
CommandManager |
getCommandManager()
Gets the command manager for this factory.
|
boolean |
isShowingDisabledMenuItems()
Gets whether or not disabled menut items should be added to a menu in the
method. |
void |
setCommandManager(CommandManager commandManager)
Sets the command manager for this factory.
|
void |
setShowingDisabledMenuItems(boolean showingDisabledMenuItems)
Sets whether or not disabled menut items should be added to a menu in the
method. |
public DefaultCommandUIFactory()
public CommandManager getCommandManager()
getCommandManager
in interface CommandUIFactory
null
.public void setCommandManager(CommandManager commandManager)
setCommandManager
in interface CommandUIFactory
commandManager
- the command manager, can be null
.public boolean isShowingDisabledMenuItems()
addContextDependentMenuItems(java.lang.String, javax.swing.JPopupMenu)
method.isShowingDisabledMenuItems
in interface CommandUIFactory
true
if sopublic void setShowingDisabledMenuItems(boolean showingDisabledMenuItems)
addContextDependentMenuItems(java.lang.String, javax.swing.JPopupMenu)
method.setShowingDisabledMenuItems
in interface CommandUIFactory
showingDisabledMenuItems
- true
if sopublic JMenuItem createMenuItem(ExecCommand command)
createMenuItem
in interface CommandUIFactory
command
- the executable command, must not be null
public JMenuItem createMenuItem(ToolCommand command)
createMenuItem
in interface CommandUIFactory
command
- the tool command, must not be null
null
public JMenuItem createMenuItem(CommandGroup commandGroup)
createMenuItem
in interface CommandUIFactory
commandGroup
- the command group, must not be null
public AbstractButton createToolBarButton(ExecCommand command)
createToolBarButton
in interface CommandUIFactory
command
- the executable command, must not be null
public AbstractButton createToolBarButton(ToolCommand command)
createToolBarButton
in interface CommandUIFactory
command
- the tool command, must not be null
public AbstractButton createToolBarButton(CommandGroup commandGroup)
createToolBarButton
in interface CommandUIFactory
commandGroup
- the command group, must not be null
public JPopupMenu addContextDependentMenuItems(String context, JPopupMenu popup)
addContextDependentMenuItems
in interface CommandUIFactory
context
- the context stringpopup
- the popup menu, must not be null
setCommandManager(org.esa.beam.framework.ui.command.CommandManager)
Copyright © 2002–2014 Brockmann Consult GmbH. All rights reserved.