Class PdfViewer.DocumentLoadEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<PdfViewer>
com.vaadin.flow.component.pdfviewer.PdfViewer.DocumentLoadEvent
- All Implemented Interfaces:
Serializable
- Enclosing class:
PdfViewer
@DomEvent("document-load")
public static class PdfViewer.DocumentLoadEvent
extends ComponentEvent<PdfViewer>
Event fired when a document has been loaded, before its pages are shown.
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionDocumentLoadEvent(PdfViewer source, boolean fromClient, int pageCount, String title) Creates a new event. -
Method Summary
Modifier and TypeMethodDescriptionintGets the number of pages in the document.getTitle()Gets the title of the document from its metadata.Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, getUI, isFromClient, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
Constructor Details
-
DocumentLoadEvent
public DocumentLoadEvent(PdfViewer source, boolean fromClient, @EventData("event.detail.pageCount") int pageCount, @EventData("event.detail.title") String title) Creates a new event.- Parameters:
source- the source componentfromClient-trueif the event originated from the clientpageCount- the number of pages in the documenttitle- the title of the document, or an empty string if it has none
-
-
Method Details
-
getPageCount
public int getPageCount()Gets the number of pages in the document.- Returns:
- the number of pages
-
getTitle
Gets the title of the document from its metadata.- Returns:
- the title, or an empty string if the document has no title
-