- java.lang.Object
-
- org.testfx.service.finder.impl.WindowFinderImpl
-
- All Implemented Interfaces:
WindowFinder
public class WindowFinderImpl extends Object implements WindowFinder
-
-
Constructor Summary
Constructors Constructor Description WindowFinderImpl()
-
Method Summary
Modifier and Type Method Description List<javafx.stage.Window>
listTargetWindows()
Returns a list of windows that are ordered by proximity to the last target window.List<javafx.stage.Window>
listWindows()
javafx.stage.Window
targetWindow()
Returns the last stored target window.void
targetWindow(int windowIndex)
Stores the window returned fromWindowFinder.window(int)
as the new last target window.void
targetWindow(String stageTitleRegex)
Stores the stage whose title matches the given regex as the new last target window.void
targetWindow(Predicate<javafx.stage.Window> predicate)
Stores the first window that is closes by proximity to the last stored target window and passes the given predicate as the new last target window or throws aNoSuchElementException
if none exist.void
targetWindow(Pattern stageTitlePattern)
Stores the stage whose title matches the given regex as the new last target window.void
targetWindow(javafx.scene.Node node)
Stores the given node's scene's window as the new last target window.void
targetWindow(javafx.scene.Scene scene)
Stores the given scene's window as the new last target window.void
targetWindow(javafx.stage.Window window)
Stores the given window as the target window.javafx.stage.Window
window(int windowIndex)
Returns the window at the given index from the list of windows that are ordered by proximity to the last stored target window.javafx.stage.Window
window(String stageTitleRegex)
Returns the stage whose title matches the given regex.javafx.stage.Window
window(Predicate<javafx.stage.Window> predicate)
CallsWindowFinder.listTargetWindows()
and returns the first window that passes the predicate or throws aNoSuchElementException
if none exist.javafx.stage.Window
window(Pattern stageTitlePattern)
Returns the stage whose title matches the given regex.javafx.stage.Window
window(javafx.scene.Node node)
Returns the node's scene's window.javafx.stage.Window
window(javafx.scene.Scene scene)
Returns the scene's window.
-
-
-
Method Detail
-
targetWindow
public javafx.stage.Window targetWindow()
Description copied from interface:WindowFinder
Returns the last stored target window.- Specified by:
targetWindow
in interfaceWindowFinder
-
targetWindow
public void targetWindow(javafx.stage.Window window)
Description copied from interface:WindowFinder
Stores the given window as the target window.- Specified by:
targetWindow
in interfaceWindowFinder
-
targetWindow
public void targetWindow(Predicate<javafx.stage.Window> predicate)
Description copied from interface:WindowFinder
Stores the first window that is closes by proximity to the last stored target window and passes the given predicate as the new last target window or throws aNoSuchElementException
if none exist.- Specified by:
targetWindow
in interfaceWindowFinder
-
listWindows
public List<javafx.stage.Window> listWindows()
Description copied from interface:WindowFinder
- Specified by:
listWindows
in interfaceWindowFinder
-
listTargetWindows
public List<javafx.stage.Window> listTargetWindows()
Description copied from interface:WindowFinder
Returns a list of windows that are ordered by proximity to the last target window.- Specified by:
listTargetWindows
in interfaceWindowFinder
-
window
public javafx.stage.Window window(Predicate<javafx.stage.Window> predicate)
Description copied from interface:WindowFinder
CallsWindowFinder.listTargetWindows()
and returns the first window that passes the predicate or throws aNoSuchElementException
if none exist.- Specified by:
window
in interfaceWindowFinder
-
targetWindow
public void targetWindow(int windowIndex)
Description copied from interface:WindowFinder
Stores the window returned fromWindowFinder.window(int)
as the new last target window.- Specified by:
targetWindow
in interfaceWindowFinder
-
targetWindow
public void targetWindow(String stageTitleRegex)
Description copied from interface:WindowFinder
Stores the stage whose title matches the given regex as the new last target window.- Specified by:
targetWindow
in interfaceWindowFinder
-
targetWindow
public void targetWindow(Pattern stageTitlePattern)
Description copied from interface:WindowFinder
Stores the stage whose title matches the given regex as the new last target window.- Specified by:
targetWindow
in interfaceWindowFinder
-
targetWindow
public void targetWindow(javafx.scene.Scene scene)
Description copied from interface:WindowFinder
Stores the given scene's window as the new last target window.- Specified by:
targetWindow
in interfaceWindowFinder
-
targetWindow
public void targetWindow(javafx.scene.Node node)
Description copied from interface:WindowFinder
Stores the given node's scene's window as the new last target window.- Specified by:
targetWindow
in interfaceWindowFinder
-
window
public javafx.stage.Window window(int windowIndex)
Description copied from interface:WindowFinder
Returns the window at the given index from the list of windows that are ordered by proximity to the last stored target window.- Specified by:
window
in interfaceWindowFinder
-
window
public javafx.stage.Window window(String stageTitleRegex)
Description copied from interface:WindowFinder
Returns the stage whose title matches the given regex.- Specified by:
window
in interfaceWindowFinder
-
window
public javafx.stage.Window window(Pattern stageTitlePattern)
Description copied from interface:WindowFinder
Returns the stage whose title matches the given regex.- Specified by:
window
in interfaceWindowFinder
-
window
public javafx.stage.Window window(javafx.scene.Scene scene)
Description copied from interface:WindowFinder
Returns the scene's window.- Specified by:
window
in interfaceWindowFinder
-
window
public javafx.stage.Window window(javafx.scene.Node node)
Description copied from interface:WindowFinder
Returns the node's scene's window.- Specified by:
window
in interfaceWindowFinder
-
-