Record Class PasteOptions
java.lang.Object
java.lang.Record
com.vaadin.flow.component.clipboard.PasteOptions
- Record Components:
includeInputFieldPastes- whether to forward pastes whose composed path crosses an editable target (<input>,<textarea>, or an element withcontenteditable). Thedefaults()factory sets this tofalse— pastes into a focused form field, including a focused field inside a Vaadin web component's shadow DOM, are skipped — which is typically what page-wide listeners want. TheincludingInputFields()factory sets this totrue, so the listener observes every paste regardless of focus; this is also the default when no options are passed toClipboard.onPaste(Component, SerializableConsumer).
- All Implemented Interfaces:
Serializable
Configuration for
Clipboard.onPaste.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPasteOptions(boolean includeInputFieldPastes) Creates an instance of aPasteOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic PasteOptionsdefaults()Returns the default options: editable-target pastes are skipped.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theincludeInputFieldPastesrecord component.static PasteOptionsfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PasteOptions
public PasteOptions(boolean includeInputFieldPastes) Creates an instance of aPasteOptionsrecord class.- Parameters:
includeInputFieldPastes- the value for theincludeInputFieldPastesrecord component
-
-
Method Details
-
defaults
Returns the default options: editable-target pastes are skipped.- Returns:
- default options, equivalent to
new PasteOptions(false)
-
includingInputFields
- Returns:
- options that also forward pastes targeting input fields, text
areas, and
contenteditableelements; equivalent tonew PasteOptions(true).
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
includeInputFieldPastes
public boolean includeInputFieldPastes()Returns the value of theincludeInputFieldPastesrecord component.- Returns:
- the value of the
includeInputFieldPastesrecord component
-