modules/graphics/src/test/java/test/javafx/scene/FocusTest.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 24,33 ****
--- 24,34 ----
*/
package test.javafx.scene;
+ import com.sun.javafx.scene.SceneHelper;
import test.com.sun.javafx.pgstub.StubScene;
import test.com.sun.javafx.pgstub.StubToolkit;
import com.sun.javafx.tk.Toolkit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
*** 713,732 ****
n1.requestFocus();
assertSame(n1, scene.getFocusOwner());
actionTaken = false;
! ((StubScene) scene.impl_getPeer()).setInputMethodCompositionFinishDelegate(
() -> {
assertSame(n1, scene.getFocusOwner());
actionTaken = true;
}
);
n2.requestFocus();
! ((StubScene) scene.impl_getPeer()).setInputMethodCompositionFinishDelegate(
null);
assertSame(n2, scene.getFocusOwner());
assertTrue(actionTaken);
}
--- 714,733 ----
n1.requestFocus();
assertSame(n1, scene.getFocusOwner());
actionTaken = false;
! ((StubScene) SceneHelper.getPeer(scene)).setInputMethodCompositionFinishDelegate(
() -> {
assertSame(n1, scene.getFocusOwner());
actionTaken = true;
}
);
n2.requestFocus();
! ((StubScene) SceneHelper.getPeer(scene)).setInputMethodCompositionFinishDelegate(
null);
assertSame(n2, scene.getFocusOwner());
assertTrue(actionTaken);
}