@Tag(value="vaadin-details") @NpmPackage(value="@vaadin/vaadin-details", version="1.2.1") @JsModule(value="@vaadin/vaadin-details/src/vaadin-details.js") public class Details extends Component implements HasEnabled, HasTheme, HasStyle
| 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 to get notified when the opened state of the component
changes.
|
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, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisEnabled, setEnabledaddThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNamegetElementaddAttachListeneraddDetachListenerpublic 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)
listener - the listenerRegistration for removing the event listenerCopyright © 2025. All rights reserved.