src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java

Print this page




 103 
 104     public void handleInputEvent(String text) {
 105         responder.handleInputEvent(text);
 106     }
 107 
 108     // handleFocusEvent is called when the applet becames focused/unfocused.
 109     // This method can be called from different threads.
 110     public void handleFocusEvent(boolean focused) {
 111         synchronized (classLock) {
 112             // In some cases an applet may not receive the focus lost event
 113             // from the parent window (see 8012330)
 114             globalFocusedWindow = (focused) ? this
 115                     : ((globalFocusedWindow == this) ? null : globalFocusedWindow);
 116         }
 117         if (globalFocusedWindow == this) {
 118             // see bug 8010925
 119             // we can't put this to handleWindowFocusEvent because
 120             // it won't be invoced if focuse is moved to a html element
 121             // on the same page.
 122             CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
 123             clipboard.checkPasteboard();
 124         }
 125         if (parentWindowActive) {
 126             responder.handleWindowFocusEvent(focused, null);
 127         }
 128     }
 129 
 130     /**
 131      * When the parent window is activated this method is called for all EmbeddedFrames in it.
 132      *
 133      * For the CEmbeddedFrame which had focus before the deactivation this method triggers
 134      * focus events in the following order:
 135      *  1. WINDOW_ACTIVATED for this EmbeddedFrame
 136      *  2. WINDOW_GAINED_FOCUS for this EmbeddedFrame
 137      *  3. FOCUS_GAINED for the most recent focus owner in this EmbeddedFrame
 138      *
 139      * The caller must not requestFocus on the EmbeddedFrame together with calling this method.
 140      *
 141      * @param parentWindowActive true if the window is activated, false otherwise
 142      */
 143     // handleWindowFocusEvent is called for all applets, when the browser




 103 
 104     public void handleInputEvent(String text) {
 105         responder.handleInputEvent(text);
 106     }
 107 
 108     // handleFocusEvent is called when the applet becames focused/unfocused.
 109     // This method can be called from different threads.
 110     public void handleFocusEvent(boolean focused) {
 111         synchronized (classLock) {
 112             // In some cases an applet may not receive the focus lost event
 113             // from the parent window (see 8012330)
 114             globalFocusedWindow = (focused) ? this
 115                     : ((globalFocusedWindow == this) ? null : globalFocusedWindow);
 116         }
 117         if (globalFocusedWindow == this) {
 118             // see bug 8010925
 119             // we can't put this to handleWindowFocusEvent because
 120             // it won't be invoced if focuse is moved to a html element
 121             // on the same page.
 122             CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
 123             clipboard.checkPasteboardAndNotify();
 124         }
 125         if (parentWindowActive) {
 126             responder.handleWindowFocusEvent(focused, null);
 127         }
 128     }
 129 
 130     /**
 131      * When the parent window is activated this method is called for all EmbeddedFrames in it.
 132      *
 133      * For the CEmbeddedFrame which had focus before the deactivation this method triggers
 134      * focus events in the following order:
 135      *  1. WINDOW_ACTIVATED for this EmbeddedFrame
 136      *  2. WINDOW_GAINED_FOCUS for this EmbeddedFrame
 137      *  3. FOCUS_GAINED for the most recent focus owner in this EmbeddedFrame
 138      *
 139      * The caller must not requestFocus on the EmbeddedFrame together with calling this method.
 140      *
 141      * @param parentWindowActive true if the window is activated, false otherwise
 142      */
 143     // handleWindowFocusEvent is called for all applets, when the browser