Class sap.ui.vbm.LegendItemModule: sap/ui/vbm/LegendItem

extends Element

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 Summary
new sap.ui.vbm.LegendItem(sId?, mSettings?)Constructor for a new LegendItem.
Event Summary
click(oControlEvent)The event is raised when there is a click action on a legend item.
Method Summary
sap.ui.vbm.LegendItem.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vbm.LegendItem with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.vbm.LegendItem.getMetadata()Returns a metadata object for class sap.ui.vbm.LegendItem.
attachClick(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the click event of this sap.ui.vbm.LegendItem.
detachClick(fnFunction, oListener)Detaches event handler fnFunction from the click event of this sap.ui.vbm.LegendItem.
fireClick(mArguments?)Fires event click to attached listeners.
getColor()Gets current value of property color.
getImage()Gets current value of property image.
getSemanticSpotType()Gets current value of property semanticSpotType.
getText()Gets current value of property text.
setColor(sColor)Sets a new value for property color.
setImage(sImage)Sets a new value for property image.
setSemanticSpotType(sSemanticSpotType)Sets a new value for property semanticSpotType.
setText(sText)Sets a new value for property text.
Constructor Detail
new sap.ui.vbm.LegendItem(sId?, mSettings?)
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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Events
    • click : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Element 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
Event Detail
click(oControlEvent)
The event is raised when there is a click action on a legend item.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{object}oControlEvent.getParameters.data Event data object
{boolean}oControlEvent.getParameters.ctrlKey key modifier Ctrl pressed
{boolean}oControlEvent.getParameters.shiftKey key modifier Shift pressed
{boolean}oControlEvent.getParameters.metaKey key modifier Meta pressed
{boolean}oControlEvent.getParameters.altKey key modifier Alt pressed
Method Detail
sap.ui.vbm.LegendItem.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.

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.ui.vbm.LegendItem.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vbm.LegendItem.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachClick(oData?, fnFunction, oListener?): sap.ui.vbm.LegendItem
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.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.vbm.LegendItem itself
Returns:
{sap.ui.vbm.LegendItem} Reference to this in order to allow method chaining
detachClick(fnFunction, oListener): sap.ui.vbm.LegendItem
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.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.vbm.LegendItem} Reference to this in order to allow method chaining
fireClick(mArguments?): sap.ui.vbm.LegendItem
Fires event click to attached listeners.

Expects the following event parameters:

  • data of type objectEvent data object
  • ctrlKey of type booleankey modifier Ctrl pressed
  • shiftKey of type booleankey modifier Shift pressed
  • metaKey of type booleankey modifier Meta pressed
  • altKey of type booleankey modifier Alt pressed
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vbm.LegendItem} Reference to this in order to allow method chaining
getColor(): string
Gets current value of property color.

The color of the legend marker.

Default value is .

Returns:
{string} Value of property color
getImage(): string
Gets current value of property image.

The image for the legend marker.

Returns:
{string} Value of property image
getSemanticSpotType(): sap.ui.vbm.SemanticType
Gets current value of property semanticSpotType.

The semantic spot type for the legend marker.

Returns:
{sap.ui.vbm.SemanticType} Value of property semanticSpotType
getText(): string
Gets current value of property text.

The text of the legend item.

Returns:
{string} Value of property text
setColor(sColor): sap.ui.vbm.LegendItem
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 .

Parameters:
{string}sColor New value for property color
Returns:
{sap.ui.vbm.LegendItem} Reference to this in order to allow method chaining
setImage(sImage): sap.ui.vbm.LegendItem
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.

Parameters:
{string}sImage New value for property image
Returns:
{sap.ui.vbm.LegendItem} Reference to this in order to allow method chaining
setSemanticSpotType(sSemanticSpotType): sap.ui.vbm.LegendItem
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.

Parameters:
{sap.ui.vbm.SemanticType}sSemanticSpotType New value for property semanticSpotType
Returns:
{sap.ui.vbm.LegendItem} Reference to this in order to allow method chaining
setText(sText): sap.ui.vbm.LegendItem
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.

Parameters:
{string}sText New value for property text
Returns:
{sap.ui.vbm.LegendItem} Reference to this in order to allow method chaining