com.sap.ui.commons.client
Class MenuWidget

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sap.ui.core.client.ControlWidget
              extended by com.sap.ui.commons.client.MenuWidget
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget

public class MenuWidget
extends com.sap.ui.core.client.ControlWidget

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 AG)

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
  MenuWidget()
          constructs the class MenuWidget
protected MenuWidget(Menu control)
          constructs the class MenuWidget
  MenuWidget(String id)
          constructs the class MenuWidget
 
Method Summary
 void addItem(MenuItemBase item)
          Appends some item to the items-aggregation.
 void 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.
 void destroyItems()
          Destroys all the items in the Items-aggregation.
 void 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
 Menu getControl()
          returns the reference to the Phoenix Control
 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.
 void 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.
 void removeAllItems()
          Removes all the items in the items-aggregation.
 void removeItem(int index)
          Removes the item at position index in the items-aggregation named.
 void setAriaDescription(String value)
          Setter for property ariaDescription
 void setEnabled(boolean value)
          Setter for property enabled
Default value is: true
 
Methods inherited from class com.sap.ui.core.client.ControlWidget
destroy, doAttachChildren, doDetachChildren, isDesignTime, wrap
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuWidget

public MenuWidget()
constructs the class MenuWidget


MenuWidget

public MenuWidget(String id)
constructs the class MenuWidget

Parameters:
id - id of the MenuWidget

MenuWidget

protected MenuWidget(Menu control)
constructs the class MenuWidget

Parameters:
control - reference to an existing Menu
Method Detail

getControl

public Menu getControl()
returns the reference to the Phoenix Control

Overrides:
getControl in class com.sap.ui.core.client.ControlWidget
Returns:
reference to the Phoenix Control

isEnabled

public 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 void setEnabled(boolean value)
Setter for property enabled
Default value is: true

Parameters:
value - boolean

getAriaDescription

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

Returns:
the value of property ariaDescription

setAriaDescription

public void setAriaDescription(String value)
Setter for property ariaDescription

Parameters:
value - String

getItems

public 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 void 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.

addItem

public void addItem(MenuItemBase item)
Appends some item to the items-aggregation.

Parameters:
item - com.sap.ui.commons.client.MenuItemBase the item to add

removeItem

public void removeItem(int index)
Removes the item at position index in the items-aggregation named.

Parameters:
index - int the position of the item to remove.

removeAllItems

public void removeAllItems()
Removes all the items in the items-aggregation.


indexOfItem

public 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 void destroyItems()
Destroys all the items in the Items-aggregation.


attachItemSelectEvent

public void 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

detachItemSelectEvent

public void 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

open

public 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 void close()
Closes the menu.



Copyright © 2011 SAP. All Rights Reserved.