Class ExpandableSection
java.lang.Object
org.patternfly.component.BaseComponent<HTMLDivElement, ExpandableSection>
org.patternfly.component.expandable.ExpandableSection
- All Implemented Interfaces:
Attachable, ElementAttributeMethods<HTMLDivElement, ExpandableSection>, ElementClassListMethods<HTMLDivElement, ExpandableSection>, ElementConsumerMethods<HTMLDivElement, ExpandableSection>, ElementContainerMethods<HTMLDivElement, ExpandableSection>, ElementEventMethods<HTMLDivElement, ExpandableSection>, ElementIdMethods<HTMLDivElement, ExpandableSection>, ElementQueryMethods<HTMLDivElement>, HTMLElementAttributeMethods<HTMLDivElement, ExpandableSection>, HTMLElementDataMethods<HTMLDivElement, ExpandableSection>, HTMLElementStyleMethods<HTMLDivElement, ExpandableSection>, HTMLElementVisibilityMethods<HTMLDivElement, ExpandableSection>, IsElement<HTMLDivElement>, TypedBuilder<HTMLDivElement, ExpandableSection>, Component, Expandable<HTMLDivElement, ExpandableSection>
public class ExpandableSection
extends BaseComponent<HTMLDivElement, ExpandableSection>
implements Attachable, Expandable<HTMLDivElement, ExpandableSection>
An expandable section component is used to support progressive disclosure in a form or page by hiding additional content when
you don't want it to be shown by default. An expandable section can contain any type of content such as plain text, form
inputs, and charts.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionadd(ExpandableSectionContent content) add(ExpandableSectionToggle toggle) addContent(ExpandableSectionContent content) addToggle(ExpandableSectionToggle toggle) voidattach(MutationRecord mutationRecord) voidcollapse(boolean fireEvent) content()detached()Make this expandable section detached from another one.Same as disclosure(true)disclosure(boolean disclosure) Adds/removes the disclosure modifiersvoidexpand(boolean fireEvent) static ExpandableSectionstatic ExpandableSectionCreates and returns a new instance ofExpandableSectionwith the specified ID.indented()Same as indented(true)indented(boolean indented) Adds/removes modifier(indented)onToggle(ToggleHandler<ExpandableSection> toggleHandler) that()truncate()Same as truncate(3)truncate(int truncate) Adds modifier(truncate)Methods inherited from class BaseComponent
componentType, element, registerComponentMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Attachable
detachMethods inherited from interface ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface ElementConsumerMethods
apply, runMethods inherited from interface ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface ElementEventMethods
on, on, onMethods inherited from interface ElementIdMethods
id, uniqueIdMethods inherited from interface ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface HTMLElementAttributeMethods
titleMethods inherited from interface HTMLElementDataMethods
data, dataMethods inherited from interface HTMLElementVisibilityMethods
hidden
-
Field Details
-
DEFAULT_TRUNCATE
public static final int DEFAULT_TRUNCATE- See Also:
-
-
Method Details
-
expandableSection
-
expandableSection
Creates and returns a new instance ofExpandableSectionwith the specified ID.If you want to create a detached expandable section, you must use the same ID for the two expandable sections, one containing the
ExpandableSectionToggleand one containing theExpandableSectionContent.stack().gutter() .addItem(stackItem() .add(expandableSection("detached-expandable-section") .detached() .addContent(expandableSectionContent() .text("This content is visible only when the component is expanded.")))) .addItem(stackItem() .add(expandableSection("detached-expandable-section") .detached() .addToggle(expandableSectionToggle("Show more", "Show less"))));- Parameters:
id- the unique identifier for the expandable section- Returns:
- a new instance of
ExpandableSectioninitialized with the provided ID
-
attach
- Specified by:
attachin interfaceAttachable
-
addToggle
-
add
-
addContent
-
add
-
detached
Make this expandable section detached from another one. Must be called on both the expandable section containing theExpandableSectionToggleand the expandable section containing theExpandableSectionContent.stack().gutter() .addItem(stackItem() .add(expandableSection("detached-expandable-section") .detached() .addContent(expandableSectionContent() .text("This content is visible only when the component is expanded.")))) .addItem(stackItem() .add(expandableSection("detached-expandable-section") .detached() .addToggle(expandableSectionToggle("Show more", "Show less")))); -
indented
Same as indented(true) -
indented
Adds/removes modifier(indented) -
disclosure
Same as disclosure(true) -
disclosure
Adds/removes the disclosure modifiers -
truncate
Same as truncate(3) -
truncate
Adds modifier(truncate) -
that
- Specified by:
thatin interfaceTypedBuilder<HTMLDivElement, ExpandableSection>
-
onToggle
-
collapse
public void collapse(boolean fireEvent) - Specified by:
collapsein interfaceExpandable<HTMLDivElement, ExpandableSection>
-
expand
public void expand(boolean fireEvent) - Specified by:
expandin interfaceExpandable<HTMLDivElement, ExpandableSection>
-
content
-