Class ImageBlobInput
java.lang.Object
com.vaadin.flow.component.trigger.internal.Action.Input<Object>
com.vaadin.flow.component.trigger.internal.ImageBlobInput
- All Implemented Interfaces:
Serializable
Input that produces the source
<img> element of a component, for use
as the image slot of WriteToClipboardAction. The TS helper
(window.Vaadin.Flow.clipboard.writePayload) re-encodes it to
image/png via a canvas round-trip — the only image MIME type every
browser's asynchronous Clipboard API accepts on write.
The Java type parameter is purely a marker: the value never crosses the
network — the action calls the TS helper with the live Element
reference and the canvas conversion happens entirely on the client.
For internal use only. May be renamed or removed in a future release.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionImageBlobInput(Component source) Creates an image input that yields the given component's root element as the source<img>.ImageBlobInput(Element source) Creates an image input that yields the given element as the source<img>. -
Method Summary
Modifier and TypeMethodDescriptionprotected JsFunctionBuilds theJsFunctionthat yields this input's value when called.
-
Constructor Details
-
ImageBlobInput
Creates an image input that yields the given component's root element as the source<img>.- Parameters:
source- the component carrying the<img>root element, notnull; its root tag must beimg- Throws:
IllegalArgumentException- if the source's root element is not an<img>
-
ImageBlobInput
Creates an image input that yields the given element as the source<img>.- Parameters:
source- the source<img>element, notnull; its tag must beimg- Throws:
IllegalArgumentException- if the source element is not an<img>
-
-
Method Details
-
toJs
Description copied from class:Action.InputBuilds theJsFunctionthat yields this input's value when called. The function may takeeventas a runtime argument (declared by the subclass viaJsFunction.withArguments(String...)); inputs that don't needeventsimply omit the declaration and ignore the argument the caller passes.- Specified by:
toJsin classAction.Input<Object>- Parameters:
trigger- the surrounding trigger this render is for, notnull- Returns:
- the input's JS function, not
null
-