org.formaria.swt
Class MenuBar

java.lang.Object
  extended by org.eclipse.swt.widgets.Menu
      extended by org.formaria.swt.Menu
          extended by org.formaria.swt.MenuBar
All Implemented Interfaces:
Appender, Actionable, TextHolder

public class MenuBar
extends Menu
implements Appender

A wrapper for menus

Copyright (c) Formaria Ltd.,


Field Summary
protected  Project currentProject
           
protected  java.lang.String name
           
 
Fields inherited from class org.formaria.swt.Menu
cascadeMenu
 
Constructor Summary
MenuBar()
          Create a new menubar
 
Method Summary
 void addSeparator()
          Implemented from the Appender interface.
 void append(java.lang.Object o, java.lang.String name)
          Appends the object o to this item
protected  void checkSubclass()
          Suppress the subclassing exception
 MenuItem getLastCascademenu()
          Get the last cascade menu created
 java.lang.String getName()
          Get the name
 MenuItem getNewCascadeMenu()
          Get the last new cascade menu created
 java.lang.Object getObject(java.lang.Object menu, java.lang.String name)
          Get a child object by name
 java.lang.Object getObject(java.lang.String name)
          Get a child object by name
 void setAction(java.lang.Object action)
          Set an Action for the menu bar - does nothing
 void setName(java.lang.String name)
          Set the name of this object
 void setup()
          Do any final setup of the menu needed.
 
Methods inherited from class org.formaria.swt.Menu
getCascadeMenu, getText, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

currentProject

protected Project currentProject
Constructor Detail

MenuBar

public MenuBar()
Create a new menubar

Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception

Overrides:
checkSubclass in class Menu

getNewCascadeMenu

public MenuItem getNewCascadeMenu()
Get the last new cascade menu created

Returns:
the last new cascade menu created

getLastCascademenu

public MenuItem getLastCascademenu()
Get the last cascade menu created

Returns:
the last cascade menu created

setAction

public void setAction(java.lang.Object action)
Set an Action for the menu bar - does nothing

Specified by:
setAction in interface Appender
Specified by:
setAction in interface Actionable
Overrides:
setAction in class Menu
Parameters:
action - the action object

setup

public void setup()
Do any final setup of the menu needed. If there is an existing menu bar in the application the menus of this menu bar are attached to the existing menu bar, unless the menu bar name matches that of the exitsing menu bar, in which case the old menu bar is replaced by this one. The menu bar is normally named by the name of the page within which it was declared.

Specified by:
setup in interface Appender
Overrides:
setup in class Menu

append

public void append(java.lang.Object o,
                   java.lang.String name)
Appends the object o to this item

Specified by:
append in interface Appender
Overrides:
append in class Menu
Parameters:
o - the appended item
name - the name of the menu bar

addSeparator

public void addSeparator()
Implemented from the Appender interface. No separator needed at this level.

Specified by:
addSeparator in interface Appender
Overrides:
addSeparator in class Menu

getObject

public java.lang.Object getObject(java.lang.String name)
Get a child object by name

Specified by:
getObject in interface Appender
Overrides:
getObject in class Menu
Parameters:
name - the name of the menu bar
Returns:
the child

getObject

public java.lang.Object getObject(java.lang.Object menu,
                                  java.lang.String name)
Get a child object by name

Parameters:
meu - the menu or submenu to be searched
name - the name of the menu bar
Returns:
the child

setName

public void setName(java.lang.String name)
Set the name of this object

Specified by:
setName in interface Appender
Overrides:
setName in class Menu
Parameters:
name - the item name

getName

public java.lang.String getName()
Get the name

Returns:
the name