Package com.storedobject.ui
Class TemplateLayout
java.lang.Object
com.vaadin.flow.component.Component
com.storedobject.ui.util.HtmlTemplate
com.storedobject.ui.TemplateLayout
- All Implemented Interfaces:
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
- Direct Known Subclasses:
TemplateComponent
,TemplateView
A layout
Component
based on a template stored in the DB as an HTML like file -
It should be stored as TextContent
. The template can contain HTML tags (and thus,
Vaadin component tags too) and if any image resources are referenced, respective
MediaFile
s must be used just like in HTMLView
. For CSS styling the content,
style tag should be used and if used, it should be used only once. If style tags are specified more than once,
* only the first one is considered and the rest are ignored.
A separate constructor is available if you want to provide the content directly. See
TemplateLayout(Supplier)
.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.ui.util.HtmlTemplate
HtmlTemplate.ComponentCreator, HtmlTemplate.StreamSupplier, HtmlTemplate.StyleSupplier
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.TemplateLayout
(String textContentName) Constructor.TemplateLayout
(Supplier<String> contentSupplier) Constructor. -
Method Summary
Methods inherited from class com.storedobject.ui.util.HtmlTemplate
build, clearCache, createComponentForId, createComponentForId, isCreated, onAttach, setComponentCreator, setView
Methods 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, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
TemplateLayout
public TemplateLayout()Constructor. The template content will be determined from the class name. -
TemplateLayout
Constructor.- Parameters:
textContentName
- Name of the template content.
-
TemplateLayout
-
TemplateLayout
-
-
Method Details
-
center
public void center()Center thisView
on the screen.
-