Package org.testfx.matcher.control
Class TextMatchers
java.lang.Object
org.testfx.matcher.control.TextMatchers
TestFX matchers for
Text
nodes.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.hamcrest.Matcher
<javafx.scene.text.Text> hasFont
(javafx.scene.text.Font font) Creates a matcher that matches allText
s that have the givenfont
.static org.hamcrest.Matcher
<javafx.scene.text.Text> hasFontSmoothingType
(javafx.scene.text.FontSmoothingType smoothingType) Creates a matcher that matches allText
s that have the givensmoothingType
(eitherFontSmoothingType.GRAY
orFontSmoothingType.LCD
).static org.hamcrest.Matcher
<javafx.scene.text.Text> hasStrikethrough
(boolean strikethrough) Creates a matcher that matches allText
s that have strikethrough (that is, they should be drawn with a line through them).static org.hamcrest.Matcher
<javafx.scene.text.Text> Creates a matcher that matches allText
s whose text equals the giventext
.static org.hamcrest.Matcher
<javafx.scene.text.Text> Creates a matcher that matches allText
s whose text matches the givenmatcher
.static org.hamcrest.Matcher
<javafx.scene.text.Text> isUnderlined
(boolean underlined) Creates a matcher that matches allText
s that are underlined (that is, they should be drawn with a line below them).private static String
toText
(javafx.scene.text.Font font)
-
Constructor Details
-
TextMatchers
private TextMatchers()
-
-
Method Details
-
hasText
Creates a matcher that matches allText
s whose text equals the giventext
.- Parameters:
text
- theString
the matched Texts should have as their text
-
hasText
public static org.hamcrest.Matcher<javafx.scene.text.Text> hasText(org.hamcrest.Matcher<String> matcher) Creates a matcher that matches allText
s whose text matches the givenmatcher
.- Parameters:
matcher
- theMatcher<String>
the Texts text should match
-
hasFont
public static org.hamcrest.Matcher<javafx.scene.text.Text> hasFont(javafx.scene.text.Font font) Creates a matcher that matches allText
s that have the givenfont
.- Parameters:
font
- theFont
that matched Texts should have as their font
-
hasFontSmoothingType
public static org.hamcrest.Matcher<javafx.scene.text.Text> hasFontSmoothingType(javafx.scene.text.FontSmoothingType smoothingType) Creates a matcher that matches allText
s that have the givensmoothingType
(eitherFontSmoothingType.GRAY
orFontSmoothingType.LCD
).- Parameters:
smoothingType
- theFontSmoothingType
that matched Texts should have
-
hasStrikethrough
public static org.hamcrest.Matcher<javafx.scene.text.Text> hasStrikethrough(boolean strikethrough) Creates a matcher that matches allText
s that have strikethrough (that is, they should be drawn with a line through them).- Parameters:
strikethrough
- whether or not the matched Texts should have strikethrough
-
isUnderlined
public static org.hamcrest.Matcher<javafx.scene.text.Text> isUnderlined(boolean underlined) Creates a matcher that matches allText
s that are underlined (that is, they should be drawn with a line below them).- Parameters:
underlined
- whether or not the matched Texts should be underlined
-
toText
-