org.richfaces.fragment.list

## Class AbstractListComponent<T extends ListItem>

- java.lang.Object
- - org.richfaces.fragment.list.AbstractListComponent<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    ListComponent<T>
  Direct Known Subclasses:
    DayPicker.CalendarDaysImpl, RichFacesFileUpload.RichFacesFileUploadList, RichFacesList, RichFacesLog.RichFacesLogEntries, RichFacesMessages, RichFacesNotify, RichFacesOrderingList.SelectableListImpl, RichFacesPickList.SelectableListImpl

      public abstract class AbstractListComponent<T extends ListItem>
      extends Object
      implements ListComponent<T>

  Base for ListComponents implementations.
  Author:
    Jiri Stefek

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractListComponent()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getItem(ChoicePicker picker)` Gets item found by `picker`.
    `T` | `getItem(int index)` Gets the item on the given `index`.
    `T` | `getItem(String text)` Gets the item which text representation is exact match with the given param `text`
    `List<T>` | `getItems()` Gets all items from this list.
    `List<T>` | `getItems(MultipleChoicePicker picker)` Gets multiple items accoriding to the rules given in `picker` param.
    `protected List<org.openqa.selenium.WebElement>` | `getItemsElements()`
    `protected List<T>` | `getItemsFragments()`
    `protected Class<T>` | `getListItemClass()`
    `org.openqa.selenium.WebElement` | `getRootElement()` Gets the root of this component.
    `protected List<T>` | `instantiateFragments(Class<T> klass, List<org.openqa.selenium.WebElement> itemsRoots)`
    `protected T` | `instantiateItemFragment(Class<T> klass, org.openqa.selenium.WebElement item)`
    `boolean` | `isEmpty()` Founds out whether the list is empty or not.
    `boolean` | `isVisible()`
    `int` | `size()` Gets the size of this list component.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractListComponent

          public AbstractListComponent()

  - ### Method Detail

    - #### getItem

          public T getItem(int index)

      Description copied from interface: `ListComponent`
      Gets the item on the given `index`.
      Specified by:
        `getItem` in interface `ListComponent<T extends ListItem>`
      Parameters:
        `index` - index of the item to be returned
      Returns:
        item at index or null

    - #### getItem

          public T getItem(String text)

      Description copied from interface: `ListComponent`
      Gets the item which text representation is exact match with the given param `text`
      Specified by:
        `getItem` in interface `ListComponent<T extends ListItem>`
      Parameters:
        `text` - the text according to which the item will be returned
      Returns:
        first item which matches given text or null

    - #### getItem

          public T getItem(ChoicePicker picker)

      Description copied from interface: `ListComponent`
      Gets item found by `picker`.
      Specified by:
        `getItem` in interface `ListComponent<T extends ListItem>`
      Parameters:
        `picker` - for picking from the items
      Returns:
        found item or null
      See Also:
        `ChoicePickerHelper.ByIndexChoicePicker`, `ChoicePickerHelper.ByVisibleTextChoicePicker`

    - #### getItems

          public List<T> getItems(MultipleChoicePicker picker)

      Description copied from interface: `ListComponent`
      Gets multiple items accoriding to the rules given in `picker` param.
      Specified by:
        `getItems` in interface `ListComponent<T extends ListItem>`
      Parameters:
        `picker` - for picking from list
      Returns:
        all items that returns picker
      See Also:
        `MultipleChoicePicker`

    - #### getItems

          public List<T> getItems()

      Description copied from interface: `ListComponent`
      Gets all items from this list.
      Specified by:
        `getItems` in interface `ListComponent<T extends ListItem>`
      Returns:
        all items in list

    - #### getItemsElements

          protected List<org.openqa.selenium.WebElement> getItemsElements()

    - #### getItemsFragments

          protected List<T> getItemsFragments()

    - #### getListItemClass

          protected Class<T> getListItemClass()

    - #### getRootElement

          public org.openqa.selenium.WebElement getRootElement()

      Description copied from interface: `ListComponent`
      Gets the root of this component.
      Specified by:
        `getRootElement` in interface `ListComponent<T extends ListItem>`
      Returns:
        the root element of this component

    - #### instantiateFragments

          protected List<T> instantiateFragments(Class<T> klass,
                                     List<org.openqa.selenium.WebElement> itemsRoots)

    - #### instantiateItemFragment

          protected T instantiateItemFragment(Class<T> klass,
                                  org.openqa.selenium.WebElement item)

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `ListComponent`
      Founds out whether the list is empty or not.
      Specified by:
        `isEmpty` in interface `ListComponent<T extends ListItem>`
      Returns:
        true if size() == 0, false otherwise

    - #### size

          public int size()

      Description copied from interface: `ListComponent`
      Gets the size of this list component.
      Specified by:
        `size` in interface `ListComponent<T extends ListItem>`
      Returns:
        size of the list

    - #### isVisible

          public boolean isVisible()

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.