Class sap.ui.unified.ShellHeadUserItemModule: sap/ui/unified/ShellHeadUserItem

extends Element

User Header Action Item of the Shell.


Since: 1.22.0.
Constructor Summary
new sap.ui.unified.ShellHeadUserItem(sId?, mSettings?)Constructor for a new ShellHeadUserItem.
Event Summary
press(oControlEvent)Event is fired when the user presses the button.
Method Summary
sap.ui.unified.ShellHeadUserItem.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.unified.ShellHeadUserItem with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.unified.ShellHeadUserItem.getMetadata()Returns a metadata object for class sap.ui.unified.ShellHeadUserItem.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
attachPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the press event of this sap.ui.unified.ShellHeadUserItem.
detachPress(fnFunction, oListener)Detaches event handler fnFunction from the press event of this sap.ui.unified.ShellHeadUserItem.
firePress(mArguments?)Fires event press to attached listeners.
getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
getImage()Gets current value of property image.
getShowPopupIndicator()Gets current value of property showPopupIndicator.
getUsername()Gets current value of property username.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
setImage(sImage)Sets a new value for property image.
setShowPopupIndicator(bShowPopupIndicator)Sets a new value for property showPopupIndicator.
setUsername(sUsername)Sets a new value for property username.
Constructor Detail
new sap.ui.unified.ShellHeadUserItem(sId?, mSettings?)
Constructor for a new ShellHeadUserItem.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Events
    • press : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Element can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Event Detail
press(oControlEvent)
Event is fired when the user presses the button.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.ui.unified.ShellHeadUserItem.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.unified.ShellHeadUserItem with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Element.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.unified.ShellHeadUserItem.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.unified.ShellHeadUserItem.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.ui.unified.ShellHeadUserItem
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
{string|sap.ui.core.Control}vAriaLabelledBy the ariaLabelledBy to add; if empty, nothing is inserted
Returns:
{sap.ui.unified.ShellHeadUserItem} Reference to this in order to allow method chaining
attachPress(oData?, fnFunction, oListener?): sap.ui.unified.ShellHeadUserItem
Attaches event handler fnFunction to the press event of this sap.ui.unified.ShellHeadUserItem.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.unified.ShellHeadUserItem itself.

Event is fired when the user presses the button.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.unified.ShellHeadUserItem itself
Returns:
{sap.ui.unified.ShellHeadUserItem} Reference to this in order to allow method chaining
detachPress(fnFunction, oListener): sap.ui.unified.ShellHeadUserItem
Detaches event handler fnFunction from the press event of this sap.ui.unified.ShellHeadUserItem.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.unified.ShellHeadUserItem} Reference to this in order to allow method chaining
firePress(mArguments?): sap.ui.unified.ShellHeadUserItem
Fires event press to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.unified.ShellHeadUserItem} Reference to this in order to allow method chaining
getAriaLabelledBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
{sap.ui.core.Control[]}
getImage(): sap.ui.core.URI
Gets current value of property image.

An image of the user, normally an URI to a image but also an icon from the sap.ui.core.IconPool is possible.

Returns:
{sap.ui.core.URI} Value of property image
getShowPopupIndicator(): boolean
Gets current value of property showPopupIndicator.

The user item is intended to be used for user settings. Normally these settings are done via a Menu or Dialog. If this property is set to true an indicator for such a popup mechanismn is shown in the item.

Default value is true.

Since:
1.27.0
Returns:
{boolean} Value of property showPopupIndicator
getUsername(): string
Gets current value of property username.

The name of the user.

Default value is .

Returns:
{string} Value of property username
removeAllAriaLabelledBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.Control
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
{int|string|sap.ui.core.Control}vAriaLabelledBy The ariaLabelledByto be removed or its index or ID
Returns:
{sap.ui.core.Control} the removed ariaLabelledBy or null
Sets a new value for property image.

An image of the user, normally an URI to a image but also an icon from the sap.ui.core.IconPool is possible.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{sap.ui.core.URI}sImage New value for property image
Returns:
{sap.ui.unified.ShellHeadUserItem} Reference to this in order to allow method chaining
setShowPopupIndicator(bShowPopupIndicator): sap.ui.unified.ShellHeadUserItem
Sets a new value for property showPopupIndicator.

The user item is intended to be used for user settings. Normally these settings are done via a Menu or Dialog. If this property is set to true an indicator for such a popup mechanismn is shown in the item.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bShowPopupIndicator New value for property showPopupIndicator
Since:
1.27.0
Returns:
{sap.ui.unified.ShellHeadUserItem} Reference to this in order to allow method chaining
setUsername(sUsername): sap.ui.unified.ShellHeadUserItem
Sets a new value for property username.

The name of the user.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is .

Parameters:
{string}sUsername New value for property username
Returns:
{sap.ui.unified.ShellHeadUserItem} Reference to this in order to allow method chaining