Switches between two control areas and animates it via CSS transitions
Constructor for a new ContentSwitcher.
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.ContentSwitcher(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 |
Name | Type | Default Value | Description |
---|---|---|---|
activeContent | int | 1 | The number of the currently active content (1 or 2). Visibility: public |
animation | string | None | Set the used animation when changing content. This just sets a CSS-class named "sapUiUnifiedACSwitcherAnimation" + this value on the root element of the control. The animation has to be implemented in CSS. This also enables applications to implement their own animations via CSS by reacting to the parent class. See the types sap.ui.unified.ContentSwitcherAnimation for default implementations. Visibility: public |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
content1 | 0..n | sap.ui.core.Control |
The controls that should be shown in the first content |
content2 | 0..n | sap.ui.core.Control |
The controls that should be shown in the second content |
Method | Description |
---|---|
addContent1 |
Adds some content1 to the aggregation content1. |
addContent2 |
Adds some content2 to the aggregation content2. |
destroyContent1 |
Destroys all the content1 in the aggregation content1. |
destroyContent2 |
Destroys all the content2 in the aggregation content2. |
sap.ui.unified.ContentSwitcher.extend |
Creates a new subclass of class sap.ui.unified.ContentSwitcher with name
|
getActiveContent |
Gets current value of property activeContent. The number of the currently active content (1 or 2). Default value is |
getAnimation |
Gets current value of property animation. Set the used animation when changing content. This just sets a CSS-class named "sapUiUnifiedACSwitcherAnimation" + this value on the root element of the control. The animation has to be implemented in CSS. This also enables applications to implement their own animations via CSS by reacting to the parent class. See the types sap.ui.unified.ContentSwitcherAnimation for default implementations. Default value is |
getContent1 |
Gets content of aggregation content1. The controls that should be shown in the first content |
getContent2 |
Gets content of aggregation content2. The controls that should be shown in the second content |
sap.ui.unified.ContentSwitcher.getMetadata |
Returns a metadata object for class sap.ui.unified.ContentSwitcher. |
indexOfContent1 |
Checks for the provided |
indexOfContent2 |
Checks for the provided |
insertContent1 |
Inserts a content1 into the aggregation content1. |
insertContent2 |
Inserts a content2 into the aggregation content2. |
removeAllContent1 |
Removes all the controls from the aggregation content1. Additionally, it unregisters them from the hosting UIArea. |
removeAllContent2 |
Removes all the controls from the aggregation content2. Additionally, it unregisters them from the hosting UIArea. |
removeContent1 |
Removes a content1 from the aggregation content1. |
removeContent2 |
Removes a content2 from the aggregation content2. |
setActiveContent |
Sets a new value for property activeContent. The number of the currently active content (1 or 2). When called with a value of Default value is |
setAnimation |
Sets a new value for property animation. Set the used animation when changing content. This just sets a CSS-class named "sapUiUnifiedACSwitcherAnimation" + this value on the root element of the control. The animation has to be implemented in CSS. This also enables applications to implement their own animations via CSS by reacting to the parent class. See the types sap.ui.unified.ContentSwitcherAnimation for default implementations. When called with a value of Default value is |
switchContent |
Changes the currently active content to the other one. If content 1 is active, content 2 will be activated and the other way around. |
Adds some content1 to the aggregation content1.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent1 | sap.ui.core.Control |
The content1 to add; if empty, nothing is inserted |
Adds some content2 to the aggregation content2.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent2 | sap.ui.core.Control |
The content2 to add; if empty, nothing is inserted |
Creates a new subclass of class sap.ui.unified.ContentSwitcher 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.
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 |
Gets current value of property activeContent.
The number of the currently active content (1 or 2).
Default value is 1
.
Gets current value of property animation.
Set the used animation when changing content. This just sets a CSS-class named "sapUiUnifiedACSwitcherAnimation" + this value on the root element of the control. The animation has to be implemented in CSS. This also enables applications to implement their own animations via CSS by reacting to the parent class. See the types sap.ui.unified.ContentSwitcherAnimation for default implementations.
Default value is 'None'
.
Gets content of aggregation content1.
The controls that should be shown in the first content
Gets content of aggregation content2.
The controls that should be shown in the second content
Returns a metadata object for class sap.ui.unified.ContentSwitcher.
Checks for the provided sap.ui.core.Control
in the aggregation content1. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent1 | sap.ui.core.Control |
The content1 whose index is looked for |
Checks for the provided sap.ui.core.Control
in the aggregation content2. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent2 | sap.ui.core.Control |
The content2 whose index is looked for |
Inserts a content1 into the aggregation content1.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent1 | sap.ui.core.Control |
The content1 to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Inserts a content2 into the aggregation content2.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent2 | sap.ui.core.Control |
The content2 to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation content1.
Additionally, it unregisters them from the hosting UIArea.
Removes all the controls from the aggregation content2.
Additionally, it unregisters them from the hosting UIArea.
Removes a content1 from the aggregation content1.
Param | Type | DefaultValue | Description |
---|---|---|---|
vContent1 | int string sap.ui.core.Control |
The content1 to remove or its index or id |
Removes a content2 from the aggregation content2.
Param | Type | DefaultValue | Description |
---|---|---|---|
vContent2 | int string sap.ui.core.Control |
The content2 to remove or its index or id |
Sets a new value for property activeContent.
The number of the currently active content (1 or 2).
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 1
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iActiveContent | int | 1 |
New value for property |
Sets a new value for property animation.
Set the used animation when changing content. This just sets a CSS-class named "sapUiUnifiedACSwitcherAnimation" + this value on the root element of the control. The animation has to be implemented in CSS. This also enables applications to implement their own animations via CSS by reacting to the parent class. See the types sap.ui.unified.ContentSwitcherAnimation for default implementations.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 'None'
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sAnimation | string | 'None' |
New value for property |