com.sap.ui.commons.client
Class Menu

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.sap.ui.core.client.Element
          extended by com.sap.ui.core.client.Control
              extended by com.sap.ui.commons.client.Menu

public class Menu
extends com.sap.ui.core.client.Control

The class Menu is the GWT wrapper for the Phoenix control: sap.ui.commons.Menu.

A container for menu items. When the space in the browser is not large enough to display all defined items, a scroll bar is provided.

Version:
0.18.0-SNAPSHOT
Author:
GENERATOR (JavaScript control: sap.ui.commons.Menu)

Constructor Summary
protected Menu()
          constructs the class Menu
hidden due to JavaScriptObject restriction
 
Method Summary
 Menu addItem(MenuItemBase item)
          Appends a item to the aggregation items.
 Menu attachItemSelectEvent(com.sap.ui.core.client.event.EventListener listener)
          attach an EventListener This event is redundant to the select event of a MenuItem and provides the application an alternative option to listen to select events.
 void close()
          Closes the menu.
static Menu create()
          creates a new instance of the class Menu
static Menu create(String idOrConfig)
          creates a new instance of the class Menu
static Menu create(String id, String config)
          creates a new instance of the class Menu
 Menu destroyItems()
          Destroys all the items in the Items-aggregation.
 Menu detachItemSelectEvent(com.sap.ui.core.client.event.EventListener listener)
          detach an EventListener This event is redundant to the select event of a MenuItem and provides the application an alternative option to listen to select events.
 String getAriaDescription()
          Getter for property ariaDescription The label/description provided for screenreaders
 com.sap.ui.core.client.js.JsArray<MenuItemBase> getItems()
          Getter for aggregation items Aggregation of menu items.
 int indexOfItem(MenuItemBase item)
          Checks for the provided com.sap.ui.commons.client.MenuItemBase in the items-aggregation and returns its index if found or -1 otherwise.
 Menu insertItem(MenuItemBase item, int index)
          Inserts some item into the aggregation named items.
 boolean isEnabled()
          Getter for property enabled Disabled menus have other colors than enabled ones, depending on customer settings.
 void open(boolean withKeyboard, Object openerRef, String my, String at, String of, String offset)
          Opens the menu.
 com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.js.JsArray<MenuItemBase>> removeAllItems()
          Removes all the items in the items-aggregation.
 com.sap.ui.core.client.js.JsArray<MenuItemBase> removeItem(int index)
          Removes a item from the aggregation named items.
 Menu setAriaDescription(String value)
          Setter for property ariaDescription
 Menu setEnabled(boolean value)
          Setter for property enabled
Default value is: true
 
Methods inherited from class com.sap.ui.core.client.Control
addStyleClass, hasStyleClass, invalidate, placeAt, placeAt, removeStyleClass, rerender
 
Methods inherited from class com.sap.ui.core.client.Element
_convertArray, _convertArray, _convertArray, _convertArray, _convertArray, attachBrowserEvent, attachEvent, bindAggregation, bindContext, bindProperty, bindProperty, destroy, detachBrowserEvent, detachEvent, getDomRef, getElementName, getId, getLibraryName, getModel, getParent, getProperty, getTooltip_AsString, getTooltip_Text, getTooltip, isActive, setModel, setProperty, setTooltip, setTooltip, unbindAggregation, unbindContext, unbindProperty
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Menu

protected Menu()
constructs the class Menu
hidden due to JavaScriptObject restriction

Method Detail

create

public static Menu create()
creates a new instance of the class Menu


create

public static Menu create(String idOrConfig)
creates a new instance of the class Menu

Parameters:
id - id of the Menu or configuration JSON string

create

public static Menu create(String id,
                          String config)
creates a new instance of the class Menu

Parameters:
id - id of the Menu
config - configuration JSON string

isEnabled

public final boolean isEnabled()
Getter for property enabled Disabled menus have other colors than enabled ones, depending on customer settings.

Returns:
the value of property enabled

setEnabled

public final Menu setEnabled(boolean value)
Setter for property enabled
Default value is: true

Parameters:
value - boolean
Returns:
this to allow method chaining

getAriaDescription

public final String getAriaDescription()
Getter for property ariaDescription The label/description provided for screenreaders

Returns:
the value of property ariaDescription

setAriaDescription

public final Menu setAriaDescription(String value)
Setter for property ariaDescription

Parameters:
value - String
Returns:
this to allow method chaining

getItems

public final com.sap.ui.core.client.js.JsArray<MenuItemBase> getItems()
Getter for aggregation items Aggregation of menu items.

Returns:
com.sap.ui.commons.client.MenuItemBase[]

insertItem

public final Menu insertItem(MenuItemBase item,
                             int index)
Inserts some item into the aggregation named items.

Parameters:
item - the item to insert
index - int the 0-based index the item should be inserted at.
Returns:
this to allow method chaining

addItem

public final Menu addItem(MenuItemBase item)
Appends a item to the aggregation items.

Parameters:
item - com.sap.ui.commons.client.MenuItemBase the item to add
Returns:
this to allow method chaining

removeItem

public final com.sap.ui.core.client.js.JsArray<MenuItemBase> removeItem(int index)
Removes a item from the aggregation named items.

Parameters:
index - int the position of the item to remove.
Returns:
reference to this instance

removeAllItems

public final com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.js.JsArray<MenuItemBase>> removeAllItems()
Removes all the items in the items-aggregation.

Returns:
an array of the removed elements (might be empty)

indexOfItem

public final int indexOfItem(MenuItemBase item)
Checks for the provided com.sap.ui.commons.client.MenuItemBase in the items-aggregation and returns its index if found or -1 otherwise.

Parameters:
item - the item whose index is looked for.
Returns:
the index of the provided control in the aggregation.

destroyItems

public final Menu destroyItems()
Destroys all the items in the Items-aggregation.

Returns:
this to allow method chaining

attachItemSelectEvent

public final Menu attachItemSelectEvent(com.sap.ui.core.client.event.EventListener listener)
attach an EventListener This event is redundant to the select event of a MenuItem and provides the application an alternative option to listen to select events. This event is only fired on the root menu of a menu hierarchy.
Event Parameters:
{sap.ui.commons/MenuItemBase} item The item which was selected.

Parameters:
listener - reference to the EventListener
Returns:
this to allow method chaining

detachItemSelectEvent

public final Menu detachItemSelectEvent(com.sap.ui.core.client.event.EventListener listener)
detach an EventListener This event is redundant to the select event of a MenuItem and provides the application an alternative option to listen to select events. This event is only fired on the root menu of a menu hierarchy.

Parameters:
listener - reference to the EventListener
Returns:
this to allow method chaining

open

public final void open(boolean withKeyboard,
                       Object openerRef,
                       String my,
                       String at,
                       String of,
                       String offset)
Opens the menu.

Parameters:
withKeyboard - Whether the menu has been opened with the keyboard. If so, then the first item is selected after opening the menu.
openerRef - (Optional) DomNode that openes the menu (will be focused again after the menu is closed).
my - see sap.ui.core.Popup.setPosition
at - see sap.ui.core.Popup.setPosition
of - see sap.ui.core.Popup.setPosition
offset - see sap.ui.core.Popup.setPosition

close

public final void close()
Closes the menu.



Copyright © 2011 SAP. All Rights Reserved.