A horizontal row of items where in many cases the single toolbar items are buttons containing icons. Note that all controls with the sap.ui.commons.ToolbarItem interface can be used as item: Button, ComboBox, TextField.
Constructor for a new Toolbar.
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.commons.Toolbar(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 |
---|---|---|---|
design | sap.ui.commons.ToolbarDesign | Flat | Design settings are theme-dependent. Visibility: public |
standalone | boolean | true | Per default, tool bars have the stand alone status. Alternatively, they can be nested in other controls and then inherit the design from their parent control. Visibility: public |
width | sap.ui.core.CSSSize | auto | When there is not enough space for the toolbar to display all items, the rightmost items are overflowing into a drop-down menu. Visibility: public |
Default Aggregation: items
Name | Cardinality | Type | Description |
---|---|---|---|
items (default) | 0..n | sap.ui.commons.ToolbarItem |
Aggregating the tool bar items. |
rightItems | 0..n | sap.ui.commons.ToolbarItem |
Aggregating the right side tool bar items. |
Method | Description |
---|---|
addItem |
Adds some item to the aggregation items. |
addRightItem |
Adds some rightItem to the aggregation rightItems. |
destroyItems |
Destroys all the items in the aggregation items. |
destroyRightItems |
Destroys all the rightItems in the aggregation rightItems. |
sap.ui.commons.Toolbar.extend |
Creates a new subclass of class sap.ui.commons.Toolbar with name
|
getDesign |
Gets current value of property design. Design settings are theme-dependent. Default value is |
getItems |
Gets content of aggregation items. Aggregating the tool bar items. |
sap.ui.commons.Toolbar.getMetadata |
Returns a metadata object for class sap.ui.commons.Toolbar. |
getRightItems |
Gets content of aggregation rightItems. Aggregating the right side tool bar items. |
getStandalone |
Gets current value of property standalone. Per default, tool bars have the stand alone status. Alternatively, they can be nested in other controls and then inherit the design from their parent control. Default value is |
getWidth |
Gets current value of property width. When there is not enough space for the toolbar to display all items, the rightmost items are overflowing into a drop-down menu. Default value is |
indexOfItem |
Checks for the provided |
indexOfRightItem |
Checks for the provided |
insertItem |
Inserts a item into the aggregation items. |
insertRightItem |
Inserts a rightItem into the aggregation rightItems. |
removeAllItems |
Removes all the controls from the aggregation items. Additionally, it unregisters them from the hosting UIArea. |
removeAllRightItems |
Removes all the controls from the aggregation rightItems. Additionally, it unregisters them from the hosting UIArea. |
removeItem |
Removes a item from the aggregation items. |
removeRightItem |
Removes a rightItem from the aggregation rightItems. |
setDesign |
Sets a new value for property design. Design settings are theme-dependent. When called with a value of Default value is |
setStandalone |
Sets a new value for property standalone. Per default, tool bars have the stand alone status. Alternatively, they can be nested in other controls and then inherit the design from their parent control. When called with a value of Default value is |
setWidth |
Sets a new value for property width. When there is not enough space for the toolbar to display all items, the rightmost items are overflowing into a drop-down menu. When called with a value of Default value is |
Adds some item to the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.commons.ToolbarItem |
The item to add; if empty, nothing is inserted |
Adds some rightItem to the aggregation rightItems.
Param | Type | DefaultValue | Description |
---|---|---|---|
oRightItem | sap.ui.commons.ToolbarItem |
The rightItem to add; if empty, nothing is inserted |
Creates a new subclass of class sap.ui.commons.Toolbar 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 design.
Design settings are theme-dependent.
Default value is Flat
.
Gets current value of property standalone.
Per default, tool bars have the stand alone status. Alternatively, they can be nested in other controls and then inherit the design from their parent control.
Default value is true
.
Gets current value of property width.
When there is not enough space for the toolbar to display all items, the rightmost items are overflowing into a drop-down menu.
Default value is 'auto'
.
Checks for the provided sap.ui.commons.ToolbarItem
in the aggregation items. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.commons.ToolbarItem |
The item whose index is looked for |
Checks for the provided sap.ui.commons.ToolbarItem
in the aggregation rightItems. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oRightItem | sap.ui.commons.ToolbarItem |
The rightItem whose index is looked for |
Inserts a item into the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.commons.ToolbarItem |
The item to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Inserts a rightItem into the aggregation rightItems.
Param | Type | DefaultValue | Description |
---|---|---|---|
oRightItem | sap.ui.commons.ToolbarItem |
The rightItem to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation items.
Additionally, it unregisters them from the hosting UIArea.
Removes all the controls from the aggregation rightItems.
Additionally, it unregisters them from the hosting UIArea.
Removes a item from the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
vItem | int string sap.ui.commons.ToolbarItem |
The item to remove or its index or id |
Removes a rightItem from the aggregation rightItems.
Param | Type | DefaultValue | Description |
---|---|---|---|
vRightItem | int string sap.ui.commons.ToolbarItem |
The rightItem to remove or its index or id |
Sets a new value for property design.
Design settings are theme-dependent.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Flat
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDesign | sap.ui.commons.ToolbarDesign | Flat |
New value for property |
Sets a new value for property standalone.
Per default, tool bars have the stand alone status. Alternatively, they can be nested in other controls and then inherit the design from their parent control.
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 |
---|---|---|---|
bStandalone | boolean | true |
New value for property |
Sets a new value for property width.
When there is not enough space for the toolbar to display all items, the rightmost items are overflowing into a drop-down menu.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 'auto'
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize | 'auto' |
New value for property |