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 the HasTitle.getTitle() method. Override the default implementations if you need more control over the display and behaviour of the item.
    • Method Detail

      • 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:
        null by 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. See Icons for a list of common icons.
        Returns:
        null by default
      • nextColumn

        default String nextColumn()
        Whether this item triggers a next column (hence is a folder not a leaf).
        Returns:
        null by 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 != null this element is used to display the item.
        Specified by:
        element in interface org.jboss.elemento.IsElement<T>
        Returns:
        null by default
      • withSubtitle

        static elemental2.dom.HTMLElement withSubtitle​(String title,
                                                       String subtitle)
        Factory methods which can be used when overriding element(). Creates a <div> element with two nested <span> elements. One for the title and a smaller one for the subtitle.