org.esa.beam.framework.ui.command
Class CommandMenuUtils

java.lang.Object
  extended by org.esa.beam.framework.ui.command.CommandMenuUtils

public class CommandMenuUtils
extends Object

The CommandMenuUtils is a helper class to build up menus.

Version:
$Revision$ $Date$
Author:
Norman Fomferra

Constructor Summary
protected CommandMenuUtils()
           
 
Method Summary
static int findMenuInsertPosition(JPopupMenu popupMenu, Command command, CommandManager manager)
          Finds the insert position of the given command within the popupMenu.
static void insertCommandMenuItem(Boolean sortChildren, JPopupMenu popupMenu, Command command, CommandManager manager)
          Inserts the given command at the end of the popupMenu.
static void insertCommandMenuItem(JMenu menu, Command command, CommandManager commandManager)
           
static void insertCommandMenuItem(JPopupMenu popupMenu, Command command, int pos)
          Inserts the given command to the popupMenu at the given position.
static void insertCommandMenuItem0(JPopupMenu popupMenu, Command command, CommandManager manager)
          Deprecated. since BEAM 4.10. Use insertCommandMenuItem(Boolean, JPopupMenu, Command, CommandManager) instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandMenuUtils

protected CommandMenuUtils()
Method Detail

insertCommandMenuItem0

public static void insertCommandMenuItem0(JPopupMenu popupMenu,
                                          Command command,
                                          CommandManager manager)
Deprecated. since BEAM 4.10. Use insertCommandMenuItem(Boolean, JPopupMenu, Command, CommandManager) instead.

Inserts the given command at the end of the popupMenu.

Parameters:
popupMenu - The popup menu to add the given command to.
command - The command to insert.
manager - The command manager.

insertCommandMenuItem

public static void insertCommandMenuItem(Boolean sortChildren,
                                         JPopupMenu popupMenu,
                                         Command command,
                                         CommandManager manager)
Inserts the given command at the end of the popupMenu.

Parameters:
sortChildren - Whether to sort the children alphabetically.
popupMenu - The popup menu to add the given command to.
command - The command to insert.
manager - The command manager.

findMenuInsertPosition

public static int findMenuInsertPosition(JPopupMenu popupMenu,
                                         Command command,
                                         CommandManager manager)
Finds the insert position of the given command within the popupMenu.

Parameters:
popupMenu - The popup menu.
command - The command to insert.
manager - The command manager.

insertCommandMenuItem

public static void insertCommandMenuItem(JPopupMenu popupMenu,
                                         Command command,
                                         int pos)
Inserts the given command to the popupMenu at the given position.

Parameters:
popupMenu - The popup menu to add the given command to.
command - The command to insert.
pos - the position where to insert the command.

insertCommandMenuItem

public static void insertCommandMenuItem(JMenu menu,
                                         Command command,
                                         CommandManager commandManager)


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