com.tensegrity.gui.swt.control
Class SwtMenuBar

java.lang.Object
  extended bycom.tensegrity.gui.swt.control.SwtMenuBar
All Implemented Interfaces:
BasicComponent, Evaluable, MenuBar

public class SwtMenuBar
extends java.lang.Object
implements MenuBar

This class provides a default implementation of the MenuBar interface to be used in a SWT context. Since the SWT API specifies that the class Menu is not intended to be subclassed, a Menu instance is herein encapsulated. One can access it through the getSwtMenuBar() method.

Version:
$Id: SwtMenuBar.java,v 1.3 2004/09/28 12:00:44 SebastienGuyon Exp $
Author:
S�bastien Guyon

Constructor Summary
SwtMenuBar(org.eclipse.swt.widgets.Shell shell)
           Default constructor which creates the internal Menu instance.
 
Method Summary
 void addMenu(Menu menu)
          As a container for Menu instances all implementation must provide an entry point to add these.
 void applyEvList()
          Tells the component to apply its UIItemEvaluationList.
 int getHeight()
          Returns the height of the component in pixels.
 BasicComponent getParentComponent()
          Returns the parent Component of this instance.
 org.eclipse.swt.widgets.Menu getSwtMenuBar()
          This method provides access to the internal Menu instance held within this class.
 int getWidth()
          Returns the width of the component in pixels.
 void installEvList()
          Tells the component to setup its internal state.
 void repaint()
          Triggers a repaint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwtMenuBar

public SwtMenuBar(org.eclipse.swt.widgets.Shell shell)

Default constructor which creates the internal Menu instance.

Parameters:
shell - a menu which will be the parent of the internal Menu instance (cannot be null)
Method Detail

addMenu

public void addMenu(Menu menu)
Description copied from interface: MenuBar
As a container for Menu instances all implementation must provide an entry point to add these. This method adds the parameter Menu to this MenuBar.

Specified by:
addMenu in interface MenuBar
Parameters:
menu - the Menu to add to this MenuBar.
See Also:
MenuBar.addMenu(com.tensegrity.gui.component.Menu)

getHeight

public int getHeight()
Description copied from interface: BasicComponent
Returns the height of the component in pixels.

Specified by:
getHeight in interface BasicComponent
Returns:
the height of the component in pixels.
See Also:
BasicComponent.getHeight()

getParentComponent

public BasicComponent getParentComponent()
Description copied from interface: BasicComponent
Returns the parent Component of this instance.

Specified by:
getParentComponent in interface BasicComponent
Returns:
the parent component or null if no parent exists.
See Also:
BasicComponent.getParentComponent()

getWidth

public int getWidth()
Description copied from interface: BasicComponent
Returns the width of the component in pixels.

Specified by:
getWidth in interface BasicComponent
Returns:
the width of the component in pixels.
See Also:
BasicComponent.getWidth()

repaint

public void repaint()
Description copied from interface: BasicComponent
Triggers a repaint.

Specified by:
repaint in interface BasicComponent
See Also:
BasicComponent.repaint()

applyEvList

public void applyEvList()
Description copied from interface: Evaluable
Tells the component to apply its UIItemEvaluationList.

Specified by:
applyEvList in interface Evaluable
See Also:
Evaluable.applyEvList()

installEvList

public void installEvList()
Description copied from interface: Evaluable
Tells the component to setup its internal state.

Specified by:
installEvList in interface Evaluable
See Also:
Evaluable.installEvList()

getSwtMenuBar

public final org.eclipse.swt.widgets.Menu getSwtMenuBar()
This method provides access to the internal Menu instance held within this class.

Returns:
Returns the internal SWT Menu.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.