edvin
11/02/2016, 4:53 PMcarlw
11/02/2016, 5:01 PMedvin
11/02/2016, 5:14 PMUIComponet.openWindow()
which is like openModal()
but modeless by defaultedvin
11/02/2016, 5:15 PMedvin
11/02/2016, 5:31 PMcarlw
11/02/2016, 5:31 PMedvin
11/02/2016, 5:32 PMhastebrot
11/02/2016, 6:07 PMedvin
11/02/2016, 6:09 PMedvin
11/02/2016, 6:10 PMfun openWindow(stageStyle: StageStyle = StageStyle.DECORATED, modality: Modality = Modality.NONE, escapeClosesWindow: Boolean = true, owner: Window? = null, block: Boolean = false)
hastebrot
11/02/2016, 6:10 PMedvin
11/02/2016, 6:10 PMhastebrot
11/02/2016, 6:11 PMsetupPrimaryStage()
and lookupNodes()
.edvin
11/02/2016, 6:11 PMedvin
11/02/2016, 6:12 PMedvin
11/02/2016, 6:13 PMthomasnield
11/02/2016, 6:14 PMhastebrot
11/02/2016, 6:14 PMsetupPrimaryStage()
is for me the culmination of best practices to setup JavaFX test fixtures.edvin
11/02/2016, 6:15 PMedvin
11/02/2016, 6:16 PMthomasnield
11/02/2016, 6:16 PMthomasnield
11/02/2016, 6:16 PMedvin
11/02/2016, 6:17 PMhastebrot
11/02/2016, 6:21 PMsetupPrimaryStage(timeoutMillis: Long = 0, startupFunction: () -> Unit = { PlatformImpl.startup() }, primaryStageProvider: () -> Stage = { PRIMARY_STAGE }, action: () -> Unit = {})
hastebrot
11/02/2016, 6:25 PMtimeout
is defined using a static setTimeoutMillis()
method in TestFX. This is important for test runs not to hang. A parameter for startupFunction
is needed to make the function testable (for internal test suite), primaryStageProvider
to make the primaryStage configurable, (re)using a single "primary" stage during test runs has some advantages. action: (Stage) -> Unit
would actually provide the primary stage to setup the test stage.hastebrot
11/02/2016, 6:26 PMsetupPrimaryStage { stage -> MyApplication().start(stage) }
would be a pretty simple use-case.carlw
11/02/2016, 6:27 PMcarlw
11/02/2016, 6:32 PMhastebrot
11/02/2016, 6:35 PMpreventDuplicateCalls = true
for example, would explicitely state, that we prevent calling the toolkit startup multiple times (which causes JavaFX to throw a runtime exception).edvin
11/02/2016, 6:36 PM