Class ListViewMatchers

java.lang.Object
org.testfx.matcher.control.ListViewMatchers

public class ListViewMatchers extends Object
TestFX matchers for ListView controls.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static String
    getItemsString(javafx.scene.control.ListView<?> listView)
     
    private static String
    getPlaceHolderDescription(javafx.scene.Node placeHolder, boolean describeVisibility)
     
    private static boolean
    hasCellValue(javafx.scene.control.Cell cell, Object value)
     
    static org.hamcrest.Matcher<javafx.scene.control.ListView>
    hasItems(int amount)
    Creates a matcher that matches all ListViews that have exactly amount items (i.e.
    static org.hamcrest.Matcher<javafx.scene.control.ListView>
    Creates a matcher that matches all ListViews that have one cell that equals the given value.
    private static boolean
    hasListCell(javafx.scene.control.ListView listView, Object value)
     
    private static boolean
    hasPlaceholder(javafx.scene.control.ListView listView, javafx.scene.Node placeHolder)
     
    static org.hamcrest.Matcher<javafx.scene.control.ListView>
    hasPlaceholder(javafx.scene.Node placeHolder)
    Creates a matcher that matches ListViews that have the given placeHolder.
    private static boolean
    hasSelectedItem(javafx.scene.control.ListView<?> listView, Object value)
     
    static org.hamcrest.Matcher<javafx.scene.control.ListView>
    Creates a matcher that matches ListViews that have the given value within their selection.
    private static boolean
    hasVisiblePlaceholder(javafx.scene.control.ListView listView, javafx.scene.Node placeHolder)
     
    static org.hamcrest.Matcher<javafx.scene.control.ListView>
    hasVisiblePlaceholder(javafx.scene.Node placeHolder)
    Creates a matcher that matches ListViews that have the given visible placeHolder.
    static org.hamcrest.Matcher<javafx.scene.control.ListView>
    Creates a matcher that matches all ListViews that have no items (i.e.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ListViewMatchers

      private ListViewMatchers()
  • Method Details

    • hasListCell

      public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasListCell(Object value)
      Creates a matcher that matches all ListViews that have one cell that equals the given value.
      Parameters:
      value - the list cell the matched ListView's should have
    • hasItems

      public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasItems(int amount)
      Creates a matcher that matches all ListViews that have exactly amount items (i.e. sizeof(ListView.getItems()) = amount).
      Parameters:
      amount - the number of items the matched ListView's should have
    • isEmpty

      public static org.hamcrest.Matcher<javafx.scene.control.ListView> isEmpty()
      Creates a matcher that matches all ListViews that have no items (i.e. sizeof(ListView.getItems()) = 0).
    • hasPlaceholder

      public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasPlaceholder(javafx.scene.Node placeHolder)
      Creates a matcher that matches ListViews that have the given placeHolder. As a special case if the placeHolder is an instance of Labeled then the placeholder matches if the given placeHolder's text is equal to the ListView's text.
      Parameters:
      placeHolder - the placeHolder Node the matched ListView's should have
    • hasVisiblePlaceholder

      public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasVisiblePlaceholder(javafx.scene.Node placeHolder)
      Creates a matcher that matches ListViews that have the given visible placeHolder. As a special case if the placeHolder is an instance of Labeled then the placeholder matches if the given placeHolder's text is equal to the ListView's text and the ListView's placeHolder is visible.
      Parameters:
      placeHolder - the visible placeHolder Node the matched ListView's should have
    • hasSelectedRow

      public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasSelectedRow(Object value)
      Creates a matcher that matches ListViews that have the given value within their selection.
      Parameters:
      value - the value placeHolder T the matched ListView's should have
    • hasSelectedItem

      private static boolean hasSelectedItem(javafx.scene.control.ListView<?> listView, Object value)
    • hasListCell

      private static boolean hasListCell(javafx.scene.control.ListView listView, Object value)
    • hasCellValue

      private static boolean hasCellValue(javafx.scene.control.Cell cell, Object value)
    • hasPlaceholder

      private static boolean hasPlaceholder(javafx.scene.control.ListView listView, javafx.scene.Node placeHolder)
    • hasVisiblePlaceholder

      private static boolean hasVisiblePlaceholder(javafx.scene.control.ListView listView, javafx.scene.Node placeHolder)
    • getItemsString

      private static String getItemsString(javafx.scene.control.ListView<?> listView)
    • getPlaceHolderDescription

      private static String getPlaceHolderDescription(javafx.scene.Node placeHolder, boolean describeVisibility)