com.quadrique.jbuildingblocks.gui
Class MenuBarBase

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JMenuBar
                  extended by com.quadrique.jbuildingblocks.gui.MenuBarBase
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, MenuElement

public class MenuBarBase
extends JMenuBar

A generic menu bar

Author:
Hervé Rivere
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MenuBarBase()
          Constructor
 
Method Summary
 JMenuItem addAction(JMenu zMenu, ActionBase zAction)
           
 void addHelpContentMenuItem(JMenu zMenu, String zMenuItemText, String zMenuItemToolTip, int zMenuItemMnemonic, KeyStroke zMenuItemAccelerator, String zMenuItemIconFileName)
          This method add a "Help Contents" item to the given menu.
 void addHelpWhatIsThisMenuItem(JMenu zMenu, String zMenuItemText, String zMenuItemToolTip, int zMenuItemMnemonic, KeyStroke zMenuItemAccelerator, String zMenuItemIconFileName)
          This method add a "Help What's This ?" item to the given menu.
 JMenu addMenu(String zText, int zMnemonic)
           
 JMenu addMenu(String zText, int zMnemonic, ActionBase[] zActions)
          add a menu with a list of menu items each menu item is associated to a given action
 JMenu addMenu(String zText, int zMnemonic, String zIconFileName)
           
 
Methods inherited from class javax.swing.JMenuBar
add, addNotify, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getHelpMenu, getMargin, getMenu, getMenuCount, getSelectionModel, getSubElements, getUI, getUIClassID, isBorderPainted, isSelected, menuSelectionChanged, processKeyEvent, processMouseEvent, removeNotify, setBorderPainted, setHelpMenu, setMargin, setSelected, setSelectionModel, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuBarBase

public MenuBarBase()
            throws Exception
Constructor

Throws:
Exception - if an error occurs
Method Detail

addMenu

public JMenu addMenu(String zText,
                     int zMnemonic)
              throws Exception
Parameters:
zText - the text to use for the tile of the menu (e.g. "File")
zMnemonic - the menmonic to use for the menu title (e.g. KeyEvent.VK_F)
Returns:
the newly created JMenu
Throws:
Exception - if an error occurs

addMenu

public JMenu addMenu(String zText,
                     int zMnemonic,
                     String zIconFileName)
              throws Exception
Parameters:
zText - the text to use for the tile of the menu (e.g. "File")
zMnemonic - the menmonic to use for the menu title (e.g. KeyEvent.VK_F)
zIconFileName - the file name for the icon
Returns:
the newly created JMenu
Throws:
Exception - if an error occurs

addAction

public JMenuItem addAction(JMenu zMenu,
                           ActionBase zAction)
                    throws Exception
Parameters:
zMenu - the menu
zAction - the action to add to the menu
Returns:
the newly created menuitem associated to the action
Throws:
Exception - if an error occurs

addHelpContentMenuItem

public void addHelpContentMenuItem(JMenu zMenu,
                                   String zMenuItemText,
                                   String zMenuItemToolTip,
                                   int zMenuItemMnemonic,
                                   KeyStroke zMenuItemAccelerator,
                                   String zMenuItemIconFileName)
                            throws Exception
This method add a "Help Contents" item to the given menu. Upon activation, the online help window is displayed and the default global topic is displayed

Parameters:
zMenu - the menu
zMenuItemText - the text to use for the item
zMenuItemToolTip - the tooltip to use for the item
zMenuItemMnemonic - the menmonic to use (e.g. KeyEvent.VK_P for the letter 'P')
zMenuItemAccelerator - the keystroke to use as an accelerator (KeyStroke.getKeyStroke(KeyEvent.VK_F1,InputEvent.CTRL_MASK) for Control-F1)
zMenuItemIconFileName - the icon file name (use null if no icon is to be associated to the item)
Throws:
Exception - if an error occurs

addHelpWhatIsThisMenuItem

public void addHelpWhatIsThisMenuItem(JMenu zMenu,
                                      String zMenuItemText,
                                      String zMenuItemToolTip,
                                      int zMenuItemMnemonic,
                                      KeyStroke zMenuItemAccelerator,
                                      String zMenuItemIconFileName)
                               throws Exception
This method add a "Help What's This ?" item to the given menu. Upon activation, the cursor is modified and upon selection of a compoent, the corresponding context sensitive online help is displayed

Parameters:
zMenu - the menu
zMenuItemText - the text to use for the item
zMenuItemToolTip - the tooltip to use for the item
zMenuItemMnemonic - the menmonic to use (e.g. KeyEvent.VK_P for the letter 'P')
zMenuItemAccelerator - the keystroke to use as an accelerator (KeyStroke.getKeyStroke(KeyEvent.VK_F1,InputEvent.CTRL_MASK) for Control-F1)
zMenuItemIconFileName - the icon file name (use null if no icon is to be associated to the item)
Throws:
Exception - if an error occurs

addMenu

public JMenu addMenu(String zText,
                     int zMnemonic,
                     ActionBase[] zActions)
              throws Exception
add a menu with a list of menu items each menu item is associated to a given action

Parameters:
zText - the text of the menu title (e.g. "File")
zMnemonic - the menmonic to use for the menu title (e.g. KeyEvent.VK_F)
zActions - an array of action, one for each menu item. Use null in the arry to incoporate a separator.
Returns:
the newly created menu
Throws:
Exception - if an error occurs


Copyright © 2001-2009 Quadrique Corporation. All Rights Reserved.