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

extends Element

User Header Action Item of the Shell.
Deprecated API:
Since version 1.44.0.

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(mParameters?)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

  • Associations

  • 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:
stringsId?id for the new control, generated automatically if no id is given
objectmSettings?initial settings for the new control
Event Detail
press(oControlEvent)
Event is fired when the user presses the button.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.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:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated 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.MetadataMetadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.ui.unified.ShellHeadUserItem
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledByThe ariaLabelledBy to add; if empty, nothing is inserted
Returns:
sap.ui.unified.ShellHeadUserItemReference 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:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.unified.ShellHeadUserItem itself
Returns:
sap.ui.unified.ShellHeadUserItemReference 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:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.unified.ShellHeadUserItemReference to this in order to allow method chaining
firePress(mParameters?): sap.ui.unified.ShellHeadUserItem
Fires event press to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.ui.unified.ShellHeadUserItemReference to this in order to allow method chaining
getAriaLabelledBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
sap.ui.core.ID[]
getImage(): sap.ui.core.URI

Gets current value of property image.

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

Returns:
sap.ui.core.URIValue 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.

Returns:
booleanValue of property showPopupIndicator
Since:
1.27.0
getUsername(): string

Gets current value of property username.

The name of the user.

Default value is empty string.

Returns:
stringValue of property username
removeAllAriaLabelledBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.ID
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledByThe ariaLabelledBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaLabelledBy or null

Sets a new value for property image.

An image of the user, normally a URI to an 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.URIsImageNew value for property image
Returns:
sap.ui.unified.ShellHeadUserItemReference 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:
booleanbShowPopupIndicatorNew value for property showPopupIndicator
Returns:
sap.ui.unified.ShellHeadUserItemReference to this in order to allow method chaining
Since:
1.27.0
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 empty string.

Parameters:
stringsUsernameNew value for property username
Returns:
sap.ui.unified.ShellHeadUserItemReference to this in order to allow method chaining