ilog.views.appframe.swing
Class IlvMenuBar

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 ilog.views.appframe.swing.IlvMenuBar
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, MenuElement

public class IlvMenuBar
extends JMenuBar

Defines menu bars that read their content from the settings.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JMenuBar
JMenuBar.AccessibleJMenuBar
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String DEFAULT_MENUBAR_NAME
          Default value of the "name" attribute of the settings element providing the settings of the menu bar.
static String MENU_SETTINGS_TYPE
          The type of the root settings element that provides the settings of an IlvMenuBar instance.
static String MENUITEM_SETTINGS_TYPE
          The type of the root settings element that provides the settings of a javax.swing.JMenuItem instance.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
IlvMenuBar()
          Constructs a new IlvMenuBar.
 
Method Summary
static Component AddActionItem(Action action, Container container, int index, IlvApplication application)
          Adds a new item to the specified container at the specified index.
static Component AddSeparator(Container container, int index)
          Adds a new separator within the specified container.
static JMenuItem CreateMenuItem(Action action, IlvApplication application)
          Creates a menu item for the specified action.
 IlvApplication getApplication()
          Returns the application associated with this menu bar.
 IlvSettings getSettings()
          Returns the settings that initialize the menu bar.
 IlvSettingsElement getSettingsElement()
          Returns the settings element that provides the settings for this menu bar.
 String getSettingsName()
          Gets the name that identifies the bar within the settings.
 IlvSettingsQuery getSettingsQuery()
          Returns the query that selects the settings element that defines the content of this menu bar.
 void setApplication(IlvApplication application)
          Sets the application of the menu bar.
 void setSettings(IlvSettings settings)
          Sets the settings that the menu bar uses to read its content.
 void setSettingsElement(IlvSettingsElement element)
          Forces the settings of the menu bar to be read and written from the specified settings element.
 void setSettingsName(String name)
          Sets the name that identifies the menu bar within the settings of the menu bar, set by invoking the method setSettings(ilog.views.appframe.settings.IlvSettings).
 void setSettingsQuery(IlvSettingsQuery query)
          Sets the query that selects the settings element that defines the content of this menu bar.
 
Methods inherited from class javax.swing.JMenuBar
add, addNotify, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getHelpMenu, getMargin, getMenu, getMenuCount, getSelectionModel, getSubElements, getUI, getUIClassID, isBorderPainted, isSelected, menuSelectionChanged, paintBorder, paramString, processKeyBinding, 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, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MENUBAR_NAME

public static final String DEFAULT_MENUBAR_NAME
Default value of the "name" attribute of the settings element providing the settings of the menu bar.

See Also:
Constant Field Values

MENU_SETTINGS_TYPE

public static final String MENU_SETTINGS_TYPE
The type of the root settings element that provides the settings of an IlvMenuBar instance.

See Also:
Constant Field Values

MENUITEM_SETTINGS_TYPE

public static final String MENUITEM_SETTINGS_TYPE
The type of the root settings element that provides the settings of a javax.swing.JMenuItem instance.

See Also:
Constant Field Values
Constructor Detail

IlvMenuBar

public IlvMenuBar()
Constructs a new IlvMenuBar.

Method Detail

getApplication

public IlvApplication getApplication()
Returns the application associated with this menu bar.

Returns:
The application of the menu bar.
See Also:
setApplication(ilog.views.appframe.IlvApplication)

setApplication

public void setApplication(IlvApplication application)
Sets the application of the menu bar.

Parameters:
application - The new application of the menu bar.
See Also:
getApplication()

getSettings

public IlvSettings getSettings()
Returns the settings that initialize the menu bar.

Returns:
The settings of the menu bar.

setSettings

public void setSettings(IlvSettings settings)
Sets the settings that the menu bar uses to read its content.

Parameters:
settings - The new settings of the menu bar.

getSettingsName

public String getSettingsName()
Gets the name that identifies the bar within the settings. If no name has been specified using the method setSettingsName(java.lang.String), the name of the default menu bar defined in the Application Framework settings will be returned.

Returns:
The settings name of the menu bar.

setSettingsName

public void setSettingsName(String name)
Sets the name that identifies the menu bar within the settings of the menu bar, set by invoking the method setSettings(ilog.views.appframe.settings.IlvSettings).

Parameters:
name - The new settings name of the menu bar.

setSettingsQuery

public void setSettingsQuery(IlvSettingsQuery query)
Sets the query that selects the settings element that defines the content of this menu bar.

Parameters:
query - The settings query.
See Also:
getSettingsQuery()

getSettingsQuery

public IlvSettingsQuery getSettingsQuery()
Returns the query that selects the settings element that defines the content of this menu bar.

Returns:
The settings query or null if no query has been specified using the method setSettingsQuery(ilog.views.appframe.settings.IlvSettingsQuery) or if no settings name has been defined using the method setSettingsName(java.lang.String).
See Also:
setSettingsQuery(ilog.views.appframe.settings.IlvSettingsQuery)

setSettingsElement

public void setSettingsElement(IlvSettingsElement element)
Forces the settings of the menu bar to be read and written from the specified settings element. This method overrides the settings element that is selected by default from the settings given by the method getSettings() with the query getSettingsQuery().

Parameters:
element - The settings element that provides the settings for the menu bar.
See Also:
getSettingsElement()

getSettingsElement

public IlvSettingsElement getSettingsElement()
Returns the settings element that provides the settings for this menu bar. If a settings element has been specified with the setSettingsElement(ilog.views.appframe.settings.IlvSettingsElement) method, it will be returned. Otherwise, the settings element is selected from the settings given by the getSettings() method, with the query returned by getSettingsQuery().

Returns:
the settings element or null if no settings element could be found.
See Also:
setSettingsElement(ilog.views.appframe.settings.IlvSettingsElement), getSettingsQuery()

AddActionItem

public static Component AddActionItem(Action action,
                                      Container container,
                                      int index,
                                      IlvApplication application)
Adds a new item to the specified container at the specified index. The newly created item is linked to the specified action.

Parameters:
action - The action of the menu item to create.
container - The container to create the new item in. This container can be a pop-up menu, a menu bar, or a JMenu instance.
index - the insertion index of the new component within its parent container. If it is equal to -1, the new component will be added at the last position in the children of the container.
application - The application used for internationalization services.
Returns:
The newly created item associated with the specified action.

AddSeparator

public static Component AddSeparator(Container container,
                                     int index)
Adds a new separator within the specified container.

Parameters:
container - The container to add a new separator to.
index - The insertion index of the newly created separator. If this index is equal to -1, the separator will be added after the last component child of the container.

CreateMenuItem

public static JMenuItem CreateMenuItem(Action action,
                                       IlvApplication application)
Creates a menu item for the specified action.

Parameters:
action - The action to associate the new menu item with.
application - The application used for internationalization services.
Returns:
The newly created menu item.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.