T - The value of this action which can be any objectpublic class DropdownAction<T> extends BaseDominoElement<elemental2.dom.HTMLLIElement,DropdownAction<T>> implements HasSelectionHandler<DropdownAction<T>,T>, HasBackground<DropdownAction<T>>
This component provides a representation of each DropDownMenu element
Customize the component can be done by overwriting classes provided by DropDownStyles
For example:
DropdownAction.create("action 1");
BaseDominoElement,
DropDownMenu,
HasSelectionHandler,
HasBackground| Modifier and Type | Class and Description |
|---|---|
static interface |
DropdownAction.FocusHandler<T>
A handler that will be called when the element gets focused
|
BaseDominoElement.ElementHandler<T>, BaseDominoElement.ResizeHandler<T>, BaseDominoElement.StyleEditor<E extends elemental2.dom.HTMLElement,T extends org.jboss.elemento.IsElement<E>>, BaseDominoElement.WavesStylerHasSelectionHandler.SelectionHandler<V>| Modifier and Type | Field and Description |
|---|---|
static elemental2.core.JsRegExp |
REPLACER_REGEX |
element| Constructor and Description |
|---|
DropdownAction(T value,
elemental2.dom.HTMLElement content) |
DropdownAction(T value,
String displayValue) |
DropdownAction(T value,
String displayValue,
BaseIcon<?> icon) |
| Modifier and Type | Method and Description |
|---|---|
DropdownAction<T> |
addFocusHandler(DropdownAction.FocusHandler<T> focusHandler)
Adds focus handler that will be called when the action gets focused
|
DropdownAction<T> |
addSelectionHandler(HasSelectionHandler.SelectionHandler<T> selectionHandler)
Adds a Selection handler to the component
|
static DropdownAction<String> |
create(String content)
Creates an action with text value
|
static <T> DropdownAction<T> |
create(T value,
elemental2.dom.HTMLElement content)
Creates an action with
T as a value and a content HTMLElement |
static <T> DropdownAction<T> |
create(T value,
String displayValue)
Creates an action with
T as a value and a displayValue to be shown |
static <T> DropdownAction<T> |
create(T value,
String displayValue,
BaseIcon<?> icon)
Creates an action with
T as a value, displayValue to be shown, and an icon |
DropdownAction<T> |
deFilter()
Shows the action as it does comply with the provided search criteria
|
elemental2.dom.HTMLLIElement |
element() |
DropdownAction<T> |
filter()
Hides the action as it does not comply with the provided search criteria
|
DropdownAction<T> |
focus()
Focuses the action
|
elemental2.dom.HTMLAnchorElement |
getClickableElement()
by default this return the same component root element
|
elemental2.dom.HTMLElement |
getContent() |
T |
getValue() |
void |
highlight(String displayValue,
Color highlightColor)
Highlights the
displayValue with a color which indicates that it complies with the
search criteria |
boolean |
isAutoClose() |
boolean |
isExcludeFromSearchResults() |
boolean |
isFilteredOut() |
DropdownAction<T> |
removeSelectionHandler(HasSelectionHandler.SelectionHandler<T> selectionHandler) |
DropdownAction<T> |
select()
Selects the action, this will trigger all the selection handlers
|
DropdownAction<T> |
setAutoClose(boolean autoClose)
Sets if selecting the action will close the menu automatically
|
DropdownAction<T> |
setBackground(Color background) |
DropdownAction<T> |
setDisplayValue(BaseIcon<?> icon,
String displayValue)
Sets the display value of the action as text along with an icon
|
DropdownAction<T> |
setDisplayValue(elemental2.dom.HTMLElement content)
Sets the display value of the action as an element
|
DropdownAction<T> |
setDisplayValue(String displayValue)
Sets the display value of the action as text
|
DropdownAction<T> |
setExcludeFromSearchResults(boolean excludeFromSearchResults)
Sets if this action is not included in the search and will be hidden if the search provided
|
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, 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 DropdownAction(T value, elemental2.dom.HTMLElement content)
public static DropdownAction<String> create(String content)
content - the value as textpublic static <T> DropdownAction<T> create(T value, String displayValue, BaseIcon<?> icon)
T as a value, displayValue to be shown, and an iconT - the type of the valuevalue - the value objectdisplayValue - the display value texticon - the iconpublic static <T> DropdownAction<T> create(T value, String displayValue)
T as a value and a displayValue to be shownT - the type of the valuevalue - the value objectdisplayValue - the display value textpublic static <T> DropdownAction<T> create(T value, elemental2.dom.HTMLElement content)
T as a value and a content HTMLElementT - the type of the valuevalue - the value objectcontent - The content of the action as HTMLElementpublic DropdownAction<T> focus()
public DropdownAction<T> select()
public elemental2.dom.HTMLLIElement element()
element in interface org.jboss.elemento.IsElement<elemental2.dom.HTMLLIElement>element in class BaseDominoElement<elemental2.dom.HTMLLIElement,DropdownAction<T>>public DropdownAction<T> addSelectionHandler(HasSelectionHandler.SelectionHandler<T> selectionHandler)
addSelectionHandler in interface HasSelectionHandler<DropdownAction<T>,T>selectionHandler - Selectable.SelectionHandlerpublic DropdownAction<T> removeSelectionHandler(HasSelectionHandler.SelectionHandler<T> selectionHandler)
removeSelectionHandler in interface HasSelectionHandler<DropdownAction<T>,T>public T getValue()
public elemental2.dom.HTMLElement getContent()
public elemental2.dom.HTMLAnchorElement getClickableElement()
getClickableElement in class BaseDominoElement<elemental2.dom.HTMLLIElement,DropdownAction<T>>public DropdownAction<T> setDisplayValue(String displayValue)
displayValue - the text that will be shown as a contentpublic DropdownAction<T> setDisplayValue(BaseIcon<?> icon, String displayValue)
icon - the icondisplayValue - the display textpublic DropdownAction<T> setDisplayValue(elemental2.dom.HTMLElement content)
content - the HTMLElementpublic DropdownAction<T> addFocusHandler(DropdownAction.FocusHandler<T> focusHandler)
focusHandler - the DropdownAction.FocusHandler to addpublic boolean isAutoClose()
public DropdownAction<T> setAutoClose(boolean autoClose)
autoClose - True if the selecting the action will close the menu automatically, false
otherwisepublic DropdownAction<T> filter()
public DropdownAction<T> deFilter()
public boolean isFilteredOut()
public boolean isExcludeFromSearchResults()
public DropdownAction<T> setExcludeFromSearchResults(boolean excludeFromSearchResults)
excludeFromSearchResults - True if this action is not included in the search and will be
hidden if the search provided, false otherwisepublic DropdownAction<T> setBackground(Color background)
setBackground in interface HasBackground<DropdownAction<T>>background - ColorCopyright © 2019–2022 Dominokit. All rights reserved.