Package com.storedobject.vaadin
Class Viewer
java.lang.Object
com.storedobject.vaadin.View
com.storedobject.vaadin.Viewer
- All Implemented Interfaces:
ClickHandler,CloseableView,ExecutableView,ValueChangeHandler,com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<? extends com.vaadin.flow.component.Component>>,com.vaadin.flow.component.HasValue.ValueChangeListener,Serializable,Runnable,EventListener
- Direct Known Subclasses:
HTMLView
A helper
View class that is used to view a single component.- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.storedobject.vaadin.ClickHandler
ClickHandler.ModifiedClickEvent<C extends com.vaadin.flow.component.Component> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected WindowcreateWindow(com.vaadin.flow.component.Component component) Create the "window" to show the content.protected WindowDecoratorCreate the "window decorator" to decorate the content window.voidDecorate the component to remove the default padding.protected intGet the height of the view (as a percentage).protected intGet the width of the view (as a percentage).Methods inherited from class com.storedobject.vaadin.View
abort, aborted, addClosedListener, addOpenedListener, clean, close, createCloseableView, execute, execute, execute, executing, focus, focus, focusAny, getApplication, getCaption, getComponent, getContent, getCreatedBy, getEmbeddedView, getMenuItem, getMenuItem, getView, initUI, invoke, isFullScreen, isScrollable, isWindowMode, select, setCaption, setComponent, setCreatedBy, setDefaultPadding, setEmbeddedView, setFirstFocus, setFullScreen, setScrollable, setWindowMode, skipFirstFocusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClickedMethods inherited from interface com.storedobject.vaadin.ExecutableView
clearAlerts, clicked, createMenuItem, error, getMenuIconName, getView, isCloseable, isHomeView, log, log, message, returnedFrom, run, setClickable, speak, trackValueChange, tray, valueChanged, warningMethods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Constructor Details
-
Viewer
-
Viewer
Constructor.- Parameters:
component- Component to set.caption- Caption.windowMode- Whether to shown as a pop-window or not.
-
-
Method Details
-
createWindow
Create the "window" to show the content. This is invoked to obtain theWindowcomponent only if theViewhas to appear as a popped-up window. The window will have a size of 80vw X 80vh by default unless the methodsgetViewWidth()andgetViewHeight()are overridden.- Overrides:
createWindowin classView- Parameters:
component- Component containing the actual content to display.- Returns:
- A window containing the content that is passed.
-
createWindowDecorator
-
getViewWidth
protected int getViewWidth()Get the width of the view (as a percentage). Default is 80.- Returns:
- Percentage width of the view.
-
getViewHeight
protected int getViewHeight()Get the height of the view (as a percentage). Default is 80.- Returns:
- Percentage height of the view.
-
decorateComponent
public void decorateComponent()Decorate the component to remove the default padding.- Overrides:
decorateComponentin classView
-