class sap.ui.vbm.Legend

Control sample: sap.ui.vbm.Legend
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/vbm/Legend
Application Component: CA-GTF-VBZ

The Legend is a window in the GeoMap or AnalyticMap control wich can be used to display color/icon-text pairs on a map.


Constructor

Constructor for a new Legend.

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.Legend(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


Properties

Name Type Default Value Description
caption string ...see text or source

The caption of the legend.

Visibility: public

Aggregations

Default Aggregation: items

Name Cardinality Type Description
items (default) 0..n sap.ui.vbm.LegendItem

LegendItem object aggregation


Events Overview

Event Description
click

The event is raised when there is a click action on a legend.

click

The event is raised when there is a click action on a legend.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
data object

Event data object

row int

The row number where the click occurred

ctrlKey boolean

key modifier Ctrl pressed

shiftKey boolean

key modifier Shift pressed

metaKey boolean

key modifier Meta pressed

altKey boolean

key modifier Alt pressed


Methods Overview

Method Description
addItem

Adds some item to the aggregation items.

attachClick

Attaches event handler fnFunction to the click event of this sap.ui.vbm.Legend.

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.Legend itself.

The event is raised when there is a click action on a legend.

destroyItems

Destroys all the items in the aggregation items.

detachClick

Detaches event handler fnFunction from the click event of this sap.ui.vbm.Legend.

The passed function and listener object must match the ones used for event registration.

sap.ui.vbm.Legend.extend

Creates a new subclass of class sap.ui.vbm.Legend 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.

fireClick

Fires event click to attached listeners.

getCaption

Gets current value of property caption.

The caption of the legend.

Default value is ...see text or source.

getItems

Gets content of aggregation items.

LegendItem object aggregation

sap.ui.vbm.Legend.getMetadata

Returns a metadata object for class sap.ui.vbm.Legend.

indexOfItem

Checks for the provided sap.ui.vbm.LegendItem in the aggregation items. and returns its index if found or -1 otherwise.

insertItem

Inserts a item into the aggregation items.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

setCaption

Sets a new value for property caption.

The caption of the legend.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is ...see text or source.

addItem

Adds some item to the aggregation items.

Param Type DefaultValue Description
oItem sap.ui.vbm.LegendItem

The item to add; if empty, nothing is inserted

attachClick

Attaches event handler fnFunction to the click event of this sap.ui.vbm.Legend.

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.Legend itself.

The event is raised when there is a click action on a legend.

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 sap.ui.vbm.Legend itself

destroyItems

Destroys all the items in the aggregation items.

detachClick

Detaches event handler fnFunction from the click event of this sap.ui.vbm.Legend.

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

sap.ui.vbm.Legend.extend

Creates a new subclass of class sap.ui.vbm.Legend 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

fireClick

Fires event click to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

data object

Event data object

row int

The row number where the click occurred

ctrlKey boolean

key modifier Ctrl pressed

shiftKey boolean

key modifier Shift pressed

metaKey boolean

key modifier Meta pressed

altKey boolean

key modifier Alt pressed

getCaption

Gets current value of property caption.

The caption of the legend.

Default value is ...see text or source.

getItems

Gets content of aggregation items.

LegendItem object aggregation

sap.ui.vbm.Legend.getMetadata

Returns a metadata object for class sap.ui.vbm.Legend.

indexOfItem

Checks for the provided sap.ui.vbm.LegendItem in the aggregation items. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oItem sap.ui.vbm.LegendItem

The item whose index is looked for

insertItem

Inserts a item into the aggregation items.

Param Type DefaultValue Description
oItem sap.ui.vbm.LegendItem

The item to insert; if empty, nothing is inserted

iIndex int

The 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

Param Type DefaultValue Description
vItem int string sap.ui.vbm.LegendItem

The item to remove or its index or id

setCaption

Sets a new value for property caption.

The caption of the legend.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is ...see text or source.

Param Type DefaultValue Description
sCaption string ...see text or source

New value for property caption