@Tag(value="div") @Theme(value=com.vaadin.flow.theme.lumo.Lumo.class) @StyleSheet(value="src/css/demo.css") @StyleSheet(value="src/css/prism.css") @JavaScript(value="src/script/prism.js") public abstract class DemoView extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasComponents, com.vaadin.flow.router.HasUrlParameter<String>, com.vaadin.flow.component.HasStyle
| Modifier | Constructor and Description |
|---|---|
protected |
DemoView() |
| Modifier and Type | Method and Description |
|---|---|
Card |
addCard(String heading,
com.vaadin.flow.component.Component... components)
Creates and adds a new component card to the "Basic usage" tab in the
view.
|
Card |
addCard(String tabName,
String heading,
com.vaadin.flow.component.Component... components)
Creates and adds a new component card to a specific tab in the view.
|
protected abstract void |
initView()
Builds the content of the view.
|
protected void |
onAttach(com.vaadin.flow.component.AttachEvent attachEvent) |
void |
populateSources()
When called the view should populate the given SourceContainer with
sample source code to be shown.
|
void |
setParameter(com.vaadin.flow.router.BeforeEvent event,
String parameter) |
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
onAttach in class com.vaadin.flow.component.Componentprotected abstract void initView()
public void populateSources()
public Card addCard(String heading, com.vaadin.flow.component.Component... components)
heading - the header text of the card, that is added to the layout. If
null or empty, the header is not addedcomponents - components to add on creation. If null or empty,
the card is created without the components insideaddCard(String, String, Component...)public Card addCard(String tabName, String heading, com.vaadin.flow.component.Component... components)
The href of the tab is defined based on the tab name. For example, a tab named "Advanced usage" has the "advanced-tab" as href (all in lower case and with "-" in place of spaces and special characters).
tabName - the name of the tab that will contain the demo, not
nullheading - the header text of the card, that is added to the layout. If
null or empty, the header is not addedcomponents - components to add on creation. If null or empty,
the card is created without the components insideCopyright © 2000–2021 Vaadin Ltd. All rights reserved.