class sap.m.plugins.PasteProvider

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/m/plugins/PasteProvider
Application Component: CA-UI5-TBL

Provides cross-platform paste capabilities for the sap.m.Button control which allows the user to initiate a paste action.


Constructor

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 PasteProvider, generated automatically if no ID is given

mSettings? object

Initial settings for the PasteProvider


Associations

Name Cardinality Type Description
pasteFor 0..1 sap.ui.core.Control

Defines the control which the paste is associated with.


Events Overview

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

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


Methods Overview

Method Description
attachPaste

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.

detachPaste

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.

sap.m.plugins.PasteProvider.extend

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.

firePaste

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.

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 null.

setPasteFor

Sets the associated pasteFor.

attachPaste

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 sap.m.plugins.PasteProvider itself

detachPaste

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

sap.m.plugins.PasteProvider.extend

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

firePaste

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.

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 null.

setPasteFor

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