Web Dynpro API Documentation

com.sap.tc.webdynpro.clientserver.uielib.standard.api
Interface IWDMenu

All Superinterfaces:
IWDViewElement

public interface IWDMenu
extends IWDViewElement

Web Dynpro Menu API. The menu element is a subelement of the Tray UI element. It can be used to execute actions in the tray UI element. Each tray can contain at most one menu UI element . A menu element can contain any number of menu items (MenuItem objects) but no submenus.

This type can be called by applications using Web Dynpro, but DO NOT EXTEND OR IMPLEMENT IT!


Method Summary
 void addItem(IWDMenuItem aMenuItem)
          Adds the given Item at the end of the list of Items.
 void addItem(IWDMenuItem aMenuItem, int index)
          Adds the given Item at the specified index in the list of Items.
 void destroyAllItems()
          Destroys all entries in the list of Items.
 IWDMenuItem getItem(int index)
          Returns the Item at the given index.
 IWDMenuItem[] getItems()
          Returns the list of Items.
 boolean hasItems()
          Checks if there exist Items.
 int indexOfItem(IWDMenuItem aMenuItem)
          Returns the index of the given element in the list of Items or -1 if it is not contained in the list.
 java.util.Iterator iterateItems()
          Returns an iterator over the list of Items.
 int numberOfItems()
          Returns the number of Items.
 void removeAllItems()
          Removes all entries from the list of Items.
 IWDMenuItem removeItem(int index)
          Removes the entry at the given index from the list of Items.
 IWDMenuItem removeItem(java.lang.String id)
          Removes the entry with the given ID from the list of Items.
 void swapItems(int i, int j)
          Swaps the Items at the given indices.
 
Methods inherited from interface com.sap.tc.webdynpro.progmodel.api.IWDViewElement
getId, getView, requestFocus
 

Method Detail

addItem

public void addItem(IWDMenuItem aMenuItem)
Adds the given Item at the end of the list of Items.
Parameters:
aMenuItem - the Item to be added into the list
See Also:
getItems()

addItem

public void addItem(IWDMenuItem aMenuItem,
                    int index)
Adds the given Item at the specified index in the list of Items.
Parameters:
aMenuItem - the Item to be added into the list
index - zero based index of the insertion position in the list
See Also:
getItems()

swapItems

public void swapItems(int i,
                      int j)
Swaps the Items at the given indices.
Parameters:
i - index of the first Item to swap
j - index of the second Item to swap
Throws:
IndexOutOfBoundsException - If one of the indices is out of bounds

getItems

public IWDMenuItem[] getItems()
Returns the list of Items.
Returns:
an array containing references to the current Items

getItem

public IWDMenuItem getItem(int index)
Returns the Item at the given index.
Returns:
Item at the given index

indexOfItem

public int indexOfItem(IWDMenuItem aMenuItem)
Returns the index of the given element in the list of Items or -1 if it is not contained in the list.

numberOfItems

public int numberOfItems()
Returns the number of Items.
Returns:
the current number of Items.
See Also:
getItems()

hasItems

public boolean hasItems()
Checks if there exist Items.
Returns:
true if there are Items; false otherwise.
See Also:
getItems()

iterateItems

public java.util.Iterator iterateItems()
Returns an iterator over the list of Items.
Returns:
an iterator over the current Items
See Also:
getItems()

removeItem

public IWDMenuItem removeItem(int index)
Removes the entry at the given index from the list of Items. This does not destroy the removed element, i.e. it may be added again!
Parameters:
index - zero based index of the deletion position in the list
Returns:
the removed element
See Also:
addItem(IWDMenuItem), getItems()

removeItem

public IWDMenuItem removeItem(java.lang.String id)
Removes the entry with the given ID from the list of Items. This does not destroy the removed element, i.e. it may be added again!
Parameters:
id - unique ID of the element to be deleted from the list
Returns:
the removed element
See Also:
addItem(IWDMenuItem), getItems()

removeAllItems

public void removeAllItems()
Removes all entries from the list of Items. This does not destroy the removed elements, i.e. they may be added again!
See Also:
addItem(IWDMenuItem), getItems()

destroyAllItems

public void destroyAllItems()
Destroys all entries in the list of Items. Destroyed elements do not exist any longer, i.e. new elements may be created with the same IDs.

Web Dynpro API Documentation

Copyright © 2004 SAP AG. Automatically generated Thu Mar 3 2005, 22:15