Class TextMatchers

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

public class TextMatchers extends Object
TestFX matchers for Text nodes.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.hamcrest.Matcher<javafx.scene.text.Text>
    hasFont(javafx.scene.text.Font font)
    Creates a matcher that matches all Texts that have the given font.
    static org.hamcrest.Matcher<javafx.scene.text.Text>
    hasFontSmoothingType(javafx.scene.text.FontSmoothingType smoothingType)
    Creates a matcher that matches all Texts that have the given smoothingType (either FontSmoothingType.GRAY or FontSmoothingType.LCD).
    static org.hamcrest.Matcher<javafx.scene.text.Text>
    hasStrikethrough(boolean strikethrough)
    Creates a matcher that matches all Texts 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 all Texts whose text equals the given text.
    static org.hamcrest.Matcher<javafx.scene.text.Text>
    hasText(org.hamcrest.Matcher<String> matcher)
    Creates a matcher that matches all Texts whose text matches the given matcher.
    static org.hamcrest.Matcher<javafx.scene.text.Text>
    isUnderlined(boolean underlined)
    Creates a matcher that matches all Texts that are underlined (that is, they should be drawn with a line below them).
    private static String
    toText(javafx.scene.text.Font font)
     

    Methods inherited from class java.lang.Object

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

    • TextMatchers

      private TextMatchers()
  • Method Details

    • hasText

      public static org.hamcrest.Matcher<javafx.scene.text.Text> hasText(String text)
      Creates a matcher that matches all Texts whose text equals the given text.
      Parameters:
      text - the String 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 all Texts whose text matches the given matcher.
      Parameters:
      matcher - the Matcher<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 all Texts that have the given font.
      Parameters:
      font - the Font 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 all Texts that have the given smoothingType (either FontSmoothingType.GRAY or FontSmoothingType.LCD).
      Parameters:
      smoothingType - the FontSmoothingType that matched Texts should have
    • hasStrikethrough

      public static org.hamcrest.Matcher<javafx.scene.text.Text> hasStrikethrough(boolean strikethrough)
      Creates a matcher that matches all Texts 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 all Texts 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

      private static String toText(javafx.scene.text.Font font)