Class sap.m.TitleModule: sap/m/Title

extends Control
implements IShrinkable

The Title control represents a single line of text with explicit header / title semantics.


Since: 1.27.0.
Constructor Summary
new sap.m.Title(sId?, mSettings?)Constructor for a new Title control.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.Title.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.Title with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.Title.getMetadata()Returns a metadata object for class sap.m.Title.
getLevel()Gets current value of property level.
getText()Gets current value of property text.
getTextAlign()Gets current value of property textAlign.
getTitle()ID of the element which is the current target of the association title, or null.
getTitleStyle()Gets current value of property titleStyle.
getWidth()Gets current value of property width.
setLevel(sLevel)Sets a new value for property level.
setText(sText)Sets a new value for property text.
setTextAlign(sTextAlign)Sets a new value for property textAlign.
setTitle(oTitle)Sets the associated title.
setTitleStyle(sTitleStyle)Sets a new value for property titleStyle.
setWidth(sWidth)Sets a new value for property width.
Constructor Detail
new sap.m.Title(sId?, mSettings?)
Constructor for a new Title control.

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
    • text : string
    • level : sap.ui.core.TitleLevel (default: Auto)
    • titleStyle : sap.ui.core.TitleLevel (default: Auto)
    • width : sap.ui.core.CSSSize
    • textAlign : sap.ui.core.TextAlign (default: Initial)

In addition, all settings applicable to the base type sap.ui.core.Control 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
Method Detail
sap.m.Title.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.Title 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.Control.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.m.Title.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.Title.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
getAccessibilityInfo()
See:
{sap.ui.core.Control#getAccessibilityInfo}
Gets current value of property level.

Defines the semantic level of the title. This information is e.g. used by assistive technologies like screenreaders to create a hierarchical site map for faster navigation. Depending on this setting either a HTML h1-h6 element is used or when using level Auto no explicit level information is written (HTML5 header element).

Default value is Auto.

Returns:
{sap.ui.core.TitleLevel} Value of property level
getText(): string
Gets current value of property text.

Defines the text which should be displayed as a title.

Returns:
{string} Value of property text
getTextAlign(): sap.ui.core.TextAlign
Gets current value of property textAlign.

Defines the alignment of the text within the title. Note: This property only has an effect if the overall width of the title control is larger than the displayed text.

Default value is Initial.

Returns:
{sap.ui.core.TextAlign} Value of property textAlign
getTitle(): sap.ui.core.Title
ID of the element which is the current target of the association title, or null.
Returns:
{sap.ui.core.Title}
getTitleStyle(): sap.ui.core.TitleLevel
Gets current value of property titleStyle.

Defines the style of the title. When using the Auto styling, the appearance of the title depends on the current position of the title and the defined level. This automatism can be overridden by setting a different style explicitly. The actual appearance of the title and the different styles always depends on the theme being used.

Default value is Auto.

Returns:
{sap.ui.core.TitleLevel} Value of property titleStyle
getWidth(): sap.ui.core.CSSSize
Gets current value of property width.

Defines the width of the title.

Returns:
{sap.ui.core.CSSSize} Value of property width
setLevel(sLevel): sap.m.Title
Sets a new value for property level.

Defines the semantic level of the title. This information is e.g. used by assistive technologies like screenreaders to create a hierarchical site map for faster navigation. Depending on this setting either a HTML h1-h6 element is used or when using level Auto no explicit level information is written (HTML5 header element).

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

Default value is Auto.

Parameters:
{sap.ui.core.TitleLevel}sLevel New value for property level
Returns:
{sap.m.Title} Reference to this in order to allow method chaining
setText(sText): sap.m.Title
Sets a new value for property text.

Defines the text which should be displayed as a title.

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

Parameters:
{string}sText New value for property text
Returns:
{sap.m.Title} Reference to this in order to allow method chaining
setTextAlign(sTextAlign): sap.m.Title
Sets a new value for property textAlign.

Defines the alignment of the text within the title. Note: This property only has an effect if the overall width of the title control is larger than the displayed text.

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

Default value is Initial.

Parameters:
{sap.ui.core.TextAlign}sTextAlign New value for property textAlign
Returns:
{sap.m.Title} Reference to this in order to allow method chaining
setTitle(oTitle): sap.m.Title
Sets the associated title.
Parameters:
{sap.ui.core.Title}oTitle Id of an element which becomes the new target of this title association; alternatively, an element instance may be given
Returns:
{sap.m.Title} Reference to this in order to allow method chaining
setTitleStyle(sTitleStyle): sap.m.Title
Sets a new value for property titleStyle.

Defines the style of the title. When using the Auto styling, the appearance of the title depends on the current position of the title and the defined level. This automatism can be overridden by setting a different style explicitly. The actual appearance of the title and the different styles always depends on the theme being used.

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

Default value is Auto.

Parameters:
{sap.ui.core.TitleLevel}sTitleStyle New value for property titleStyle
Returns:
{sap.m.Title} Reference to this in order to allow method chaining
setWidth(sWidth): sap.m.Title
Sets a new value for property width.

Defines the width of the title.

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

Parameters:
{sap.ui.core.CSSSize}sWidth New value for property width
Returns:
{sap.m.Title} Reference to this in order to allow method chaining