Class PasteFileHandler.SessionBuilder
java.lang.Object
com.vaadin.flow.component.clipboard.PasteFileHandler.SessionBuilder
- All Implemented Interfaces:
Serializable
- Enclosing class:
PasteFileHandler
Fluent builder for the session-style paste handler. See
PasteFileHandler.session() for the listener semantics. Successive
calls to the same onX method overwrite earlier registrations;
omitted steps default to no-ops.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns anUploadHandlerthat orchestrates the configured session steps.onComplete(SerializableConsumer<PasteComplete> handler) Registers theonCompletestep, fired once after the paste's declared file count has been delivered toonFile.onFile(SerializableConsumer<PasteFile> handler) Registers theonFilestep, fired once per accepted file with the file's bytes and metadata.onStart(SerializableConsumer<PasteStart> handler) Registers theonStartstep, fired once per paste before the paste's firstPasteFileis delivered.
-
Method Details
-
onStart
Registers theonStartstep, fired once per paste before the paste's firstPasteFileis delivered.- Parameters:
handler- consumer invoked on the UI thread; passnullto reset to a no-op- Returns:
- this builder
-
onFile
Registers theonFilestep, fired once per accepted file with the file's bytes and metadata.- Parameters:
handler- consumer invoked on the UI thread; passnullto reset to a no-op- Returns:
- this builder
-
onComplete
Registers theonCompletestep, fired once after the paste's declared file count has been delivered toonFile.- Parameters:
handler- consumer invoked on the UI thread; passnullto reset to a no-op- Returns:
- this builder
-
build
Returns anUploadHandlerthat orchestrates the configured session steps. The returned handler is independent of this builder; further mutations to the builder do not affect it.
-