List of usage examples for javafx.stage Window isFocused
public final boolean isFocused()
From source file:org.eclipse.jubula.rc.javafx.driver.RobotJavaFXImpl.java
/** * {@inheritDoc}/*from w w w . j a v a 2 s . c o m*/ */ public void activateApplication(String method) throws RobotException { try { final Window window = getActiveWindow(); if (window == null) { return; } WindowActivationMethod wam = WindowActivationMethod.createWindowActivationMethod(method, m_robot, m_queuer); wam.activate(window); // Verify that window was successfully activated Window activeWindow = (Window) m_queuer.invokeAndWait("getActiveWindow", //$NON-NLS-1$ new IRunnable() { public Object run() throws StepExecutionException { if (window.isFocused()) { return window; } return null; } }); if (activeWindow != window) { throw new StepExecutionException(I18n.getString(TestErrorEvent.WINDOW_ACTIVATION_FAILED, true), EventFactory.createActionError(TestErrorEvent.WINDOW_ACTIVATION_FAILED)); } } catch (Exception exc) { throw new RobotException(exc); } }