java.lang.Object | +--org.eclipse.swt.widgets.Widget | +--org.eclipse.swt.widgets.Menu
Safe:
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values
Menu(Control parent)
Menu(Decorations parent,
int style)
Decorations) and a style value
describing its behavior and appearance.
Menu(Menu parentMenu)
Menu) and sets the style
for the instance so that the instance will be a drop-down
menu on the given parent's parent.
Menu(MenuItem parentItem)
MenuItem) and sets the style
for the instance so that the instance will be a drop-down
menu on the given parent's parent menu.
void
addHelpListener(HelpListener listener)
HelpListener interface.
void
addMenuListener(MenuListener listener)
MenuListener
interface.
(package private) void
destroyWidget()
MenuItem
getDefaultItem()
MenuItem
getItem(int index)
MenuItem
getParentItem()
MenuItem or null when the receiver is a
root.
Menu
getParentMenu()
Menu or null when the receiver is a
root.
int
indexOf(MenuItem item)
boolean
isEnabled()
true if the receiver is enabled and all
of the receiver's ancestors are enabled, and false
otherwise.
boolean
isVisible()
true if the receiver is visible and all
of the receiver's ancestors are visible and false
otherwise.
void
removeHelpListener(HelpListener listener)
void
removeMenuListener(MenuListener listener)
void
setDefaultItem(MenuItem item)
null.
void
setEnabled(boolean enabled)
true,
and disables it otherwise.
void
setLocation(int x,
int y)
void
setLocation(Point location)
void
setVisible(boolean visible)
true,
and marks it invisible otherwise.
addDisposeListener, addListener, checkBits, checkOrientation, checkParent, checkSubclass, checkWidget, dispose, error, filters, getData, getData, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, toString, wcsToMbcs, wcsToMbcs
public int handle
int x
int y
int hwndCB
int id0
int id1
boolean hasLocation
MenuItem cascade
Decorations parent
static final int ID_PPC
static final int ID_SPMM
static final int ID_SPBM
static final int ID_SPMB
static final int ID_SPBB
static final int ID_SPSOFTKEY0
static final int ID_SPSOFTKEY1
public Menu(Control parent)
parent - a control which will be the parent of the new instance (cannot be null)SWT.POP_UP,
Widget.checkSubclass(),
Widget.getStyle()public Menu(Decorations parent, int style)
Decorations) and a style value
describing its behavior and appearance.
The style value is either one of the style constants defined in
class SWT which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int "|" operator) two or more
of those SWT style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent - a decorations control which will be the parent of the new instance (cannot be null)style - the style of menu to constructSWT.BAR,
SWT.DROP_DOWN,
SWT.POP_UP,
Widget.checkSubclass(),
Widget.getStyle()public Menu(Menu parentMenu)
Menu) and sets the style
for the instance so that the instance will be a drop-down
menu on the given parent's parent.
SWT.DROP_DOWN,
Widget.checkSubclass(),
Widget.getStyle()public Menu(MenuItem parentItem)
MenuItem) and sets the style
for the instance so that the instance will be a drop-down
menu on the given parent's parent menu.
SWT.DROP_DOWN,
Widget.checkSubclass(),
Widget.getStyle()Menu(Decorations parent, int style, int handle)
void _setVisible(boolean visible)
public void addHelpListener(HelpListener listener)
HelpListener interface.
listener - the listener which should be notifiedHelpListener,
removeHelpListener(org.eclipse.swt.events.HelpListener)public void addMenuListener(MenuListener listener)
MenuListener
interface.
listener - the listener which should be notifiedMenuListener,
removeMenuListener(org.eclipse.swt.events.MenuListener)static Control checkNull(Control control)
static Menu checkNull(Menu menu)
static MenuItem checkNull(MenuItem item)
static int checkStyle(int style)
void createHandle()
void createItem(MenuItem item, int index)
void createWidget()
int defaultBackground()
int defaultForeground()
void destroyAccelerators()
void destroyItem(MenuItem item)
void destroyWidget()
Widget
When a widget is destroyed in the operating system, its
descendents are also destroyed by the operating system.
This means that it is only necessary to call destroyWidget
on the root of the widget tree.
This method is called after releaseWidget.
destroyWidget in class Widgetpublic MenuItem getDefaultItem()
public Display getDisplay()
getDisplay in class Widgetpublic boolean getEnabled()
true if the receiver is enabled, and
false otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.
isEnabled()public MenuItem getItem(int index)
index - the index of the item to return
public int getItemCount()
public MenuItem[] getItems()
MenuItems which are the items
in the receiver.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
int GetMenuItemCount(int handle)
String getNameText()
getNameText in class Widgetpublic Decorations getParent()
Decorations.
public MenuItem getParentItem()
MenuItem or null when the receiver is a
root.
public Menu getParentMenu()
Menu or null when the receiver is a
root.
public Shell getShell()
getParent()public boolean getVisible()
true if the receiver is visible, and
false otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
public int indexOf(MenuItem item)
item - the search item
public boolean isEnabled()
true if the receiver is enabled and all
of the receiver's ancestors are enabled, and false
otherwise. A disabled control is typically not selectable from the
user interface and draws with an inactive or "grayed" look.
getEnabled()public boolean isVisible()
true if the receiver is visible and all
of the receiver's ancestors are visible and false
otherwise.
getVisible()void redraw()
void releaseChild()
releaseChild in class Widgetvoid releaseHandle()
releaseHandle in class Widgetvoid releaseWidget()
releaseWidget in class Widgetpublic void removeHelpListener(HelpListener listener)
listener - the listener which should be notifiedHelpListener,
addHelpListener(org.eclipse.swt.events.HelpListener)public void removeMenuListener(MenuListener listener)
listener - the listener which should be notifiedMenuListener,
addMenuListener(org.eclipse.swt.events.MenuListener)public void setDefaultItem(MenuItem item)
null.
item - the default menu item or nullpublic void setEnabled(boolean enabled)
true,
and disables it otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.
enabled - the new enabled statepublic void setLocation(int x, int y)
Note: This is different from most widgets where the location of the widget is relative to the parent.
x - the new x coordinate for the receivery - the new y coordinate for the receiverpublic void setLocation(Point location)
Note: This is different from most widgets where the location of the widget is relative to the parent.
location - the new location for the receiverpublic void setVisible(boolean visible)
true,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
visible - the new visibility statevoid update()