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)

  • Associations

    • title : (sap.ui.core.ID | sap.ui.core.Title)

In addition, all settings applicable to the base type sap.ui.core.Control 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
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:
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.m.Title.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.Title.
Returns:
sap.ui.base.MetadataMetadata 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 an HTML h1-h6 element is used or when using level Auto no explicit level information is written (HTML5 header element). This property does not influence the style of the control. Use the property titleStyle for this purpose instead.

Default value is Auto.

Returns:
sap.ui.core.TitleLevelValue of property level
getText(): string

Gets current value of property text.

Defines the text which should be displayed as a title.

Returns:
stringValue 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.TextAlignValue of property textAlign
getTitle(): sap.ui.core.ID
ID of the element which is the current target of the association title, or null.
Returns:
sap.ui.core.ID
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 (e.g. inside a Toolbar). This default behavior 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.TitleLevelValue of property titleStyle
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

Defines the width of the title.

Returns:
sap.ui.core.CSSSizeValue 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 an HTML h1-h6 element is used or when using level Auto no explicit level information is written (HTML5 header element). This property does not influence the style of the control. Use the property titleStyle for this purpose instead.

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.TitleLevelsLevelNew value for property level
Returns:
sap.m.TitleReference 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:
stringsTextNew value for property text
Returns:
sap.m.TitleReference 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.TextAlignsTextAlignNew value for property textAlign
Returns:
sap.m.TitleReference to this in order to allow method chaining
setTitle(oTitle): sap.m.Title
Sets the associated title.
Parameters:
sap.ui.core.ID|sap.ui.core.TitleoTitleID of an element which becomes the new target of this title association; alternatively, an element instance may be given
Returns:
sap.m.TitleReference 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 (e.g. inside a Toolbar). This default behavior 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.TitleLevelsTitleStyleNew value for property titleStyle
Returns:
sap.m.TitleReference 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.CSSSizesWidthNew value for property width
Returns:
sap.m.TitleReference to this in order to allow method chaining