class sap.ui.unified.ShellHeadItem

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/unified/ShellHeadItem
Application Component: CA-UI5-CTR

Header Action item of the Shell.


Constructor

Constructor for a new ShellHeadItem.

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

new sap.ui.unified.ShellHeadItem(sId?, mSettings?)
Param Type Default Value Description
sId? string

id for the new control, generated automatically if no id is given

mSettings? object

initial settings for the new control


Properties

Name Type Default Value Description
icon sap.ui.core.URI

The icon of the item, either defined in the sap.ui.core.IconPool or a URI to a custom image. An icon must be set.

Visibility: public
selected boolean false

Defines the toggle state in case the item represents a toggle button (see also property toggleEnabled).

Visibility: public
showMarker boolean false

If set to true, a theme dependent marker is shown on the item.

Visibility: public
showSeparator boolean true

If set to true, a separator is displayed after the item.

Since: 1.22.5.

Visibility: public
startsSection boolean false

If set to true, a divider is displayed before the item.

Visibility: public
toggleEnabled boolean true

If set to true, the item represents a toggle button. The selected property can the be used to define the toggle state. Otherwise the item is displayed as action button. In this case the selected property is ignored.

Since: 1.34.3.

Visibility: public
visible boolean true

Invisible items are not shown on the UI.

Since: 1.18.

Visibility: public

Associations

Name Cardinality Type Description
ariaLabelledBy 0..n sap.ui.core.Control

Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby).


Events Overview

Event Description
press

Event is fired when the user presses the item.

press

Event is fired when the user presses the item.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

attachPress

Attaches event handler fnFunction to the press event of this sap.ui.unified.ShellHeadItem.

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.ShellHeadItem itself.

Event is fired when the user presses the item.

detachPress

Detaches event handler fnFunction from the press event of this sap.ui.unified.ShellHeadItem.

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

sap.ui.unified.ShellHeadItem.extend

Creates a new subclass of class sap.ui.unified.ShellHeadItem 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.

firePress

Fires event press to attached listeners.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getIcon

Gets current value of property icon.

The icon of the item, either defined in the sap.ui.core.IconPool or a URI to a custom image. An icon must be set.

sap.ui.unified.ShellHeadItem.getMetadata

Returns a metadata object for class sap.ui.unified.ShellHeadItem.

getSelected

Gets current value of property selected.

Defines the toggle state in case the item represents a toggle button (see also property toggleEnabled).

Default value is false.

getShowMarker

Gets current value of property showMarker.

If set to true, a theme dependent marker is shown on the item.

Default value is false.

Since 1.18 Markers should not be used anymore.
getShowSeparator

Gets current value of property showSeparator.

If set to true, a separator is displayed after the item.

Default value is true.

getStartsSection

Gets current value of property startsSection.

If set to true, a divider is displayed before the item.

Default value is false.

Since 1.18 Dividers are not supported anymore.
getToggleEnabled

Gets current value of property toggleEnabled.

If set to true, the item represents a toggle button. The selected property can the be used to define the toggle state. Otherwise the item is displayed as action button. In this case the selected property is ignored.

Default value is true.

getVisible

Gets current value of property visible.

Invisible items are not shown on the UI.

Default value is true.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

setIcon

Sets a new value for property icon.

The icon of the item, either defined in the sap.ui.core.IconPool or a URI to a custom image. An icon must be set.

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

setSelected

Sets a new value for property selected.

Defines the toggle state in case the item represents a toggle button (see also property toggleEnabled).

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

Default value is false.

setShowMarker

Sets a new value for property showMarker.

If set to true, a theme dependent marker is shown on the item.

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

Default value is false.

Since 1.18 Markers should not be used anymore.
setShowSeparator

Sets a new value for property showSeparator.

If set to true, a separator is displayed after the item.

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

Default value is true.

setStartsSection

Sets a new value for property startsSection.

If set to true, a divider is displayed before the item.

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

Default value is false.

Since 1.18 Dividers are not supported anymore.
setToggleEnabled

Sets a new value for property toggleEnabled.

If set to true, the item represents a toggle button. The selected property can the be used to define the toggle state. Otherwise the item is displayed as action button. In this case the selected property is ignored.

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

Default value is true.

setVisible

Sets a new value for property visible.

Invisible items are not shown on the UI.

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

Default value is true.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

attachPress

Attaches event handler fnFunction to the press event of this sap.ui.unified.ShellHeadItem.

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.ShellHeadItem itself.

Event is fired when the user presses the item.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.unified.ShellHeadItem itself

detachPress

Detaches event handler fnFunction from the press event of this sap.ui.unified.ShellHeadItem.

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

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.unified.ShellHeadItem.extend

Creates a new subclass of class sap.ui.unified.ShellHeadItem 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.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

firePress

Fires event press to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getIcon

Gets current value of property icon.

The icon of the item, either defined in the sap.ui.core.IconPool or a URI to a custom image. An icon must be set.

sap.ui.unified.ShellHeadItem.getMetadata

Returns a metadata object for class sap.ui.unified.ShellHeadItem.

getSelected

Gets current value of property selected.

Defines the toggle state in case the item represents a toggle button (see also property toggleEnabled).

Default value is false.

getShowMarker

Gets current value of property showMarker.

If set to true, a theme dependent marker is shown on the item.

Default value is false.

Since 1.18 Markers should not be used anymore.

getShowSeparator

Gets current value of property showSeparator.

If set to true, a separator is displayed after the item.

Default value is true.

getStartsSection

Gets current value of property startsSection.

If set to true, a divider is displayed before the item.

Default value is false.

Since 1.18 Dividers are not supported anymore.

getToggleEnabled

Gets current value of property toggleEnabled.

If set to true, the item represents a toggle button. The selected property can the be used to define the toggle state. Otherwise the item is displayed as action button. In this case the selected property is ignored.

Default value is true.

getVisible

Gets current value of property visible.

Invisible items are not shown on the UI.

Default value is true.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

setIcon

Sets a new value for property icon.

The icon of the item, either defined in the sap.ui.core.IconPool or a URI to a custom image. An icon must be set.

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

Param Type DefaultValue Description
sIcon sap.ui.core.URI

New value for property icon

setSelected

Sets a new value for property selected.

Defines the toggle state in case the item represents a toggle button (see also property toggleEnabled).

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

Default value is false.

Param Type DefaultValue Description
bSelected boolean false

New value for property selected

setShowMarker

Sets a new value for property showMarker.

If set to true, a theme dependent marker is shown on the item.

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

Default value is false.

Since 1.18 Markers should not be used anymore.
Param Type DefaultValue Description
bShowMarker boolean false

New value for property showMarker

setShowSeparator

Sets a new value for property showSeparator.

If set to true, a separator is displayed after the item.

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

Default value is true.

Param Type DefaultValue Description
bShowSeparator boolean true

New value for property showSeparator

setStartsSection

Sets a new value for property startsSection.

If set to true, a divider is displayed before the item.

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

Default value is false.

Since 1.18 Dividers are not supported anymore.
Param Type DefaultValue Description
bStartsSection boolean false

New value for property startsSection

setToggleEnabled

Sets a new value for property toggleEnabled.

If set to true, the item represents a toggle button. The selected property can the be used to define the toggle state. Otherwise the item is displayed as action button. In this case the selected property is ignored.

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

Default value is true.

Param Type DefaultValue Description
bToggleEnabled boolean true

New value for property toggleEnabled

setVisible

Sets a new value for property visible.

Invisible items are not shown on the UI.

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

Default value is true.

Param Type DefaultValue Description
bVisible boolean true

New value for property visible