Package org.jboss.hal.core.finder
Interface ItemDisplay<T>
-
- All Superinterfaces:
HasTitle,org.jboss.elemento.IsElement<elemental2.dom.HTMLElement>
- All Known Implementing Classes:
HostDisplay,StaticItemColumn.StaticItemDisplay
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ItemDisplay<T> extends org.jboss.elemento.IsElement<elemental2.dom.HTMLElement>, HasTitle
Controls the layout of a finder item. For simple items you only need to implement theHasTitle.getTitle()method. Override the default implementations if you need more control over the display and behaviour of the item.
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default List<ItemAction<T>>actions()Defines the action(s) available for the item.default elemental2.dom.HTMLElementelement()If this method returns an element !default StringgetFilterData()The data which is used to filter items.default elemental2.dom.HTMLElementgetIcon()Whether to show an icon left to the item text.default StringgetId()An unique id for this item.default StringgetTooltip()Whether a tooltip should be shown for the item.default StringnextColumn()Whether this item triggers a next column (hence is a folder not a leaf).static elemental2.dom.HTMLElementwithSubtitle(String title, String subtitle)Factory methods which can be used when overridingelement().
-
-
-
Method Detail
-
getId
default String getId()
An unique id for this item.Please make sure the id returned by this method matches the id which is part of the
FinderPathreturned byHasFinderPath.finderPath()- Returns:
- an id based on
HasTitle.getTitle():Ids.asId(getTitle())
-
getFilterData
default String getFilterData()
The data which is used to filter items.- Returns:
HasTitle.getTitle()by default
-
getTooltip
default String getTooltip()
Whether a tooltip should be shown for the item.- Returns:
nullby default (no tooltip)
-
getIcon
default elemental2.dom.HTMLElement getIcon()
Whether to show an icon left to the item text. The icon should be a PatternFly or FontAwesome icon in normal size. SeeIconsfor a list of common icons.- Returns:
nullby default
-
nextColumn
default String nextColumn()
Whether this item triggers a next column (hence is a folder not a leaf).- Returns:
nullby default
-
actions
default List<ItemAction<T>> actions()
Defines the action(s) available for the item.- Returns:
- an empty list by default.
-
element
default elemental2.dom.HTMLElement element()
If this method returns an element !=nullthis element is used to display the item.- Specified by:
elementin interfaceorg.jboss.elemento.IsElement<T>- Returns:
nullby default
-
-