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

Interface IWDMenu

All Superinterfaces:
IWDMenuItem, IWDViewElement

public interface IWDMenu
extends IWDMenuItem

Web Dynpro Menu API. A menu is a (hierarchical) arrangement of menu items. A menu item may trigger a view controller action (MenuActionItem), represent a radio button (MenuRadioButton) or a check box (MenuCheckBox). Menu items may be visually grouped using separators (MenuSeparator).

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

Type Classification Type Classification:

This interface is part of the Web Dynpro API, so applications may reference it or call any method of it, but they must not implement or extend it.

For a detailed explanation of API classification see the Web Dynpro Compatibility Guide

Field Summary
static boolean DEFAULT_ENABLED
          Default value of the enabled property is true.
static WDTextDirection DEFAULT_TEXT_DIRECTION
          Default value of the textDirection property is WDTextDirection.INHERIT.
static String DEFAULT_TITLE
          Default value of the title property is "".
 
Method Summary
 void addItem(IWDMenuItem item)
          Adds the given Item at the end of the Items list.
 void addItem(IWDMenuItem item, int index)
          Inserts the given Item at the specified (zero-based) index into the Items list.
 void bindEnabled(IWDAttributeInfo attributeInfo)
          Binds the enabled property to the context attribute specified by the given attribute info.
 void bindEnabled(String path)
          Binds the enabled property to the context attribute specified by the given path.
 String bindingOfEnabled()
          Returns the binding path of the enabled property.
 String bindingOfTextDirection()
          Returns the binding path of the textDirection property.
 String bindingOfTitle()
          Returns the binding path of the title property.
 void bindTextDirection(IWDAttributeInfo attributeInfo)
          Binds the textDirection property to the context attribute specified by the given attribute info.
 void bindTextDirection(String path)
          Binds the textDirection property to the context attribute specified by the given path.
 void bindTitle(IWDAttributeInfo attributeInfo)
          Binds the title property to the context attribute specified by the given attribute info.
 void bindTitle(String path)
          Binds the title property to the context attribute specified by the given path.
 void destroyAllItems()
          Destroys all elements in the Items list.
 boolean getEnabled()
          Returns the value of the enabled property.
 IWDMenuItem getItem(int index)
          Returns the Item at the given index.
 IWDMenuItem[] getItems()
          Returns the Items list as an array.
 WDTextDirection getTextDirection()
          Returns the value of the textDirection property.
 String getTitle()
          Returns the value of the title property.
 boolean hasItems()
          Returns true if there exists a Item.
 int indexOfItem(IWDMenuItem item)
          Returns the index of the given element in the Items list, returns -1 if the element is not in the list.
 Iterator iterateItems()
          Returns an iterator over the Items list.
 int numberOfItems()
          Returns the number of Items.
 void removeAllItems()
          Removes all elements from the Items list.
 IWDMenuItem removeItem(int index)
          Removes the Item at the given index from the Items list.
 IWDMenuItem removeItem(String id)
          Removes the Item with the given ID from the Items list.
 void setEnabled(boolean value)
          Sets the enabled property to the given value.
 void setTextDirection(WDTextDirection value)
          Sets the textDirection property to the given value.
 void setTitle(String value)
          Sets the title property to the given value.
 void swapItems(int i, int j)
          Swaps the Items at the given indices.
 
Methods inherited from interface com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDMenuItem
getMenu
 
Methods inherited from interface com.sap.tc.webdynpro.progmodel.api.IWDViewElement
destroy, getId, getView, requestFocus
 

Field Detail

DEFAULT_ENABLED

public static final boolean DEFAULT_ENABLED
Default value of the enabled property is true.

See Also:
Constant Field Values

DEFAULT_TEXT_DIRECTION

public static final WDTextDirection DEFAULT_TEXT_DIRECTION
Default value of the textDirection property is WDTextDirection.INHERIT.


DEFAULT_TITLE

public static final String DEFAULT_TITLE
Default value of the title property is "".

See Also:
Constant Field Values
Method Detail

bindEnabled

public void bindEnabled(String path)
Binds the enabled property to the context attribute specified by the given path.

Parameters:
path - the context path of the attribute to which the enabled property will be bound

bindEnabled

public void bindEnabled(IWDAttributeInfo attributeInfo)
Binds the enabled property to the context attribute specified by the given attribute info.

Parameters:
attributeInfo - the info of the context attribute to which the enabled property will be bound

bindingOfEnabled

public String bindingOfEnabled()
Returns the binding path of the enabled property.

Returns:
the path of the context attribute to which the enabled property is currently bound

getEnabled

public boolean getEnabled()
Returns the value of the enabled property.

The initial value is true.

Controls the enabling state of the menu.

Returns:
the current value of the enabled property
See Also:
setEnabled(boolean)

setEnabled

public void setEnabled(boolean value)
Sets the enabled property to the given value.

Parameters:
value - the new value of the enabled property
See Also:
getEnabled()

bindTextDirection

public void bindTextDirection(String path)
Binds the textDirection property to the context attribute specified by the given path.

Parameters:
path - the context path of the attribute to which the textDirection property will be bound

bindTextDirection

public void bindTextDirection(IWDAttributeInfo attributeInfo)
Binds the textDirection property to the context attribute specified by the given attribute info.

Parameters:
attributeInfo - the info of the context attribute to which the textDirection property will be bound

bindingOfTextDirection

public String bindingOfTextDirection()
Returns the binding path of the textDirection property.

Returns:
the path of the context attribute to which the textDirection property is currently bound

getTextDirection

public WDTextDirection getTextDirection()
Returns the value of the textDirection property.

The initial value is WDTextDirection.INHERIT.

Determines the direction of displayed text.

Returns:
the current value of the textDirection property
See Also:
setTextDirection(WDTextDirection)

setTextDirection

public void setTextDirection(WDTextDirection value)
Sets the textDirection property to the given value.

Parameters:
value - the new value of the textDirection property
See Also:
getTextDirection()

bindTitle

public void bindTitle(String path)
Binds the title property to the context attribute specified by the given path.

Parameters:
path - the context path of the attribute to which the title property will be bound

bindTitle

public void bindTitle(IWDAttributeInfo attributeInfo)
Binds the title property to the context attribute specified by the given attribute info.

Parameters:
attributeInfo - the info of the context attribute to which the title property will be bound

bindingOfTitle

public String bindingOfTitle()
Returns the binding path of the title property.

Returns:
the path of the context attribute to which the title property is currently bound

getTitle

public String getTitle()
Returns the value of the title property.

The initial value is "".

The menu title. Also used as text of menu items that open a submenu.

Returns:
the current value of the title property
See Also:
setTitle(String)

setTitle

public void setTitle(String value)
Sets the title property to the given value.

Parameters:
value - the new value of the title property
See Also:
getTitle()

addItem

public void addItem(IWDMenuItem item)
Adds the given Item at the end of the Items list.

Parameters:
item - the Item to be added to the list
See Also:
getItems()

addItem

public void addItem(IWDMenuItem item,
                    int index)
Inserts the given Item at the specified (zero-based) index into the Items list.

Parameters:
item - the Item to be inserted into the list
index - (zero-based) 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 Items list as an array. A menu contains a list of menu items.

Returns:
an array containing the current Items list

getItem

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

Returns:
Item at the given index

indexOfItem

public int indexOfItem(IWDMenuItem item)
Returns the index of the given element in the Items list, returns -1 if the element is not in the list.


numberOfItems

public int numberOfItems()
Returns the number of Items.

Returns:
the number of Items
See Also:
getItems()

hasItems

public boolean hasItems()
Returns true if there exists a Item.

Returns:
true if there exists a Item, otherwise returns false
See Also:
getItems()

iterateItems

public Iterator iterateItems()
Returns an iterator over the Items list.

Returns:
an iterator over the Items list
See Also:
getItems()

removeItem

public IWDMenuItem removeItem(int index)
Removes the Item at the given index from the Items list. This does not destroy the removed element, i.e. it may be added again!

Parameters:
index - (zero-based) index of the removal position in the list
Returns:
the removed element
See Also:
addItem(IWDMenuItem), getItems()

removeItem

public IWDMenuItem removeItem(String id)
Removes the Item with the given ID from the Items list. This does not destroy the removed element, i.e. it may be added again!

Parameters:
id - unique ID of the element to be removed from the list
Returns:
the removed element
See Also:
addItem(IWDMenuItem), getItems()

removeAllItems

public void removeAllItems()
Removes all elements from the Items list. 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 elements in the Items list. Destroyed view elements do not exist any longer in their view, i.e. new elements may be created with the same IDs.



Copyright 2006 SAP AG Complete Copyright Notice