LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingMenuBar

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingMenuBar
All Implemented Interfaces:
LyActionListener, LyEventTransmitter, LyIsIdleInterface, LyGraphicalComponent, LyGraphicalMenuBar, LyViewComponent, LyFreeInterface, LySetIdleInterface, LySwingComponent

public class LySwingMenuBar
extends LySwingObject
implements LyGraphicalMenuBar, LyActionListener, LyEventTransmitter, LySetIdleInterface, LyIsIdleInterface

This class implements the MenuBar object (as described in the dtd) for swing viewer.

A menu bar allows to display a set of menus. It can be displayed in a main window of a Leonardi application. The menu bars are available only with the heavy client (Swing and SWT) viewers.

See Also:
LyMenuBar

Nested Class Summary
 class LySwingMenuBar.MenuBarBorder
          This class defines MS-Windows style menu bar borders.
 
Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingMenuBar(LyMenuBar menuBar)
          Class constructor of a Menu bar for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 void addMenu(LyMenu menu, int pos)
          Adds the specified menu at the end of this menu bar.
 void addMenu(java.lang.Object menu)
          Adds a menu in this menu bar.
 java.lang.Object createMenuBar()
          Creates the swing component used to display this menu bar and initializes its font and border.
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 java.lang.Object getMenuBar()
          Gets the menu bar component.
 LySelectionTransmitter getSelectionTransmitter()
          This menu bar doesn't handle selection events, so it has no selection transmitter.
 void initialize()
          Initializes the menuBar.
 boolean isIdle()
          Indictates whether this menu bar is idle or not.
 void removeMenu(LyMenu menu)
          (non-Javadoc).
 void removeMenu(java.lang.Object menu)
          Removes the specified menu from the menu bar.
 void resetContent()
          Resets the content of the menu bar and refreshes its view.
 void setContent()
          Adds the menu items to this menu bar and registers their action listeners.
 void setIdle(boolean idle)
          Sets the idle status of this menu bar.
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getComponent, getDefaultFrame
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, free, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
free, getViewComponent
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LySwingMenuBar

public LySwingMenuBar(LyMenuBar menuBar)
Class constructor of a Menu bar for the Swing target.

Parameters:
menuBar - a MENU_BAR component defined for every type of view targets. This menu bar is initialized for the swing view.
Method Detail

initialize

public void initialize()
Initializes the menuBar.


setContent

public void setContent()
Adds the menu items to this menu bar and registers their action listeners.


createMenuBar

public java.lang.Object createMenuBar()
Creates the swing component used to display this menu bar and initializes its font and border.

Returns:
the new menu bar component

addMenu

public void addMenu(LyMenu menu,
                    int pos)
Adds the specified menu at the end of this menu bar.

Specified by:
addMenu in interface LyGraphicalMenuBar
Parameters:
menu - the menu to add
pos - this position is not used in this implementation
See Also:
addMenu(Object), LyGraphicalMenuBar.addMenu(leon.view.LyMenu, int)

removeMenu

public void removeMenu(LyMenu menu)
(non-Javadoc).

Specified by:
removeMenu in interface LyGraphicalMenuBar
Parameters:
menu - The menus to remove to menus list.
See Also:
leon.view.graphic.LyGraphicalMenuBar#removeComponent(leon.view.LyComponent)

actionPerformed

public void actionPerformed(LyActionEvent actionEvent)
(non-Javadoc).

Specified by:
actionPerformed in interface LyActionListener
See Also:
LyActionListener.actionPerformed(leon.view.event.LyActionEvent)

getMenuBar

public java.lang.Object getMenuBar()
Gets the menu bar component.

Returns:
the component for the menu bar

getActionTransmitter

public LyActionTransmitter getActionTransmitter()
(non-Javadoc).

Specified by:
getActionTransmitter in interface LyEventTransmitter
Returns:
the action transmitter of this component
See Also:
LyEventTransmitter.getActionTransmitter()

getSelectionTransmitter

public LySelectionTransmitter getSelectionTransmitter()
This menu bar doesn't handle selection events, so it has no selection transmitter.

Specified by:
getSelectionTransmitter in interface LyEventTransmitter
Returns:
null
See Also:
LyEventTransmitter.getSelectionTransmitter()

isIdle

public boolean isIdle()
Indictates whether this menu bar is idle or not. The idled menu bar does not dynamically refresh its menu contents in views.

Specified by:
isIdle in interface LyIsIdleInterface
Returns:
idle status
See Also:
setIdle(boolean), LyIsIdleInterface.isIdle()

setIdle

public void setIdle(boolean idle)
Sets the idle status of this menu bar. If the menu bar is not idle, the view is refreshed.

Specified by:
setIdle in interface LySetIdleInterface
Parameters:
idle - the new idle status
See Also:
isIdle(), LySetIdleInterface.setIdle(boolean)

addMenu

public void addMenu(java.lang.Object menu)
Adds a menu in this menu bar.

Parameters:
menu - the menu to add in this menu bar
See Also:
JMenuBar.add(javax.swing.JMenu)

removeMenu

public void removeMenu(java.lang.Object menu)
Removes the specified menu from the menu bar.

Parameters:
menu - the menu to remove
See Also:
Container.remove(java.awt.Component)

resetContent

public void resetContent()
Resets the content of the menu bar and refreshes its view. This method is usually called after changing the menu bar idle status.


(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com