Class FinderColumn

java.lang.Object
org.patternfly.component.SubComponent<elemental2.dom.HTMLElement, FinderColumn>
org.patternfly.extension.finder.FinderColumn
All Implemented Interfaces:
Iterable<FinderItem>, ElementAttributeMethods<elemental2.dom.HTMLElement, FinderColumn>, ElementClassListMethods<elemental2.dom.HTMLElement, FinderColumn>, ElementConsumerMethods<elemental2.dom.HTMLElement, FinderColumn>, ElementContainerMethods<elemental2.dom.HTMLElement, FinderColumn>, ElementEventMethods<elemental2.dom.HTMLElement, FinderColumn>, ElementIdMethods<elemental2.dom.HTMLElement, FinderColumn>, ElementQueryMethods<elemental2.dom.HTMLElement>, HTMLElementAttributeMethods<elemental2.dom.HTMLElement, FinderColumn>, HTMLElementDataMethods<elemental2.dom.HTMLElement, FinderColumn>, HTMLElementStyleMethods<elemental2.dom.HTMLElement, FinderColumn>, HTMLElementVisibilityMethods<elemental2.dom.HTMLElement, FinderColumn>, IsElement<elemental2.dom.HTMLElement>, TypedBuilder<elemental2.dom.HTMLElement, FinderColumn>, HasAsyncItems<FinderColumn, FinderItem>, ComponentContext<elemental2.dom.HTMLElement, FinderColumn>, HasIdentifier<elemental2.dom.HTMLElement, FinderColumn>, HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>, Ordered<elemental2.dom.HTMLElement, FinderColumn, FinderItem>, OuiaSupport<elemental2.dom.HTMLElement, FinderColumn>

public class FinderColumn extends SubComponent<elemental2.dom.HTMLElement, FinderColumn> implements ComponentContext<elemental2.dom.HTMLElement, FinderColumn>, HasAsyncItems<FinderColumn, FinderItem>, HasIdentifier<elemental2.dom.HTMLElement, FinderColumn>, Ordered<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
A column in the Finder, displaying a list of FinderItems that can be selected, filtered, and sorted.
  • Field Details

  • Method Details

    • finderColumn

      public static FinderColumn finderColumn(String identifier)
    • finderColumn

      public static FinderColumn finderColumn(String identifier, String header)
    • addHeader

      public FinderColumn addHeader(FinderColumnHeader header)
    • add

      public FinderColumn add(FinderColumnHeader header)
    • addSearch

      public FinderColumn addSearch(FinderColumnSearch search)
    • add

      public FinderColumn add(FinderColumnSearch search)
    • add

      public FinderColumn add(FinderItem item)
      Description copied from interface: HasItems
      Adds an item to the component.
      Specified by:
      add in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      item - the item to be added to the component
      Returns:
      the builder instance after the item has been added
    • add

      Specified by:
      add in interface HasAsyncItems<FinderColumn, FinderItem>
    • active

      public FinderColumn active()
      Same as active(true)
    • active

      public FinderColumn active(boolean active)
      Adds/removes modifier(active)
    • defaultSearch

      public FinderColumn defaultSearch()
      Returns:
      the current FinderColumn instance with the default search functionality added
    • defaultSearch

      public FinderColumn defaultSearch(String placeholder)
      Configures the current FinderColumn instance with a default search functionality. The search functionality allows filtering of items in the column based on the content of a search input field. The provided placeholder text for the search input is used to indicate the purpose of the search field to the user.
      Parameters:
      placeholder - the placeholder text to display in the search input field
      Returns:
      the current FinderColumn instance with the configured default search functionality
    • ordered

      public FinderColumn ordered(Comparator<FinderItem> comparator)
      Description copied from interface: Ordered
      Orders the elements contained in the component using the specified comparator. The comparator determines the order in which the elements are arranged.
      Specified by:
      ordered in interface Ordered<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      comparator - the comparator used to define the ordering of the elements
      Returns:
      the builder instance with the elements ordered
    • pinnable

      public FinderColumn pinnable()
    • pinnable

      public FinderColumn pinnable(boolean pinnable)
      Adds/removes modifier(pinnable)
    • store

      public <T> FinderColumn store(String key, T value)
      Description copied from interface: ComponentContext
      Stores a value associated with a key.
      Specified by:
      store in interface ComponentContext<elemental2.dom.HTMLElement, FinderColumn>
      Type Parameters:
      T - the type of the value being stored
      Parameters:
      key - the key associated with the value
      value - the value to be stored
    • showSearchThreshold

      public FinderColumn showSearchThreshold(int size)
      Configures the current FinderColumn instance to show the search component when the size of the items in the column is greater than or equal to the specified value. The visibility condition is evaluated based on the number of items in the column.

      If no search component is present in the column, this method does nothing.

      Parameters:
      size - the minimum number of items required in the column to show the search component
      Returns:
      the current FinderColumn instance with updated search visibility configuration
    • toggleSearch

      public FinderColumn toggleSearch(Predicate<FinderColumn> predicate)
      Toggles the visibility of the search component in the column based on the provided predicate. The predicate is evaluated against the current column and determines whether the search component should be visible. Additionally, the visibility of the search component reacts to items being added to or removed from the column.

      If no search component is present in the column, this method does nothing.

      Parameters:
      predicate - a Predicate that evaluates the visibility condition for the search component based on the current FinderColumn
      Returns:
      the current FinderColumn instance with updated search visibility
    • that

      public FinderColumn that()
      Specified by:
      that in interface TypedBuilder<elemental2.dom.HTMLElement, FinderColumn>
    • onAdd

      Description copied from interface: HasItems
      Registers a callback to be invoked whenever a new item is added to the component.
      Specified by:
      onAdd in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      onAdd - a AddItemHandler that takes the builder instance and the item being added as arguments
      Returns:
      the builder instance after adding the callback
    • onUpdate

      public FinderColumn onUpdate(UpdateItemHandler<FinderColumn, FinderItem> onUpdate)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is updated in the component.
      Specified by:
      onUpdate in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      onUpdate - a UpdateItemHandler that takes the component, the previous state of the item, and the updated state of the item as arguments
      Returns:
      the builder instance after adding the callback
    • onRemove

      public FinderColumn onRemove(RemoveItemHandler<FinderColumn, FinderItem> onRemove)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is removed from the component.
      Specified by:
      onRemove in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      onRemove - a RemoveItemHandler that takes the component and the item being removed as arguments
      Returns:
      the builder instance after adding the callback
    • onSelect

      public FinderColumn onSelect(SelectHandler<FinderItem> selectHandler)
    • onPreview

      public FinderColumn onPreview(PreviewHandler previewHandler)
    • finder

      public Finder finder()
    • comparator

      public Comparator<FinderItem> comparator()
      Description copied from interface: Ordered
      Retrieves the comparator used for ordering elements in a component.
      Specified by:
      comparator in interface Ordered<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Returns:
      the comparator that determines the order of elements
    • load

      public elemental2.promise.Promise<Iterable<FinderItem>> load()
      Description copied from interface: HasAsyncItems
      Fetches items for the first time. Only runs when status is AsyncStatus.pending. Idempotent.
      Specified by:
      load in interface HasAsyncItems<FinderColumn, FinderItem>
    • refresh

      public elemental2.promise.Promise<Iterable<FinderItem>> refresh()
      Description copied from interface: HasAsyncItems
      Re-fetches items while keeping old items visible, then swaps them after the new items arrive.
      Specified by:
      refresh in interface HasAsyncItems<FinderColumn, FinderItem>
    • reset

      public void reset()
      Description copied from interface: HasAsyncItems
      Clears all items and sets status back to AsyncStatus.pending. Does not fetch.
      Specified by:
      reset in interface HasAsyncItems<FinderColumn, FinderItem>
    • status

      public AsyncStatus status()
      Specified by:
      status in interface HasAsyncItems<FinderColumn, FinderItem>
    • identifier

      public String identifier()
      Description copied from interface: HasIdentifier
      Retrieves the identifier associated with this component.
      Specified by:
      identifier in interface HasIdentifier<elemental2.dom.HTMLElement, FinderColumn>
      Returns:
      the identifier of the component
    • has

      public boolean has(String key)
      Description copied from interface: ComponentContext
      Determines whether a value is stored with the specified key.
      Specified by:
      has in interface ComponentContext<elemental2.dom.HTMLElement, FinderColumn>
      Parameters:
      key - the key to check
      Returns:
      true if a value is stored with the specified key, false otherwise
    • get

      public <T> T get(String key)
      Description copied from interface: ComponentContext
      Retrieves the value associated with the given key from the ComponentContext.
      Specified by:
      get in interface ComponentContext<elemental2.dom.HTMLElement, FinderColumn>
      Type Parameters:
      T - the type of the value being retrieved
      Parameters:
      key - the key associated with the value
      Returns:
      the value associated with the key, or null if no value is found
    • iterator

      public Iterator<FinderItem> iterator()
      Specified by:
      iterator in interface Iterable<FinderItem>
    • size

      public int size()
      Description copied from interface: HasItems
      Retrieves the total number of items currently contained in the component.
      Specified by:
      size in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Returns:
      the number of items contained in the component
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: HasItems
      Checks whether the collection of items in the component is empty.
      Specified by:
      isEmpty in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Returns:
      true if the component contains no items; false otherwise
    • contains

      public boolean contains(String identifier)
      Description copied from interface: HasItems
      Checks whether the component contains an item associated with the given identifier.
      Specified by:
      contains in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      identifier - the identifier of the item to be checked
      Returns:
      true if the component contains an item associated with the provided identifier, false otherwise
    • item

      public FinderItem item(String identifier)
      Description copied from interface: HasItems
      Retrieves the item associated with the specified identifier from the component.
      Specified by:
      item in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      identifier - the identifier of the item to be retrieved
      Returns:
      the item associated with the given identifier, or null if no item is found
    • updateItem

      public void updateItem(FinderItem item)
      Description copied from interface: HasItems
      Updates an existing item in the component.
      Specified by:
      updateItem in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      item - the item to be updated
    • removeItem

      public void removeItem(String identifier)
      Description copied from interface: HasItems
      Removes an item from the component based on the provided identifier.
      Specified by:
      removeItem in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
      Parameters:
      identifier - the identifier of the item to be removed
    • clear

      public void clear()
      Description copied from interface: HasItems
      Clears all items from the component. This method removes any existing items within the component, leaving it empty. Any associated or registered callbacks related to the removal of items may be invoked as part of this operation.
      Specified by:
      clear in interface HasItems<elemental2.dom.HTMLElement, FinderColumn, FinderItem>
    • select

      public void select(String identifier)
    • select

      public void select(String identifier, boolean selected)
    • select

      public void select(String identifier, boolean selected, boolean fireEvent)
    • select

      public void select(FinderItem item)
    • select

      public void select(FinderItem item, boolean selected)
    • select

      public void select(FinderItem item, boolean selected, boolean fireEvent)