A thin wrapper over sap.m.ColorPalette allowing the latter to be used in a popover.
Constructor for a new ColorPalettePopover
.
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.m.ColorPalettePopover(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 |
---|---|---|---|
colors | sap.ui.core.CSSColor[] | gold, darkorange, indianred, darkmagenta, cornflowerblue, deepskyblue, darkcyan, olivedrab, darkslategray, azure, white, lightgray, darkgray, dimgray, black | Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors. Visibility: public |
defaultColor | sap.ui.core.CSSColor | The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect. Visibility: public |
|
displayMode | sap.ui.unified.ColorPickerDisplayMode | Default | Determines the |
showDefaultColorButton | boolean | true | Indicates if the button for default color selection is available. Visibility: public |
showMoreColorsButton | boolean | true | Denotes if the color has been chosen by selecting the "Default Color" button (true or false) Visibility: public |
showRecentColorsSection | boolean | true | Indicates if the Recent Colors section is available |
Event | Description |
---|---|
colorSelect |
Fired when the user selects a color. |
liveChange |
Fired when the value is changed by user interaction in the internal ColorPicker of the ColorPalette |
Fired when the user selects a color.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
value | sap.ui.core.CSSColor |
The color that is returned when user chooses the "Default Color" button. |
defaultAction | boolean |
Denotes if the color has been chosen by selecting the "Default Color" button (true or false). |
Fired when the value is changed by user interaction in the internal ColorPicker of the ColorPalette
Since: 1.85.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
r | int |
Parameter containing the RED value (0-255). |
g | int |
Parameter containing the GREEN value (0-255). |
b | int |
Parameter containing the BLUE value (0-255). |
h | int |
Parameter containing the HUE value (0-360). |
s | int |
Parameter containing the SATURATION value (0-100). |
v | int |
Parameter containing the VALUE value (0-100). |
l | int |
Parameter containing the LIGHTNESS value (0-100). |
hex | string |
Parameter containing the Hexadecimal string (#FFFFFF). |
alpha | string |
Parameter containing the alpha value (transparency). |
Method | Description |
---|---|
attachColorSelect |
Attaches event handler When called, the context of the event handler (its Fired when the user selects a color. |
attachLiveChange |
Attaches event handler When called, the context of the event handler (its Fired when the value is changed by user interaction in the internal ColorPicker of the ColorPalette |
close |
Closes the |
detachColorSelect |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachLiveChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.m.ColorPalettePopover.extend |
Creates a new subclass of class sap.m.ColorPalettePopover with name
|
fireColorSelect |
Fires event colorSelect to attached listeners. |
fireLiveChange |
Fires event liveChange to attached listeners. |
getColors |
Gets current value of property colors. Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors. Default value is |
getDefaultColor |
Gets current value of property defaultColor. The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect. |
getDisplayMode |
Gets current value of property displayMode. Determines the Default value is |
sap.m.ColorPalettePopover.getMetadata |
Returns a metadata object for class sap.m.ColorPalettePopover. |
getShowDefaultColorButton |
Gets current value of property showDefaultColorButton. Indicates if the button for default color selection is available. Default value is |
getShowMoreColorsButton |
Gets current value of property showMoreColorsButton. Denotes if the color has been chosen by selecting the "Default Color" button (true or false) Default value is |
getShowRecentColorsSection |
Gets current value of property showRecentColorsSection. Indicates if the Recent Colors section is available Default value is |
setColorPickerSelectedColor |
Sets a selected color for the ColorPicker control. |
setColors |
Sets a new value for property colors. Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors. When called with a value of Default value is |
setDefaultColor |
Sets a new value for property defaultColor. The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect. When called with a value of |
setDisplayMode |
Sets a new value for property displayMode. Determines the When called with a value of Default value is |
setShowDefaultColorButton |
Sets a new value for property showDefaultColorButton. Indicates if the button for default color selection is available. When called with a value of Default value is |
setShowMoreColorsButton |
Sets a new value for property showMoreColorsButton. Denotes if the color has been chosen by selecting the "Default Color" button (true or false) When called with a value of Default value is |
setShowRecentColorsSection |
Sets a new value for property showRecentColorsSection. Indicates if the Recent Colors section is available When called with a value of Default value is |
Attaches event handler fnFunction
to the colorSelect event of this sap.m.ColorPalettePopover
.
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.m.ColorPalettePopover
itself.
Fired when the user selects a color.
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 |
Attaches event handler fnFunction
to the liveChange event of this sap.m.ColorPalettePopover
.
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.m.ColorPalettePopover
itself.
Fired when the value is changed by user interaction in the internal ColorPicker of the ColorPalette
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 colorSelect event of this sap.m.ColorPalettePopover
.
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 |
Detaches event handler fnFunction
from the liveChange event of this sap.m.ColorPalettePopover
.
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.m.ColorPalettePopover 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 |
Fires event colorSelect to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
value | sap.ui.core.CSSColor |
The color that is returned when user chooses the "Default Color" button. |
|
defaultAction | boolean |
Denotes if the color has been chosen by selecting the "Default Color" button (true or false). |
Fires event liveChange to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
r | int |
Parameter containing the RED value (0-255). |
|
g | int |
Parameter containing the GREEN value (0-255). |
|
b | int |
Parameter containing the BLUE value (0-255). |
|
h | int |
Parameter containing the HUE value (0-360). |
|
s | int |
Parameter containing the SATURATION value (0-100). |
|
v | int |
Parameter containing the VALUE value (0-100). |
|
l | int |
Parameter containing the LIGHTNESS value (0-100). |
|
hex | string |
Parameter containing the Hexadecimal string (#FFFFFF). |
|
alpha | string |
Parameter containing the alpha value (transparency). |
Gets current value of property colors.
Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors.
Default value is ["gold", "darkorange", "indianred", "darkmagenta", "cornflowerblue", "deepskyblue", "darkcyan", "olivedrab", "darkslategray", "azure", "white", "lightgray", "darkgray", "dimgray", "black"]
.
Gets current value of property defaultColor.
The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect.
Gets current value of property displayMode.
Determines the displayMode
of the ColorPicker
among three types - Default, Large and Simplified
Default value is Default
.
Returns a metadata object for class sap.m.ColorPalettePopover.
Gets current value of property showDefaultColorButton.
Indicates if the button for default color selection is available.
Default value is true
.
Gets current value of property showMoreColorsButton.
Denotes if the color has been chosen by selecting the "Default Color" button (true or false)
Default value is true
.
Gets current value of property showRecentColorsSection.
Indicates if the Recent Colors section is available
Default value is true
.
Sets a selected color for the ColorPicker control.
Param | Type | DefaultValue | Description |
---|---|---|---|
color | sap.ui.core.CSSColor |
the selected color |
Sets a new value for property colors.
Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is ["gold", "darkorange", "indianred", "darkmagenta", "cornflowerblue", "deepskyblue", "darkcyan", "olivedrab", "darkslategray", "azure", "white", "lightgray", "darkgray", "dimgray", "black"]
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sColors | sap.ui.core.CSSColor[] | ["gold", "darkorange", "indianred", "darkmagenta", "cornflowerblue", "deepskyblue", "darkcyan", "olivedrab", "darkslategray", "azure", "white", "lightgray", "darkgray", "dimgray", "black"] |
New value for property |
Sets a new value for property defaultColor.
The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDefaultColor | sap.ui.core.CSSColor |
New value for property |
Sets a new value for property displayMode.
Determines the displayMode
of the ColorPicker
among three types - Default, Large and Simplified
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Default
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDisplayMode | sap.ui.unified.ColorPickerDisplayMode | Default |
New value for property |
Sets a new value for property showDefaultColorButton.
Indicates if the button for default color selection is available.
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 |
---|---|---|---|
bShowDefaultColorButton | boolean | true |
New value for property |
Sets a new value for property showMoreColorsButton.
Denotes if the color has been chosen by selecting the "Default Color" button (true or false)
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 |
---|---|---|---|
bShowMoreColorsButton | boolean | true |
New value for property |
Sets a new value for property showRecentColorsSection.
Indicates if the Recent Colors section is available
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 |
---|---|---|---|
bShowRecentColorsSection | boolean | true |
New value for property |