Class ListControl<V>

Type Parameters:
V - The type of values to select.
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, com.globalmentor.model.MutableValued<V>, com.globalmentor.model.Valued<V>, io.clogr.Clogged, Component, CompositeComponent, Control, InputFocusableComponent, ListSelectControl<V>, SelectControl<V>, ValueControl<V>, ValuedComponent<V>, ListListenable<V>, Displayable, Enableable, InfoModel, LabelModel, ListSelectModel<V>, Model, SelectModel<V>, PresentationModel, ValueModel<V>, DepictedObject, Iterable<V>, Collection<V>, List<V>

public class ListControl<V> extends AbstractListSelectControl<V>
Control to allow selection of one or more values from a list.
Author:
Garret Wilson
  • Field Details

    • ROW_COUNT_PROPERTY

      public static final String ROW_COUNT_PROPERTY
      The row count bound property.
  • Constructor Details

    • ListControl

      public ListControl(Class<V> valueClass)
      Value class constructor with a default data model to represent a given type with multiple selection.
      Parameters:
      valueClass - The class indicating the type of value held in the model.
      Throws:
      NullPointerException - if the given value class is null.
    • ListControl

      public ListControl(Class<V> valueClass, boolean multipleSelection)
      Value class constructor with a default data model to represent a given type.
      Parameters:
      valueClass - The class indicating the type of value held in the model.
      multipleSelection - true if the list control should allow multiple selections, else false if only a single selection is allowed.
      Throws:
      NullPointerException - if the given value class is null.
    • ListControl

      public ListControl(Class<V> valueClass, int rowCount)
      Value class and row count constructor with a default data model to represent a given type with multiple selection.
      Parameters:
      valueClass - The class indicating the type of value held in the model.
      rowCount - The requested number of visible rows, or -1 if no row count is specified.
      Throws:
      NullPointerException - if the given value class is null.
    • ListControl

      public ListControl(Class<V> valueClass, boolean multipleSelection, int rowCount)
      Value class and row count constructor with a default data model to represent a given type.
      Parameters:
      valueClass - The class indicating the type of value held in the model.
      multipleSelection - true if the list control should allow multiple selections, else false if only a single selection is allowed.
      rowCount - The requested number of visible rows, or -1 if no row count is specified.
      Throws:
      NullPointerException - if the given value class is null.
    • ListControl

      public ListControl(Class<V> valueClass, ListSelectionPolicy<V> selectionStrategy)
      Value class and selection strategy constructor with a default data model to represent a given type.
      Parameters:
      valueClass - The class indicating the type of value held in the model.
      selectionStrategy - The strategy for selecting values in the model.
      Throws:
      NullPointerException - if the given value class and/or selection strategy is null.
    • ListControl

      public ListControl(Class<V> valueClass, ListSelectionPolicy<V> selectionStrategy, int rowCount)
      Value class, selection strategy, and row count constructor with a default data model to represent a given type.
      Parameters:
      valueClass - The class indicating the type of value held in the model.
      selectionStrategy - The strategy for selecting values in the model.
      rowCount - The requested number of visible rows, or -1 if no row count is specified.
      Throws:
      NullPointerException - if the given value class and/or selection strategy is null.
    • ListControl

      public ListControl(ListSelectModel<V> listSelectModel)
      List select model constructor.
      Parameters:
      listSelectModel - The component list select model.
      Throws:
      NullPointerException - if the given list select model is null.
    • ListControl

      public ListControl(ListSelectModel<V> listSelectModel, int rowCount)
      List select model and row count constructor.
      Parameters:
      listSelectModel - The component list select model.
      rowCount - The requested number of visible rows, or -1 if no row count is specified.
      Throws:
      NullPointerException - if the given list select model is null.
    • ListControl

      public ListControl(ListSelectModel<V> listSelectModel, ListSelectControl.ValueRepresentationStrategy<V> valueRepresentationStrategy)
      List select model and value representation strategy constructor.
      Parameters:
      listSelectModel - The component list select model.
      valueRepresentationStrategy - The strategy to create label models to represent this model's values.
      Throws:
      NullPointerException - if the given list select model and/or value representation strategy is null.
    • ListControl

      public ListControl(ListSelectModel<V> listSelectModel, ListSelectControl.ValueRepresentationStrategy<V> valueRepresentationStrategy, int rowCount)
      List select model, value representation strategy, and row count constructor.
      Parameters:
      listSelectModel - The component list select model.
      valueRepresentationStrategy - The strategy to create label models to represent this model's values.
      rowCount - The requested number of visible rows, or -1 if no row count is specified.
      Throws:
      NullPointerException - if the given list select model and/or value representation strategy is null.
  • Method Details

    • getRowCount

      public int getRowCount()
      Returns:
      The estimated number of rows requested to be visible, or -1 if no row count is specified.
    • setRowCount

      public void setRowCount(int newRowCount)
      Sets the estimated number of rows requested to be visible. This is a bound property of type Integer.
      Parameters:
      newRowCount - The new requested number of visible rows, or -1 if no row count is specified.
      See Also: