net.xoetrope.swt
Class XMenuBar

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Menu
          extended by net.xoetrope.swt.XMenuBar
All Implemented Interfaces:
XAppender

public class XMenuBar
extends org.eclipse.swt.widgets.Menu
implements XAppender

A wrapper for menus

Copyright (c) Xoetrope Ltd., 1998-2004


Field Summary
protected  XProject currentProject
           
protected  java.lang.String name
           
 
Fields inherited from class org.eclipse.swt.widgets.Menu
handle
 
Constructor Summary
XMenuBar()
          Create a new menubar
 
Method Summary
 void addSeparator()
          Implemented from the XAppender 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
 org.eclipse.swt.widgets.MenuItem getLastCascademenu()
          Get the last cascade menu created
 java.lang.String getName()
          Get the name
 org.eclipse.swt.widgets.MenuItem getNewCascadeMenu()
          Get the last new cascade menu created
 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.eclipse.swt.widgets.Menu
addHelpListener, addMenuListener, getDefaultItem, getEnabled, getItem, getItemCount, getItems, getParent, getParentItem, getParentMenu, getShell, getVisible, indexOf, isEnabled, isVisible, removeHelpListener, removeMenuListener, setDefaultItem, setEnabled, setLocation, setLocation, setVisible
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

currentProject

protected XProject currentProject
Constructor Detail

XMenuBar

public XMenuBar()
Create a new menubar

Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception

Overrides:
checkSubclass in class org.eclipse.swt.widgets.Widget

getNewCascadeMenu

public org.eclipse.swt.widgets.MenuItem getNewCascadeMenu()
Get the last new cascade menu created

Returns:
the last new cascade menu created

getLastCascademenu

public org.eclipse.swt.widgets.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 XAppender
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 XAppender

append

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

Specified by:
append in interface XAppender
Parameters:
o - the appended item
name - the name of the menu bar

addSeparator

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

Specified by:
addSeparator in interface XAppender

getObject

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

Specified by:
getObject in interface XAppender
Parameters:
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 XAppender
Parameters:
name - the item name

getName

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

Returns:
the name