@Tag(value="vaadin-details") @HtmlImport(value="frontend://bower_components/vaadin-details/src/vaadin-details.html") public class Details extends Component implements HasEnabled, HasTheme
Modifier and Type | Class and Description |
---|---|
static class |
Details.OpenedChangeEvent |
Constructor and Description |
---|
Details()
Initializes a new Details component.
|
Details(Component summary,
Component content)
Initializes a new Details using the provided summary and content.
|
Details(String summary,
Component content)
Initializes a new Details using the provided summary and content.
|
Modifier and Type | Method and Description |
---|---|
void |
addContent(Component... components)
Adds components to the content section
|
Registration |
addOpenedChangeListener(ComponentEventListener<Details.OpenedChangeEvent> listener)
Adds a listener for
opened-changed events fired by the
webcomponent. |
void |
addThemeVariants(DetailsVariant... variants)
Adds theme variants to the component.
|
Stream<Component> |
getContent()
Returns the content components which were added via
setContent(Component)
or via addContent(Component...) |
Component |
getSummary()
Returns summary component which was set via
setSummary(Component)
or setSummaryText(String) |
String |
getSummaryText() |
boolean |
isOpened()
|
void |
removeThemeVariants(DetailsVariant... variants)
Removes theme variants from the component.
|
void |
setContent(Component content)
Sets the component content
|
void |
setOpened(boolean opened)
True if the details are opened and the content is displayed
|
void |
setSummary(Component summary)
Sets the component summary
|
void |
setSummaryText(String summary)
Creates a text wrapper and sets a summary via
setSummary(Component) |
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEnabled, setEnabled
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
getElement
addAttachListener
addDetachListener
public Details()
public Details(String summary, Component content)
summary
- the summary text to set.content
- the content component to set.setSummaryText(String)
,
setContent(Component)
public Details(Component summary, Component content)
summary
- the summary component to set.content
- the content component to set.setSummary(Component)
,
setContent(Component)
public void setSummary(Component summary)
summary
- the summary component to set, or null
to remove
any previously set summarygetSummary()
public Component getSummary()
setSummary(Component)
or setSummaryText(String)
null
if nothing was setpublic void setSummaryText(String summary)
setSummary(Component)
public String getSummaryText()
public void setContent(Component content)
content
- the content of the component to set, or null
to remove
any previously set contentgetContent()
public void addContent(Component... components)
components
- the components to addgetContent()
public Stream<Component> getContent()
setContent(Component)
or via addContent(Component...)
@Synchronize(property="opened", value="opened-changed") public boolean isOpened()
public void setOpened(boolean opened)
True if the details are opened and the content is displayed
opened
- the boolean value to setpublic void addThemeVariants(DetailsVariant... variants)
variants
- theme variants to addpublic void removeThemeVariants(DetailsVariant... variants)
variants
- theme variants to removepublic Registration addOpenedChangeListener(ComponentEventListener<Details.OpenedChangeEvent> listener)
opened-changed
events fired by the
webcomponent.listener
- the listenerRegistration
for removing the event listenerCopyright © 2019. All rights reserved.