org.esa.beam.framework.ui.command
Interface CommandUIFactory

All Known Implementing Classes:
DefaultCommandUIFactory

public interface CommandUIFactory

The CommandUIFactory is used to create menu items and tool bar buttons for different types of a Command instance. It is also used to add context dependent menu items to a menu.


Method Summary
 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 addContextDependentMenuItems(java.lang.String, javax.swing.JPopupMenu) 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 addContextDependentMenuItems(java.lang.String, javax.swing.JPopupMenu) method.
 

Method Detail

getCommandManager

CommandManager getCommandManager()
Gets the command manager for this factory.

Returns:
the command manager, can be null.

setCommandManager

void setCommandManager(CommandManager commandManager)
Sets the command manager for this factory.

Parameters:
commandManager - the command manager, can be null.

isShowingDisabledMenuItems

boolean isShowingDisabledMenuItems()
Gets whether or not disabled menut items should be added to a menu in the addContextDependentMenuItems(java.lang.String, javax.swing.JPopupMenu) method.

Returns:
true if so

setShowingDisabledMenuItems

void setShowingDisabledMenuItems(boolean showingDisabledMenuItems)
Sets whether or not disabled menut items should be added to a menu in the addContextDependentMenuItems(java.lang.String, javax.swing.JPopupMenu) method.

Parameters:
showingDisabledMenuItems - true if so

createMenuItem

JMenuItem createMenuItem(ExecCommand command)
Creates a menu item for the given executable command.

Parameters:
command - the executable command, must not be null
Returns:
the menu item

createMenuItem

JMenuItem createMenuItem(ToolCommand command)
Creates a menu item for the given tool command. The method is not implemented.

Parameters:
command - the tool command, must not be null
Returns:
currently always null

createMenuItem

JMenuItem createMenuItem(CommandGroup commandGroup)
Creates a menu item for the given command group.

Parameters:
commandGroup - the command group, must not be null
Returns:
the menu item

createToolBarButton

AbstractButton createToolBarButton(ExecCommand command)
Creates a tool bar button for the given executable command.

Parameters:
command - the executable command, must not be null
Returns:
the tool bar button

createToolBarButton

AbstractButton createToolBarButton(ToolCommand command)
Creates a tool bar button for the given tool command.

Parameters:
command - the tool command, must not be null
Returns:
the tool bar button

createToolBarButton

AbstractButton createToolBarButton(CommandGroup commandGroup)
Creates a tool bar button for the given command group.

Parameters:
commandGroup - the command group, must not be null
Returns:
the tool bar button

addContextDependentMenuItems

JPopupMenu addContextDependentMenuItems(String context,
                                        JPopupMenu popup)
Adds menu items to the given popup menu. A command manager must have been set before this method can be used.

Parameters:
context - the context string
popup - the popup menu, must not be null
Returns:
the given popup menu, all context matching menu items added.
See Also:
setCommandManager(org.esa.beam.framework.ui.command.CommandManager)


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.