com.levigo.util.swing.action
Interface MenuComponentFactory

All Known Subinterfaces:
NamedMenuComponentFactory
All Known Implementing Classes:
BasicMenuComponentFactory, DefaultMenuComponentFactory

public interface MenuComponentFactory

Interface for the menu factory. This interface has to be implemented in the menu factory. In the system can be more than one menu factory but just one instance of each.

Version:
$Data$ $Revision$
Author:
l.boureanu@levigo.de

Field Summary
static String ACTIONS
          Parameter of actions in the property file
static String CONTEXT_MENU_ACTIONS
          Parameter of contextmenu actions in the property file
static String MENU_ACTIONS
          Parameter of menu actions in the property file
static String TOOLBAR_ACTIONS
          Parameter of toolbar actions in the property file
 
Method Summary
 Collection<String> getActions(String key)
          Create a collection of all currently available action names(!) for the given template key.
 Collection<String> getActionsForType(String key, String type)
          Create a collection of all currently available action names(!) for the given template key and action structure type.
 Collection<CommandAction> getCommandActions(String key, Context context)
          Create all currently available command actions for the given template key.
 JPopupMenu getContextMenu(String key, Context context)
          Create a JPopupMenu for the given template key or context name.
 JPopupMenu getContextMenu(String key, Context context, Action[] additionalActions)
          Create a JPopupMenu for the given template key or context name.
 JMenu getMenu(String key, Context context)
          Create a JMenu for the given template key or context name.
 JMenu getMenu(String key, Context context, Action[] additionalActions)
          Create a JMenu for the given template key or context name.
 JMenuBar getMenuBar(String key, Context context)
          Create a JMenuBar for the given template key or context name.
 JToolBar getToolbar(String key, Context context)
          Create a JToolBar for the given template key or context name.
 JToolBar getToolbar(String key, Context context, Action[] additionalActions)
          Create a JToolbar for the given template key or context name.
 

Field Detail

ACTIONS

static final String ACTIONS
Parameter of actions in the property file

See Also:
Constant Field Values

MENU_ACTIONS

static final String MENU_ACTIONS
Parameter of menu actions in the property file

See Also:
Constant Field Values

CONTEXT_MENU_ACTIONS

static final String CONTEXT_MENU_ACTIONS
Parameter of contextmenu actions in the property file

See Also:
Constant Field Values

TOOLBAR_ACTIONS

static final String TOOLBAR_ACTIONS
Parameter of toolbar actions in the property file

See Also:
Constant Field Values
Method Detail

getToolbar

JToolBar getToolbar(String key,
                    Context context)
Create a JToolBar for the given template key or context name.

Parameters:
key - of the toolbar which should be created
context - for the actions in the toolbar. Actions in the toolbar belong then in this context.

Returns:
Created toolbar
See Also:
JToolBar

getToolbar

JToolBar getToolbar(String key,
                    Context context,
                    Action[] additionalActions)
Create a JToolbar for the given template key or context name. Additional actions NOT defined in the properties file can be specified with the parameter additionalActions.

See Also:
getToolbar(String, Context)

getMenu

JMenu getMenu(String key,
              Context context)
Create a JMenu for the given template key or context name.

Note:The JMenuBar is created outside of this factory. The created menus can be added in the JMenuBar!

Parameters:
key - of the menu which should be created
context - for the actions in the menu. Actions in the menu belong then in this context.

Returns:
Created menu
See Also:
JMenu, JMenuBar

getMenu

JMenu getMenu(String key,
              Context context,
              Action[] additionalActions)
Create a JMenu for the given template key or context name. Additional actions NOT defined in the properties file can be specified with the parameter additionalActions.

See Also:
getMenu(String, Context)

getContextMenu

JPopupMenu getContextMenu(String key,
                          Context context)
Create a JPopupMenu for the given template key or context name.

Parameters:
key - of the context menu which should be created
context - for the actions in the context menu. Actions in the context menu belong then in this context.

Returns:
Created context menu
See Also:
JPopupMenu

getActions

Collection<String> getActions(String key)
Create a collection of all currently available action names(!) for the given template key. The returning object is just a collection of action names (as Strings), not the real action objects. This method is a shortcut for getActionsForType(key, MenuComponentFactory .ACTIONS);

Parameters:
key - template key
Returns:
Collection of the actions names
See Also:
getActionsForType(String,String)

getActionsForType

Collection<String> getActionsForType(String key,
                                     String type)
Create a collection of all currently available action names(!) for the given template key and action structure type. The returning object is just a collection of action names (as Strings), not the real action objects.

Parameters:
key - template key
type - structure type like MenuComponentFactoryACTIONS, MenuComponentFactoryCONTEXT_MENU_ACTIONS,MenuComponentFactoryMENU_ACTIONS,MenuComponentFactoryTOOLBAR_ACTIONS
Returns:
Collection of the actions names
See Also:
getActions(String)

getCommandActions

Collection<CommandAction> getCommandActions(String key,
                                            Context context)
Create all currently available command actions for the given template key.

Parameters:
context - the returned actions refer to this context.
key - template key for action structure
Returns:
Collection of created and available command actions for the given template key
See Also:
getActions(String)

getContextMenu

JPopupMenu getContextMenu(String key,
                          Context context,
                          Action[] additionalActions)
Create a JPopupMenu for the given template key or context name. Additional actions NOT defined in the properties file can be specified with the parameter additionalActions.

See Also:
getContextMenu(String, Context)

getMenuBar

JMenuBar getMenuBar(String key,
                    Context context)
Create a JMenuBar for the given template key or context name.

Parameters:
key -
context -


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.