Package org.testfx.matcher.control
Class ListViewMatchers
- java.lang.Object
-
- org.testfx.matcher.control.ListViewMatchers
-
public class ListViewMatchers extends java.lang.ObjectTestFX matchers forListViewcontrols.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringSELECTOR_LIST_CELL
-
Constructor Summary
Constructors Modifier Constructor Description privateListViewMatchers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringgetItemsString(javafx.scene.control.ListView<?> listView)private static java.lang.StringgetPlaceHolderDescription(javafx.scene.Node placeHolder, boolean describeVisibility)private static booleanhasCellValue(javafx.scene.control.Cell cell, java.lang.Object value)static org.hamcrest.Matcher<javafx.scene.control.ListView>hasItems(int amount)Creates a matcher that matches allListViews that have exactlyamountitems (i.e.static org.hamcrest.Matcher<javafx.scene.control.ListView>hasListCell(java.lang.Object value)Creates a matcher that matches allListViews that have one cell that equals the givenvalue.private static booleanhasListCell(javafx.scene.control.ListView listView, java.lang.Object value)private static booleanhasPlaceholder(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 matchesListViews that have the givenplaceHolder.private static booleanhasSelectedItem(javafx.scene.control.ListView<?> listView, java.lang.Object value)static org.hamcrest.Matcher<javafx.scene.control.ListView>hasSelectedRow(java.lang.Object value)Creates a matcher that matchesListViews that have the given value within their selection.private static booleanhasVisiblePlaceholder(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 matchesListViews that have the given visibleplaceHolder.static org.hamcrest.Matcher<javafx.scene.control.ListView>isEmpty()Creates a matcher that matches allListViews that have no items (i.e.
-
-
-
Field Detail
-
SELECTOR_LIST_CELL
private static final java.lang.String SELECTOR_LIST_CELL
- See Also:
- Constant Field Values
-
-
Method Detail
-
hasListCell
public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasListCell(java.lang.Object value)
Creates a matcher that matches allListViews that have one cell that equals the givenvalue.- 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 allListViews that have exactlyamountitems (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 allListViews 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 matchesListViews that have the givenplaceHolder. As a special case if theplaceHolderis an instance ofLabeledthen the placeholder matches if the givenplaceHolder's text is equal to the ListView's text.- Parameters:
placeHolder- the placeHolderNodethe matched ListView's should have
-
hasVisiblePlaceholder
public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasVisiblePlaceholder(javafx.scene.Node placeHolder)
Creates a matcher that matchesListViews that have the given visibleplaceHolder. As a special case if theplaceHolderis an instance ofLabeledthen the placeholder matches if the givenplaceHolder's text is equal to the ListView's text and the ListView's placeHolder is visible.- Parameters:
placeHolder- the visible placeHolderNodethe matched ListView's should have
-
hasSelectedRow
public static org.hamcrest.Matcher<javafx.scene.control.ListView> hasSelectedRow(java.lang.Object value)
Creates a matcher that matchesListViews that have the given value within their selection.- Parameters:
value- the value placeHolderTthe matched ListView's should have
-
hasSelectedItem
private static boolean hasSelectedItem(javafx.scene.control.ListView<?> listView, java.lang.Object value)
-
hasListCell
private static boolean hasListCell(javafx.scene.control.ListView listView, java.lang.Object value)
-
hasCellValue
private static boolean hasCellValue(javafx.scene.control.Cell cell, java.lang.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 java.lang.String getItemsString(javafx.scene.control.ListView<?> listView)
-
getPlaceHolderDescription
private static java.lang.String getPlaceHolderDescription(javafx.scene.Node placeHolder, boolean describeVisibility)
-
-