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

Print this page




 102 
 103     public void handleInputEvent(String text) {
 104         responder.handleInputEvent(text);
 105     }
 106 
 107     public void handleFocusEvent(boolean focused) {
 108         this.focused = focused;
 109         if (focused) {
 110             // see bug 8010925
 111             // we can't put this to handleWindowFocusEvent because
 112             // it won't be invoced if focuse is moved to a html element
 113             // on the same page.
 114             CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
 115             clipboard.checkPasteboard();
 116         }
 117         if (parentWindowActive) {
 118             responder.handleWindowFocusEvent(focused, null);
 119         }
 120     }
 121 











 122     public void handleWindowFocusEvent(boolean parentWindowActive) {
 123         this.parentWindowActive = parentWindowActive;
 124         // ignore focus "lost" native request as it may mistakenly
 125         // deactivate active window (see 8001161)
 126         if (focused && parentWindowActive) {
 127             responder.handleWindowFocusEvent(parentWindowActive, null);
 128         }
 129     }
 130 
 131     public boolean isParentWindowActive() {
 132         return parentWindowActive;
 133     }
 134 }


 102 
 103     public void handleInputEvent(String text) {
 104         responder.handleInputEvent(text);
 105     }
 106 
 107     public void handleFocusEvent(boolean focused) {
 108         this.focused = focused;
 109         if (focused) {
 110             // see bug 8010925
 111             // we can't put this to handleWindowFocusEvent because
 112             // it won't be invoced if focuse is moved to a html element
 113             // on the same page.
 114             CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
 115             clipboard.checkPasteboard();
 116         }
 117         if (parentWindowActive) {
 118             responder.handleWindowFocusEvent(focused, null);
 119         }
 120     }
 121 
 122     /**
 123      * When the window is activated and had focus before the deactivation
 124      * calling this method triggers focus events in the following order:
 125      *  1. WINDOW_ACTIVATED for this EmbeddedFrame
 126      *  2. WINDOW_GAINED_FOCUS for this EmbeddedFrame
 127      *  3. FOCUS_GAINED for the most recent focus owner in this EmbeddedFrame
 128      *
 129      * The caller must not requestFocus on the EmbeddedFrame together with calling this method.
 130      *
 131      * @param parentWindowActive true if the window is activated, false otherwise
 132      */
 133     public void handleWindowFocusEvent(boolean parentWindowActive) {
 134         this.parentWindowActive = parentWindowActive;
 135         // ignore focus "lost" native request as it may mistakenly
 136         // deactivate active window (see 8001161)
 137         if (focused && parentWindowActive) {
 138             responder.handleWindowFocusEvent(parentWindowActive, null);
 139         }
 140     }
 141 
 142     public boolean isParentWindowActive() {
 143         return parentWindowActive;
 144     }
 145 }