net.xoetrope.swt
Class XMenu

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Menu
          extended by net.xoetrope.swt.XMenu
All Implemented Interfaces:
XActionable, XAppender, XTextHolder

public class XMenu
extends org.eclipse.swt.widgets.Menu
implements XTextHolder, XAppender, XActionable

A wrapper for menus

Copyright (c) Xoetrope Ltd., 1998-2004


Field Summary
protected  org.eclipse.swt.widgets.MenuItem cascadeMenu
           
 
Fields inherited from class org.eclipse.swt.widgets.Menu
handle
 
Constructor Summary
XMenu(XMenuBar parent)
          Create a new menu
 
Method Summary
 void addSeparator()
          Adds a separator to this item.
 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 getCascadeMenu()
          Get the cascade menu
 java.lang.Object getObject(java.lang.String name)
          Get a child object by name
 java.lang.String getText()
          Get the text/label of a component
 void setAction(java.lang.Object instance)
          Set an action object
 void setName(java.lang.String name)
          Set the name of this object
 void setText(java.lang.String text)
          Set the text/label of a component
 void setup()
          Do any final setup 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

cascadeMenu

protected org.eclipse.swt.widgets.MenuItem cascadeMenu
Constructor Detail

XMenu

public XMenu(XMenuBar parent)
Create a new menu

Parameters:
parent - parent MenuBar
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception

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

getCascadeMenu

public org.eclipse.swt.widgets.MenuItem getCascadeMenu()
Get the cascade menu

Returns:
the cascade menu

setAction

public void setAction(java.lang.Object instance)
Set an action object

Specified by:
setAction in interface XActionable
Specified by:
setAction in interface XAppender
Parameters:
instance - the action object

setup

public void setup()
Do any final setup needed

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

addSeparator

public void addSeparator()
Adds a separator to this item.

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 item name
Returns:
the child item

setText

public void setText(java.lang.String text)
Set the text/label of a component

Specified by:
setText in interface XTextHolder
Parameters:
text - the new text

getText

public java.lang.String getText()
Get the text/label of a component

Specified by:
getText in interface XTextHolder
Returns:
the component's text

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