Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: awt ::

interface XMenu
Description
specifies a simple menu.

Methods' Summary
addMenuListener adds the specified menu listener to receive events from this menu.  
removeMenuListener removes the specified menu listener so that it no longer receives events from this menu.  
insertItem inserts an item into the menu.  
removeItem removes one or more items from the menu.  
clear removes all items from the menu.  
getItemCount returns the number of items in the menu.  
getItemId returns the ID of the item at the specified position.  
getItemPos returns the position of the item with the specified ID.  
getItemType retrieves the type of the menu item.  
enableItem enables or disables the menu item.  
isItemEnabled returns the state of the menu item.  
hideDisabledEntries specifies whether disabled menu entries should be hidden, or not.  
enableAutoMnemonics specifies whether mnemonics are automatically assigned to menu items, or not.  
setItemText sets the text for the menu item.  
getItemText returns the string for the given item id.  
setCommand sets the command string for the menu item.  
getCommand retrieves the command string for the menu item.  
setHelpCommand sets the help command string for the menu item.  
getHelpCommand retrieves the help command string for the menu item.  
setHelpText sets the help text for the menu item.  
getHelpText retrieves the help text for the menu item.  
setTipHelpText sets the tip help text for the menu item.  
getTipHelpText retrieves the tip help text for the menu item.  
isPopupMenu checks whether an XMenu is an XPopupMenu.  
setPopupMenu sets the popup menu for a specified menu item.  
getPopupMenu returns the popup menu from the menu item.  
Methods' Details
addMenuListener
[oneway] void
addMenuListener( [in] XMenuListener  xListener );

Description
adds the specified menu listener to receive events from this menu.
Parameter xListener
the XMenuListener to be added.
removeMenuListener
[oneway] void
removeMenuListener( [in] XMenuListener  xListener );

Description
removes the specified menu listener so that it no longer receives events from this menu.
Parameter xListener
the XMenuListener to be removed.
insertItem
[oneway] void
insertItem( [in] short  nItemId,
[in] string  aText,
[in] short  nItemStyle,
[in] short  nItemPos );

Description
inserts an item into the menu.

The item is appended if the position is greater than or equal to getItemCount() or if it is negative.

Parameter nItemId
specifies the ID of the menu item to be insterted.
Parameter aText
specifies the label of the menu item.
Parameter nItemStyle
specifies the style of the menu item, as defined in MenuItemStyle.
Parameter nItemPos
specifies the position where the menu item will be insterted.
removeItem
[oneway] void
removeItem( [in] short  nItemPos,
[in] short  nCount );

Description
removes one or more items from the menu.
Parameter nItemPos
specifies the position of the (first) menu item to be removed.
Parameter nCount
specifies the number of menu items to remove.
clear
void
clear();

Description
removes all items from the menu.
getItemCount
short
getItemCount();

Description
returns the number of items in the menu.
Returns
the number of items in this XMenu.
getItemId
short
getItemId( [in] short  nItemPos );

Description
returns the ID of the item at the specified position.
Parameter nItemPos
specifies the position of the menu item for which the item ID is queried.
Returns
the ID of the menu item at the given position.
getItemPos
short
getItemPos( [in] short  nItemId );

Description
returns the position of the item with the specified ID.
Parameter nItemId
specifies the ID of the menu item for which the item position is queried.
Returns
the position of the menu item with the specified ID.
getItemType
MenuItemType
getItemType( [in] short  nItemPos );

Description
retrieves the type of the menu item.
Parameter nItemPos
specifies the position of the menu item for which the item type is queried.
Returns
a MenuItemType indicating the item type.
enableItem
[oneway] void
enableItem( [in] short  nItemId,
[in] boolean  bEnable );

Description
enables or disables the menu item.
Parameter nItemId
specifies the menu item ID.
Parameter bEnable
specifies whether the menu item should be enabled (true) or disabled (false).
isItemEnabled
boolean
isItemEnabled( [in] short  nItemId );

Description
returns the state of the menu item.
Parameter nItemId
specifies the menu item ID.
Returns
true if the item is enabled, false otherwise.
hideDisabledEntries
void
hideDisabledEntries( [in] boolean  bHide );

Description
specifies whether disabled menu entries should be hidden, or not.
Parameter bHide
if true, disabled menu entries are hidden.
enableAutoMnemonics
void
enableAutoMnemonics( [in] boolean  bEnable );

Description
specifies whether mnemonics are automatically assigned to menu items, or not.
Parameter bEnable
if true, mnemonics are automatically assigned to menu items.
setItemText
[oneway] void
setItemText( [in] short  nItemId,
[in] string  aText );

Description
sets the text for the menu item.
Parameter nItemId
specifies the ID of the menu item.
Parameter aText
specifies the label of the menu item.
getItemText
string
getItemText( [in] short  nItemId );

Description
returns the string for the given item id.
Parameter nItemId
specifies the ID of the menu item.
Returns
the label of the menu item.
setCommand
void
setCommand( [in] short  nItemId,
[in] string  aCommand );

Description
sets the command string for the menu item.
Parameter nItemId
specifies the menu item ID for which the command should be set.
Parameter aCommand
specifies the command for the menu item.
getCommand
string
getCommand( [in] short  nItemId );

Description
retrieves the command string for the menu item.
Parameter nItemId
specifies the menu item ID for which the command URL should be set.
Returns
the command of the menu item.
setHelpCommand
void
setHelpCommand( [in] short  nItemId,
[in] string  aCommand );

Description
sets the help command string for the menu item.
Parameter nItemId
specifies the menu item ID for which the help command URL be set.
Parameter aCommand
specifies the help command for the menu item.
getHelpCommand
string
getHelpCommand( [in] short  nItemId );

Description
retrieves the help command string for the menu item.
Parameter nItemId
specifies the menu item ID for which the help command should be set.
Returns
the help command of the menu item.
setHelpText
void
setHelpText( [in] short  nItemId,
[in] string  sHelpText );

Description
sets the help text for the menu item.
Parameter nItemId
specifies the menu item identifier for which the help text should be set.
Parameter sHelpText
specifies the help text for the menu item.
getHelpText
string
getHelpText( [in] short  nItemId );

Description
retrieves the help text for the menu item.
Parameter nItemId
specifies the menu item identifier for which the help text should be retrieved.
Returns
a string with the help text.
setTipHelpText
void
setTipHelpText( [in] short  nItemId,
[in] string  sTipHelpText );

Description
sets the tip help text for the menu item.
Parameter nItemId
specifies the menu item identifier for which the tip help text should be set.
Parameter sTipHelpText
specifies the tip help text for the menu item.
getTipHelpText
string
getTipHelpText( [in] short  nItemId );

Description
retrieves the tip help text for the menu item.
Parameter nItemId
specifies the menu item identifier for which the tip help text should be retrieved.
Returns
a string with the tip help text.
isPopupMenu
boolean
isPopupMenu();

Description
checks whether an XMenu is an XPopupMenu.
Returns
true if the menu is a PopupMenu, false if it is a MenuBar.
setPopupMenu
[oneway] void
setPopupMenu( [in] short  nItemId,
[in] XPopupMenu  aPopupMenu );

Description
sets the popup menu for a specified menu item.
Parameter nItemId
specifies the menu item ID for which the XPopupMenu should be set.
Parameter aPopupMenu
specifies a XPopupMenu.
getPopupMenu
XPopupMenu
getPopupMenu( [in] short  nItemId );

Description
returns the popup menu from the menu item.
Parameter nItemId
specifies the menu item ID for which the XPopupMenu should be retrieved.
Returns
a XPopupMenu.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.