@Tag(value="details") public class NativeDetails extends HtmlComponent implements ClickNotifier<NativeDetails>
<details> element.| Modifier and Type | Class and Description |
|---|---|
static class |
NativeDetails.Summary
Component representing a
<summary> element. |
static class |
NativeDetails.ToggleEvent
Represents the DOM event "toggle".
|
| Constructor and Description |
|---|
NativeDetails()
Creates a new details with an empty summary.
|
NativeDetails(Component summaryContent)
Creates a new details with the given content of the summary.
|
NativeDetails(Component summaryContent,
Component content)
Creates a new details using the provided summary content and content.
|
NativeDetails(String summary)
Creates a new details with the given summary.
|
NativeDetails(String summary,
Component content)
Creates a new details using the provided summary and content.
|
| Modifier and Type | Method and Description |
|---|---|
Registration |
addToggleListener(ComponentEventListener<NativeDetails.ToggleEvent> listener)
Adds a listener for
toggle events fired by the details, which are
dispatched to the details element whenever its state changes between open
and closed. |
Component |
getContent()
Returns the details content which was set via
setContent(Component). |
NativeDetails.Summary |
getSummary()
Returns
NativeDetails.Summary component associated with this details. |
String |
getSummaryText()
Returns the textual summary of this details.
|
boolean |
isOpen()
Return whether or not the details is opened and the content is displayed.
|
void |
setContent(Component content)
Sets the details content and removes the previously set content.
|
void |
setOpen(boolean open)
Sets whether or not the details should be opened.
|
void |
setSummary(Component... summaryContent)
Sets the components of the summary.
|
void |
setSummaryText(String summary)
Sets the text of the summary.
|
getTitle, setTitleaddListener, 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, waitaddClickListener, addClickShortcutgetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFulladdClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNamegetElementaddAttachListeneraddDetachListenerpublic NativeDetails()
public NativeDetails(String summary)
summary - the summary to set.public NativeDetails(Component summaryContent)
summaryContent - the summary content to set.public NativeDetails(String summary, Component content)
summary - the summary text to set.content - the content component to set.public NativeDetails.Summary getSummary()
NativeDetails.Summary component associated with this details.public String getSummaryText()
nullElement.getText()public void setSummaryText(String summary)
summary - the summary text to set.getSummary()public void setSummary(Component... summaryContent)
summaryContent - the summary content to set.getSummary()public Component getContent()
setContent(Component).null.public void setContent(Component content)
content - the content of the details to setgetContent()@Synchronize(property="open", value="toggle") public boolean isOpen()
public void setOpen(boolean open)
true if the
details should be opened and the content should be displayed,
false to collapse it.open - the boolean value to setpublic Registration addToggleListener(ComponentEventListener<NativeDetails.ToggleEvent> listener)
toggle events fired by the details, which are
dispatched to the details element whenever its state changes between open
and closed.
Note: This event is always triggered on client side. Resulting in
isFromClient() to always return true.
listener - the listenerRegistration for removing the event listenerCopyright © 2000–2025 Vaadin Ltd. All rights reserved.