Package org.patternfly.component.alert
Class Alert
- java.lang.Object
-
- org.patternfly.component.BaseComponent<HTMLDivElement,Alert>
-
- org.patternfly.component.alert.Alert
-
- All Implemented Interfaces:
Attachable,Container<HTMLDivElement,Alert>,Finder<HTMLDivElement>,HasElement<HTMLDivElement,Alert>,HasHTMLElement<HTMLDivElement,Alert>,IsElement<HTMLDivElement>,TypedBuilder<HTMLDivElement,Alert>,Component,ComponentReference<AlertGroup>,Closeable<HTMLDivElement,Alert>,Expandable<HTMLDivElement,Alert>,Modifiers.Inline<HTMLDivElement,Alert>,Modifiers.Plain<HTMLDivElement,Alert>
public class Alert extends BaseComponent<HTMLDivElement,Alert> implements Modifiers.Inline<HTMLDivElement,Alert>, Modifiers.Plain<HTMLDivElement,Alert>, Closeable<HTMLDivElement,Alert>, Expandable<HTMLDivElement,Alert>, Attachable, ComponentReference<AlertGroup>
An alert is a notification that provides brief information to the user without blocking their workflow.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_TIMEOUT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Alertadd(AlertActionGroup actionGroup)Alertadd(AlertDescription description)AlertaddActionGroup(AlertActionGroup actionGroup)AlertaddDescription(String description)Wraps the description inside a<p/>element, adds it to aAlertDescriptionand finally adds it to this alert.AlertaddDescription(AlertDescription description)static Alertalert(AlertType type, String title)AlertariaCloseLabel(String label)AlertariaLabel(String label)voidattach(MutationRecord mutationRecord)Alertclosable()Alertclosable(CloseHandler<Alert> closeHandler)voidclose(Event event, boolean fireEvent)voidcollapse(boolean fireEvent)AlertcustomIcon(String iconClass)AlertcustomIcon(InlineIcon icon)AlertcustomIcon(PredefinedIcon icon)voiddetach(MutationRecord mutationRecord)voidexpand(boolean fireEvent)Alertexpandable()Alertexpandable(ToggleHandler<Alert> toggleHandler)AlertliveRegion()Make this alert a live region alert.AlertGroupmainComponent()If this alert is not part of anAlertGroup, this method will returnnull!AlertonClose(CloseHandler<Alert> closeHandler)voidpassComponent(AlertGroup alertGroup)Alertthat()Alerttimeout()Alerttimeout(int timeout)Alerttruncate()Alerttruncate(int lines)-
Methods inherited from class org.patternfly.component.BaseComponent
componentType, element
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.elemento.Container
add, add, addAll, addAll, addAll, addAll, addAll
-
Methods inherited from interface org.patternfly.core.Expandable
collapse, expand, expanded, toggle, toggle
-
Methods inherited from interface org.jboss.elemento.HasElement
add, apply, aria, aria, aria, attr, attr, attr, css, id, id, innerHtml, on, textContent, textNode, toggle, toggle, toggle
-
Methods inherited from interface org.jboss.elemento.HasHTMLElement
data, hidden, style, style, style, style, style, style, title
-
Methods inherited from interface org.patternfly.core.Modifiers.Inline
inline, inline
-
Methods inherited from interface org.patternfly.core.Modifiers.Plain
plain, plain
-
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
attach
public void attach(MutationRecord mutationRecord)
- Specified by:
attachin interfaceAttachable
-
detach
public void detach(MutationRecord mutationRecord)
- Specified by:
detachin interfaceAttachable
-
passComponent
public void passComponent(AlertGroup alertGroup)
- Specified by:
passComponentin interfaceComponentReference<AlertGroup>
-
mainComponent
public AlertGroup mainComponent()
If this alert is not part of anAlertGroup, this method will returnnull!- Specified by:
mainComponentin interfaceComponentReference<AlertGroup>
-
addActionGroup
public Alert addActionGroup(AlertActionGroup actionGroup)
-
add
public Alert add(AlertActionGroup actionGroup)
-
addDescription
public Alert addDescription(String description)
Wraps the description inside a<p/>element, adds it to aAlertDescriptionand finally adds it to this alert. Useful if your description is just a simple string.
-
addDescription
public Alert addDescription(AlertDescription description)
-
add
public Alert add(AlertDescription description)
-
closable
public Alert closable()
-
closable
public Alert closable(CloseHandler<Alert> closeHandler)
-
customIcon
public Alert customIcon(PredefinedIcon icon)
-
customIcon
public Alert customIcon(InlineIcon icon)
-
expandable
public Alert expandable()
-
expandable
public Alert expandable(ToggleHandler<Alert> toggleHandler)
-
liveRegion
public Alert liveRegion()
Make this alert a live region alert. Live region alerts allow you to expose dynamic content changes in a way that can be announced by assistive technologies.Set the following ARIA attributes:
aria-live: "polite"aria-atomic: false
-
timeout
public Alert timeout()
-
timeout
public Alert timeout(int timeout)
-
truncate
public Alert truncate()
-
truncate
public Alert truncate(int lines)
-
that
public Alert that()
- Specified by:
thatin interfaceTypedBuilder<HTMLDivElement,Alert>
-
onClose
public Alert onClose(CloseHandler<Alert> closeHandler)
- Specified by:
onClosein interfaceCloseable<HTMLDivElement,Alert>
-
close
public void close(Event event, boolean fireEvent)
- Specified by:
closein interfaceCloseable<HTMLDivElement,Alert>
-
collapse
public void collapse(boolean fireEvent)
- Specified by:
collapsein interfaceExpandable<HTMLDivElement,Alert>
-
expand
public void expand(boolean fireEvent)
- Specified by:
expandin interfaceExpandable<HTMLDivElement,Alert>
-
-