public class Alert extends BaseDominoElement<elemental2.dom.HTMLDivElement,Alert> implements HasBackground<Alert>
This component provides four basic types of severity:
Customize the component can be done by overwriting classes provided by AlertStyles
For example:
Alert.success()
.appendChild("Well done! ")
.appendChild("You successfully read this important alert message.")
BaseDominoElement,
HasBackground,
Color| Modifier and Type | Class and Description |
|---|---|
static class |
Alert.AlertType
Alert severity levels
|
BaseDominoElement.ElementHandler<T>, BaseDominoElement.ResizeHandler<T>, BaseDominoElement.StyleEditor<E extends elemental2.dom.HTMLElement,T extends org.jboss.elemento.IsElement<E>>, BaseDominoElement.WavesStyler| Constructor and Description |
|---|
Alert() |
| Modifier and Type | Method and Description |
|---|---|
Alert |
appendChild(AlertLink alertLink)
Adds
AlertLink as a child |
Alert |
appendChild(elemental2.dom.HTMLAnchorElement anchorElement)
Adds anchor element as a child, this method adds
Styles.alert_link style to anchor
element by default |
Alert |
appendChild(String text)
Adds text as a child, the
text will be added in TextNode |
Alert |
appendChild(Strong strong)
Adds
Strong as a child |
static Alert |
create()
Creates alert with default style
|
static Alert |
create(Color background)
Creates alert with background color
|
Alert |
dismissible()
Sets the alert to closable and a close button will be added to the element to hide it
|
elemental2.dom.HTMLDivElement |
element() |
static Alert |
error()
Creates alert with error severity
|
elemental2.dom.HTMLButtonElement |
getCloseButton()
Returns the close button for customization
|
static Alert |
info()
Creates alert with info severity
|
boolean |
isDismissible() |
Alert |
setBackground(Color background) |
Alert |
setDismissible(boolean dismissible)
Passing true means that the alert will be closable and a close button will be added to the
element to hide it
|
Alert |
setDissmissible(boolean dismissible)
Deprecated.
|
static Alert |
success()
Creates alert with success severity
|
Alert |
unDismissible()
Sets the alert to not closable and the close button will be removed if exist, the alert can be
hidden programmatically using
BaseDominoElement.remove() |
static Alert |
warning()
Creates alert with warning severity
|
add, add, addClickListener, addCss, addCss, addEventListener, addEventListener, addEventsListener, addHideListener, addShowListener, alignCenter, alignRight, appendChild, appendChild, apply, attr, blur, childNodes, clearElement, contains, contains, contains, containsCss, css, css, cssClassByIndex, cssClassesCount, cssText, disable, elevate, elevate, enable, firstChild, getAttachObserver, getAttribute, getBoundingClientRect, getChildElementCount, getClickableElement, getCollapsible, getCollapsibleElement, getDetachObserver, getDominoId, getElementsCount, getElevation, getFirstChild, getId, getTextContent, getTooltip, getWavesElement, hasAttribute, hasChildNodes, hasDirectChild, hide, hideOn, id, init, insertAfter, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertBefore, insertFirst, insertFirst, insertFirst, isAttached, isCollapsed, isDisabled, isEmptyElement, isEqualNode, isForceHidden, isHidden, isReadOnly, item, lastChild, length, onAttached, onDetached, onResize, pullLeft, pullRight, querySelector, querySelectorAll, remove, removeAttachObserver, removeAttribute, removeChild, removeChild, removeCss, removeCss, removeCssProperty, removeDetachObserver, removeEventListener, removeEventListener, removeHideListener, removeHideOn, removeShowListener, removeShowOn, removeTooltip, removeWaves, replaceCss, setAlignItems, setAttribute, setAttribute, setAttribute, setBackgroundColor, setBackgroundColor, setBorder, setBorderColor, setBottom, setBottom, setBoxShadow, setCollapseStrategy, setColor, setColor, setContent, setContent, setCssProperty, setCssProperty, setCursor, setCursor, setDisabled, setDisplay, setDisplay, setDropMenu, setFlex, setFloat, setFloat, setFontSize, setFontSize, setForceHidden, setHeight, setHeight, setId, setInnerHtml, setLeft, setLeft, setLineHeight, setLineHeight, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setOpacity, setOpacity, setOverFlow, setOverFlow, setOverFlowY, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPointerEvents, setPosition, setPosition, setReadOnly, setRight, setRight, setTabIndex, setTextAlign, setTextAlign, setTextContent, setTooltip, setTooltip, setTooltip, setTooltip, setTop, setTop, setTransitionDuration, setWidth, setWidth, setZIndex, show, showOn, style, style, styler, textContent, toggleDisplay, toggleDisplay, withWaves, withWavesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisExpandedadd, add, remove, remove, removeProperty, replace, setProperty, setPropertypublic static Alert create(Color background)
background - the background colorpublic static Alert create()
public static Alert success()
public static Alert info()
public static Alert warning()
public static Alert error()
public Alert setBackground(Color background)
setBackground in interface HasBackground<Alert>background - Colorpublic Alert appendChild(Strong strong)
Strong as a childstrong - the element to addpublic Alert appendChild(String text)
text will be added in TextNodetext - the contentpublic Alert appendChild(elemental2.dom.HTMLAnchorElement anchorElement)
Styles.alert_link style to anchor
element by defaultanchorElement - the elementpublic Alert appendChild(AlertLink alertLink)
AlertLink as a childalertLink - the elementAlertLink@Deprecated public Alert setDissmissible(boolean dismissible)
setDismissible(boolean) insteadpublic Alert setDismissible(boolean dismissible)
dismissible - true to set it as closable, false otherwisepublic Alert dismissible()
public Alert unDismissible()
BaseDominoElement.remove()public boolean isDismissible()
public elemental2.dom.HTMLButtonElement getCloseButton()
public elemental2.dom.HTMLDivElement element()
element in interface org.jboss.elemento.IsElement<elemental2.dom.HTMLDivElement>element in class BaseDominoElement<elemental2.dom.HTMLDivElement,Alert>Copyright © 2019–2022 Dominokit. All rights reserved.