Class ClipboardContent
java.lang.Object
com.vaadin.flow.component.clipboard.ClipboardContent
- All Implemented Interfaces:
Serializable
Multi-format payload for
ClipboardBinding.write(com.vaadin.flow.component.clipboard.ClipboardContent). Any combination of
text/plain and text/html can be set; each accessor returns
null when the corresponding slot is empty.
Use the static factory:
Clipboard.onClick(button)
.write(ClipboardContent.create().text("Hello").html("<b>Hello</b>"));
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClipboardContentcreate()Creates a new empty content builder.Sets the HTML to be written to the clipboard.<C extends Component & HasValue<?,String>>
ClipboardContenttext(C source) Sets the plain text to be written to the clipboard, taken from thevalueproperty of the given component (typically an input field).Sets the plain text to be written to the clipboard.
-
Method Details
-
create
Creates a new empty content builder.- Returns:
- a new builder
-
text
Sets the plain text to be written to the clipboard.- Parameters:
literal- the value, notnull- Returns:
- this builder
-
text
Sets the plain text to be written to the clipboard, taken from thevalueproperty of the given component (typically an input field). The value is read on the client when the trigger fires.- Type Parameters:
C- component type implementingHasValue<?, String>- Parameters:
source- the component whosevalueproperty should be read, notnull- Returns:
- this builder
-
html
Sets the HTML to be written to the clipboard.- Parameters:
literal- the value, notnull- Returns:
- this builder
-