Provides cross-platform paste capabilities for the sap.m.Button
control which allows the user to initiate a paste action.
Constructor for a new PasteProvider plugin.
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.plugins.PasteProvider(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new |
|
mSettings? | object | Initial settings for the |
Name | Cardinality | Type | Description |
---|---|---|---|
pasteFor | 0..1 | sap.ui.core.Control |
Defines the control which the paste is associated with. |
Event | Description |
---|---|
paste |
This event gets fired when the user pastes content from the clipboard or when the Paste button is pressed if the clipboard access has already been granted. Pasting can be done via the paste feature of the mobile device or the standard paste keyboard shortcut while the popover is open. By default, a synthetic Listeners may prevent the default action of this event by calling the |
This event gets fired when the user pastes content from the clipboard or when the Paste button is pressed if the clipboard access has already been granted. Pasting can be done via the paste feature of the mobile device or the standard paste keyboard shortcut while the popover is open. By default, a synthetic Clipboard
event that represents the paste data gets dispatched for the control defined in the pasteFor
association. To avoid this, call preventDefault
on the event instance.
Listeners may prevent the default action of this event by calling the preventDefault
method on the event object.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
data | string[][] |
Two-dimentional array of strings with data from the clipboard. The first dimension represents the rows, and the second dimension represents the cells of the tabular data. |
text | string |
The text data, with all special characters, from the clipboard. |
Method | Description |
---|---|
attachPaste |
Attaches event handler When called, the context of the event handler (its This event gets fired when the user pastes content from the clipboard or when the Paste button is pressed if the clipboard access has already been granted. Pasting can be done via the paste feature of the mobile device or the standard paste keyboard shortcut while the popover is open. By default, a synthetic |
detachPaste |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.m.plugins.PasteProvider.extend |
Creates a new subclass of class sap.m.plugins.PasteProvider with name
|
firePaste |
Fires event paste to attached listeners. Listeners may prevent the default action of this event by calling the |
sap.m.plugins.PasteProvider.getMetadata |
Returns a metadata object for class sap.m.plugins.PasteProvider. |
getPasteFor |
ID of the element which is the current target of the association pasteFor, or |
setPasteFor |
Sets the associated pasteFor. |
Attaches event handler fnFunction
to the paste event of this sap.m.plugins.PasteProvider
.
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.plugins.PasteProvider
itself.
This event gets fired when the user pastes content from the clipboard or when the Paste button is pressed if the clipboard access has already been granted. Pasting can be done via the paste feature of the mobile device or the standard paste keyboard shortcut while the popover is open. By default, a synthetic Clipboard
event that represents the paste data gets dispatched for the control defined in the pasteFor
association. To avoid this, call preventDefault
on the event instance.
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 paste event of this sap.m.plugins.PasteProvider
.
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.plugins.PasteProvider 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 paste to attached listeners.
Listeners may prevent the default action of this event by calling the preventDefault
method on the event object. The return value of this method indicates whether the default action should be executed.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
data | string[][] |
Two-dimentional array of strings with data from the clipboard. The first dimension represents the rows, and the second dimension represents the cells of the tabular data. |
|
text | string |
The text data, with all special characters, from the clipboard. |
Returns a metadata object for class sap.m.plugins.PasteProvider.
Sets the associated pasteFor.
Param | Type | DefaultValue | Description |
---|---|---|---|
oPasteFor | sap.ui.core.ID sap.ui.core.Control |
ID of an element which becomes the new target of this pasteFor association; alternatively, an element instance may be given |