Aggregation element for the Legend. A LegendItem consists of marker and an associated text. The marker is either a rectangle in the given color or the given image or a semantic spot type. If no marker but only a text is provided then it is shown in italic letters and can be regarded as a header.
Constructor for a new LegendItem.
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.vbm.LegendItem(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 |
---|---|---|---|
color | string | empty string | The color of the legend marker. Visibility: public |
image | string | The image for the legend marker. Visibility: public |
|
semanticSpotType | sap.ui.vbm.SemanticType | The semantic spot type for the legend marker. Visibility: public |
|
text | string | The text of the legend item. Visibility: public |
Event | Description |
---|---|
click |
The event is raised when there is a click action on a legend item. |
The event is raised when there is a click action on a legend item.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
data | object |
Event data object |
ctrlKey | boolean |
key modifier Ctrl pressed |
shiftKey | boolean |
key modifier Shift pressed |
metaKey | boolean |
key modifier Meta pressed |
altKey | boolean |
key modifier Alt pressed |
Method | Description |
---|---|
attachClick |
Attaches event handler When called, the context of the event handler (its The event is raised when there is a click action on a legend item. |
detachClick |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.vbm.LegendItem.extend |
Creates a new subclass of class sap.ui.vbm.LegendItem with name
|
fireClick |
Fires event click to attached listeners. |
getColor |
Gets current value of property color. The color of the legend marker. Default value is |
getImage |
Gets current value of property image. The image for the legend marker. |
sap.ui.vbm.LegendItem.getMetadata |
Returns a metadata object for class sap.ui.vbm.LegendItem. |
getSemanticSpotType |
Gets current value of property semanticSpotType. The semantic spot type for the legend marker. |
getText |
Gets current value of property text. The text of the legend item. |
setColor |
Sets a new value for property color. The color of the legend marker. When called with a value of Default value is |
setImage |
Sets a new value for property image. The image for the legend marker. When called with a value of |
setSemanticSpotType |
Sets a new value for property semanticSpotType. The semantic spot type for the legend marker. When called with a value of |
setText |
Sets a new value for property text. The text of the legend item. When called with a value of |
Attaches event handler fnFunction
to the click event of this sap.ui.vbm.LegendItem
.
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.vbm.LegendItem
itself.
The event is raised when there is a click action on a legend 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 |
Detaches event handler fnFunction
from the click event of this sap.ui.vbm.LegendItem
.
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 |
Creates a new subclass of class sap.ui.vbm.LegendItem 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 |
Fires event click to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
data | object |
Event data object |
|
ctrlKey | boolean |
key modifier Ctrl pressed |
|
shiftKey | boolean |
key modifier Shift pressed |
|
metaKey | boolean |
key modifier Meta pressed |
|
altKey | boolean |
key modifier Alt pressed |
Gets current value of property color.
The color of the legend marker.
Default value is empty string
.
Gets current value of property semanticSpotType.
The semantic spot type for the legend marker.
Sets a new value for property color.
The color of the legend marker.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is empty string
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sColor | string | '' |
New value for property |
Sets a new value for property image.
The image for the legend marker.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sImage | string |
New value for property |
Sets a new value for property semanticSpotType.
The semantic spot type for the legend marker.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sSemanticSpotType | sap.ui.vbm.SemanticType |
New value for property |
Sets a new value for property text.
The text of the legend item.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sText | string |
New value for property |