changeset 1788:eac2df24a6c0

Automated merge with ssh://jpgodine@jfxsrc.us.oracle.com//javafx/8.0/MASTER/jfx//rt
author jpgodine@JPGODINE-LAP.st-users.us.oracle.com
date Tue, 02 Oct 2012 09:02:40 -0700
parents 7c436f8509c8 08067ae69c0c
children da3f3de73066
files
diffstat 3 files changed, 78 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/.classpath	Thu Sep 27 16:12:06 2012 -0700
+++ b/.classpath	Tue Oct 02 09:02:40 2012 -0700
@@ -1,24 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+	<classpathentry kind="src" path="javafx-beans-dt/src"/>
+	<classpathentry kind="src" path="javafx-beans-dt/test"/>
+	<classpathentry kind="src" path="javafx-concurrent/src"/>
+	<classpathentry kind="src" path="javafx-concurrent/test"/>
+	<classpathentry kind="src" path="javafx-concurrent/build/builders"/>
+	<classpathentry kind="src" path="javafx-designtime/src"/>
+	<!--
+	<classpathentry kind="src" path="javafx-designtime/test"/>
+	-->
+	<classpathentry kind="src" path="javafx-fxml/src"/>
+	<classpathentry kind="src" path="javafx-fxml/test"/>
+	<classpathentry kind="src" path="javafx-ui-charts/src"/>
+	<classpathentry kind="src" path="javafx-ui-charts/build/builders"/>
+	<classpathentry kind="src" path="javafx-ui-common/src"/>
+	<classpathentry kind="src" path="javafx-ui-common/test/unit"/>
+	<classpathentry kind="src" path="javafx-ui-common/build/builders"/>
 	<classpathentry kind="src" path="javafx-ui-controls/src"/>
 	<classpathentry kind="src" path="javafx-ui-controls/test"/>
 	<classpathentry kind="src" path="javafx-ui-controls/build/builders"/>
-	<classpathentry kind="src" path="javafx-ui-common/src"/>
-	<classpathentry kind="src" path="javafx-ui-common/test/unit"/>
-	<classpathentry kind="src" path="javafx-ui-common/build/builders"/>
-	<classpathentry kind="src" path="javafx-ui-charts/src"/>
-	<classpathentry kind="src" path="javafx-ui-charts/build/builders"/>
-	<!--
-	<classpathentry kind="src" path="javafx-designtime/test"/>
-	-->
-	<classpathentry kind="src" path="javafx-concurrent/src"/>
-	<classpathentry kind="src" path="javafx-concurrent/test"/>
-	<classpathentry kind="src" path="javafx-concurrent/build/builders"/>
 	<classpathentry kind="src" path="javafx-util-converter/src"/>
 	<classpathentry kind="src" path="javafx-util-converter/test"/>
-	<classpathentry kind="src" path="javafx-beans-dt/src"/>
-	<classpathentry kind="src" path="javafx-beans-dt/test"/>
-	<classpathentry kind="src" path="javafx-designtime/src"/>
 	<classpathentry kind="src" path="test-stub-toolkit/src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
--- a/javafx-ui-common/src/com/sun/javafx/embed/EmbeddedStageInterface.java	Thu Sep 27 16:12:06 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/embed/EmbeddedStageInterface.java	Tue Oct 02 09:02:40 2012 -0700
@@ -46,4 +46,9 @@
      * traversed forward in the focus chain in embedding app. 
      */
     public void setFocused(boolean focused, int focusCause);
+
+    /*
+     * FOCUS_UNGRAB notification.
+     */
+    public void focusUngrab();
 }
--- a/javafx-ui-common/src/com/sun/javafx/embed/HostInterface.java	Thu Sep 27 16:12:06 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/embed/HostInterface.java	Tue Oct 02 09:02:40 2012 -0700
@@ -82,4 +82,61 @@
      * Called by embedded FX scene when its cursor is changed.
      */
     public void setCursor(CursorFrame cursorFrame);
+
+    /**
+     * Grabs focus on this window.
+     *
+     * All mouse clicks that occur in this window's client area or client-areas
+     * of any of its unfocusable owned windows are delivered as usual. Whenever
+     * a click occurs on another app's window (not related via the ownership
+     * relation with this one, or a focusable owned window), or on non-client
+     * area of any window (titlebar, etc.), or any third-party app's window, or
+     * native OS GUI (e.g. a taskbar), the grab is automatically reset, and the
+     * window that held the grab receives the FOCUS_UNGRAB event.
+     *
+     * Note that for this functionality to work correctly, the window must have
+     * a focus upon calling this method. All owned popup windows that should be
+     * operable during the grabbed focus state (e.g. nested popup menus) must
+     * be unfocusable (see {@link #setFocusable}). Clicking a focusable owned
+     * window will reset the grab due to a focus transfer.
+     *
+     * The click that occurs in another window and causes resetting of the grab
+     * may or may not be delivered to that other window depending on the native
+     * OS behavior.
+     *
+     * If any of the application's windows already holds the grab, it is reset
+     * prior to grabbing the focus for this window. The method may be called
+     * multiple times for one window. Subsequent calls do not affect the grab
+     * status unless it is reset between the calls, in which case the focus
+     * is grabbed again.
+     *
+     * Note that grabbing the focus on an application window may prevent
+     * delivering certain events to other applications until the grab is reset.
+     * Therefore, if the application has finished showing popup windows based
+     * on a user action (e.g. clicking a menu item), and doesn't require the
+     * grab any more, it should call the {@link #ungrabFocus} method. The
+     * FOCUS_UNGRAB event signals that the grab has been reset.
+     *
+     * A user event handler associated with a menu item must be invoked after
+     * resetting the grab. Otherwise, if a developer debugs the application and
+     * has installed a breakpoint in the event handler, the debugger may become
+     * unoperable due to events blocking for other applications on some
+     * platforms.
+     *
+     * @return {@code true} if the operation is successful
+     * @throws IllegalStateException if the window isn't focused currently
+     */
+    public boolean grabFocus();
+
+    /**
+     * Manually ungrabs focus grabbed on this window previously.
+     *
+     * This method resets the grab, and forces sending of the FOCUS_UNGRAB
+     * event. It should be used when popup windows (such as menus) should be
+     * dismissed manually, e.g. when a user clicks a menu item which usually
+     * causes the menus to hide.
+     *
+     * @see #grabFocus
+     */
+    public void ungrabFocus();
 }