Package com.storedobject.ui.util
Class DocumentViewer
java.lang.Object
com.vaadin.flow.component.Component
com.storedobject.vaadin.AbstractResourcedComponent
com.storedobject.vaadin.PDFViewer
com.storedobject.ui.util.DocumentViewer
- All Implemented Interfaces:
HasSize,ResourcedComponent,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.component.ComponentGet the viewer component.voidsetDocument(ContentProducer contentProducer) Set the document to be viewed.voidsetDocument(Id streamDataId) Set the document to be viewed.voidsetDocument(StreamData streamData) Set the document to be viewed.voidsetExtraButtons(com.vaadin.flow.component.Component... extraButtons) Set extra buttons to be added to the view.voidsetOnViewClose(Runnable onViewClose) Set a runnable to be executed when the view is closed.voidSet the file to view.voidsetWindowMode(boolean windowMode) Set the window mode.voidView the document.static voidView a media file.static voidview(String caption, MediaFile mediaFile, boolean windowMode, com.vaadin.flow.component.Component[] extraButtons) View a media file.static voidview(String caption, MediaFile mediaFile, boolean windowMode, Runnable onViewClose, com.vaadin.flow.component.Component[] extraButtons) View a media file.Methods inherited from class com.storedobject.vaadin.PDFViewer
getURIAttributeName, initMethods inherited from class com.storedobject.vaadin.AbstractResourcedComponent
clear, onAttach, onDetach, setSource, setURIMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
DocumentViewer
Constructor.- Parameters:
listener- Listener to be notified when the source is set.
-
-
Method Details
-
view
-
view
public static void view(String caption, MediaFile mediaFile, boolean windowMode, com.vaadin.flow.component.Component[] extraButtons) View a media file.- Parameters:
caption- Caption.mediaFile- Media file.windowMode- Whether to open in a window or not.extraButtons- Extra buttons to be added to the view.
-
view
public static void view(String caption, MediaFile mediaFile, boolean windowMode, Runnable onViewClose, com.vaadin.flow.component.Component[] extraButtons) View a media file.- Parameters:
caption- Caption.mediaFile- Media file.windowMode- Whether to open in a window or not.onViewClose- Runnable to be executed when the view is closed.extraButtons- Extra buttons to be added to the view.
-
setSource
Description copied from class:AbstractResourcedComponentSet the file to view.- Overrides:
setSourcein classAbstractResourcedComponent- Parameters:
fileURL- URL of the file to view
-
setWindowMode
public void setWindowMode(boolean windowMode) Set the window mode.- Parameters:
windowMode- True for window mode.
-
setExtraButtons
public void setExtraButtons(com.vaadin.flow.component.Component... extraButtons) Set extra buttons to be added to the view.- Parameters:
extraButtons- Extra buttons.
-
setOnViewClose
Set a runnable to be executed when the view is closed.- Parameters:
onViewClose- Runnable.
-
setDocument
Set the document to be viewed.- Parameters:
streamDataId- ID of the stream data.
-
setDocument
Set the document to be viewed.- Parameters:
streamData- Stream data.
-
view
-
setDocument
Set the document to be viewed.- Parameters:
contentProducer- Content producer.
-
getViewerComponent
public com.vaadin.flow.component.Component getViewerComponent()Get the viewer component.- Returns:
- Viewer component.
-