- java.lang.Object
-
- org.testfx.toolkit.impl.ToolkitServiceImpl
-
- All Implemented Interfaces:
ToolkitService
public class ToolkitServiceImpl extends Object implements ToolkitService
-
-
Constructor Summary
Constructors Constructor Description ToolkitServiceImpl(ApplicationLauncher applicationLauncher, ApplicationService applicationService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<Void>cleanupApplication(Application application)CallsApplicationService.stop(Application)on the given application.Future<Application>setupApplication(Supplier<Stage> stageSupplier, Class<? extends Application> applicationClass, String... applicationArgs)Creates, initializes, and starts the given applicationClass and returns aFuturewhoseFuture.get()returns the created application.Future<Application>setupApplication(Supplier<Stage> stageSupplier, Supplier<Application> applicationSupplier, String... applicationArgs)Creates, initializes, and starts the supplied application and returns aFuturewhoseFuture.get()returns the created application.Future<Void>setupFixture(Runnable runnable)Runs the given runnable on theJavaFX Application Thread.<T> Future<T>setupFixture(Callable<T> callable)Runs the given callable on theJavaFX Application Thread.Future<Stage>setupPrimaryStage(CompletableFuture<Stage> primaryStageFuture, Class<? extends Application> applicationClass, String... applicationArgs)If the givenCompletableFuture.isDone(), returns that future; otherwise, launches the given application with its arguments.Future<Scene>setupScene(Stage stage, Supplier<? extends Scene> sceneSupplier)Sets the given scene as the given stage's scene on theJavaFX Application Threadand returns aFuturewhoseFuture.get()returns the given scene.Future<Parent>setupSceneRoot(Stage stage, Supplier<? extends Parent> sceneRootSupplier)Wraps the parent in a scene, sets that scene as the given stage's scene on theJavaFX Application Thread, and returns aFuturewhoseFuture.get()returns the given parent.Future<Stage>setupStage(Stage stage, Consumer<Stage> stageConsumer)Calls the stageConsumer with the given stage on theJavaFX Application Threadand returns aFuturewhoseFuture.get()returns that stage.
-
-
-
Constructor Detail
-
ToolkitServiceImpl
public ToolkitServiceImpl(ApplicationLauncher applicationLauncher, ApplicationService applicationService)
-
-
Method Detail
-
setupPrimaryStage
public Future<Stage> setupPrimaryStage(CompletableFuture<Stage> primaryStageFuture, Class<? extends Application> applicationClass, String... applicationArgs)
Description copied from interface:ToolkitServiceIf the givenCompletableFuture.isDone(), returns that future; otherwise, launches the given application with its arguments.- Specified by:
setupPrimaryStagein interfaceToolkitService
-
setupFixture
public Future<Void> setupFixture(Runnable runnable)
Description copied from interface:ToolkitServiceRuns the given runnable on theJavaFX Application Thread.- Specified by:
setupFixturein interfaceToolkitService
-
setupFixture
public <T> Future<T> setupFixture(Callable<T> callable)
Description copied from interface:ToolkitServiceRuns the given callable on theJavaFX Application Thread.- Specified by:
setupFixturein interfaceToolkitService
-
setupStage
public Future<Stage> setupStage(Stage stage, Consumer<Stage> stageConsumer)
Description copied from interface:ToolkitServiceCalls the stageConsumer with the given stage on theJavaFX Application Threadand returns aFuturewhoseFuture.get()returns that stage.- Specified by:
setupStagein interfaceToolkitService
-
setupScene
public Future<Scene> setupScene(Stage stage, Supplier<? extends Scene> sceneSupplier)
Description copied from interface:ToolkitServiceSets the given scene as the given stage's scene on theJavaFX Application Threadand returns aFuturewhoseFuture.get()returns the given scene.- Specified by:
setupScenein interfaceToolkitService
-
setupSceneRoot
public Future<Parent> setupSceneRoot(Stage stage, Supplier<? extends Parent> sceneRootSupplier)
Description copied from interface:ToolkitServiceWraps the parent in a scene, sets that scene as the given stage's scene on theJavaFX Application Thread, and returns aFuturewhoseFuture.get()returns the given parent.- Specified by:
setupSceneRootin interfaceToolkitService
-
setupApplication
public Future<Application> setupApplication(Supplier<Stage> stageSupplier, Class<? extends Application> applicationClass, String... applicationArgs)
Description copied from interface:ToolkitServiceCreates, initializes, and starts the given applicationClass and returns aFuturewhoseFuture.get()returns the created application.- Specified by:
setupApplicationin interfaceToolkitService
-
setupApplication
public Future<Application> setupApplication(Supplier<Stage> stageSupplier, Supplier<Application> applicationSupplier, String... applicationArgs)
Description copied from interface:ToolkitServiceCreates, initializes, and starts the supplied application and returns aFuturewhoseFuture.get()returns the created application.- Specified by:
setupApplicationin interfaceToolkitService
-
cleanupApplication
public Future<Void> cleanupApplication(Application application)
Description copied from interface:ToolkitServiceCallsApplicationService.stop(Application)on the given application.- Specified by:
cleanupApplicationin interfaceToolkitService
-
-