Package snap.util

Interface Selectable<T>

All Known Implementing Classes:
BrowserCol, BrowserView, ComboBox, ListArea, ListView, PopupList, SwitchView, TabBar, TableCol, TableView, TabView, TreeCol, TreeView

public interface Selectable<T>
An interface for views that are selectable.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<T>
    Returns the items for a given name or UI view.
    int
    Returns the selected index for given name or UI view.
    default T
    Returns the selected item for given name or UI view.
    default boolean
    removeItem(T anItem)
    Removes a given item.
    default void
    Removes a given item and updates selection.
    static void
    setItems(Selectable<?> aSelectable, Object theItems)
    Sets items in given selectable
    default void
    setItems(T[] theItems)
    Sets the items for a given name or UI view.
    default void
    setItemsList(List<T> theItems)
    Sets the items for a given name or UI view.
    void
    setSelIndex(int aValue)
    Sets the selected index for given name or UI view.
    default void
    setSelItem(T anItem)
    Sets the selected item for given name or UI view.
  • Field Details

  • Method Details

    • setItems

      default void setItems(T[] theItems)
      Sets the items for a given name or UI view.
    • getItemsList

      default List<T> getItemsList()
      Returns the items for a given name or UI view.
    • setItemsList

      default void setItemsList(List<T> theItems)
      Sets the items for a given name or UI view.
    • getSelIndex

      int getSelIndex()
      Returns the selected index for given name or UI view.
    • setSelIndex

      void setSelIndex(int aValue)
      Sets the selected index for given name or UI view.
    • getSelItem

      default T getSelItem()
      Returns the selected item for given name or UI view.
    • setSelItem

      default void setSelItem(T anItem)
      Sets the selected item for given name or UI view.
    • removeItem

      default boolean removeItem(T anItem)
      Removes a given item.
    • removeItemAndUpdateSel

      default void removeItemAndUpdateSel(T anItem)
      Removes a given item and updates selection.
    • setItems

      static void setItems(Selectable<?> aSelectable, Object theItems)
      Sets items in given selectable