jdk/src/java.desktop/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java
author ssadetsky
Wed, 19 Oct 2016 11:51:40 +0300
changeset 41805 d30817604de5
parent 37694 c064aefc5a2f
permissions -rw-r--r--
8154434: Open the request focus methods of the java.awt.Component which accept FocusEvent.Cause Reviewed-by: azvegint
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
37694
c064aefc5a2f 8080395: consider making sun.awt.CausedFocusEvent functionality public
ssadetsky
parents: 33853
diff changeset
     2
 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3938
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package sun.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.awt.Component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.Window;
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    29
import java.awt.Canvas;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    30
import java.awt.Scrollbar;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    31
import java.awt.Panel;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    32
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    33
import java.awt.event.FocusEvent;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.peer.KeyboardFocusManagerPeer;
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    36
import java.awt.peer.ComponentPeer;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
30469
bac0a7ff7e1e 8074028: Remove API references to java.awt.peer
serb
parents: 25859
diff changeset
    38
import sun.awt.AWTAccessor.ComponentAccessor;
3938
ef327bd847c0 6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes
mchung
parents: 2464
diff changeset
    39
import sun.util.logging.PlatformLogger;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    41
public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManagerPeer {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    42
3938
ef327bd847c0 6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes
mchung
parents: 2464
diff changeset
    43
    private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl");
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    44
33853
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
    45
    private static class KfmAccessor {
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
    46
        private static AWTAccessor.KeyboardFocusManagerAccessor instance =
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
    47
                AWTAccessor.getKeyboardFocusManagerAccessor();
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
    48
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    50
    // The constants are copied from java.awt.KeyboardFocusManager
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    51
    public static final int SNFH_FAILURE         = 0;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    52
    public static final int SNFH_SUCCESS_HANDLED = 1;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    53
    public static final int SNFH_SUCCESS_PROCEED = 2;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    54
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    55
    @Override
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    56
    public void clearGlobalFocusOwner(Window activeWindow) {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    57
        if (activeWindow != null) {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    58
            Component focusOwner = activeWindow.getFocusOwner();
18178
ee71c923891d 8016747: Replace deprecated PlatformLogger isLoggable(int) with isLoggable(Level)
chegar
parents: 16839
diff changeset
    59
            if (focusLog.isLoggable(PlatformLogger.Level.FINE)) {
3938
ef327bd847c0 6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes
mchung
parents: 2464
diff changeset
    60
                focusLog.fine("Clearing global focus owner " + focusOwner);
16839
d0f2e97b7359 8010297: Missing isLoggable() checks in logging code
anthony
parents: 13652
diff changeset
    61
            }
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    62
            if (focusOwner != null) {
37694
c064aefc5a2f 8080395: consider making sun.awt.CausedFocusEvent functionality public
ssadetsky
parents: 33853
diff changeset
    63
                FocusEvent fl = new FocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null,
c064aefc5a2f 8080395: consider making sun.awt.CausedFocusEvent functionality public
ssadetsky
parents: 33853
diff changeset
    64
                                                     FocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    65
                SunToolkit.postPriorityEvent(fl);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    66
            }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    67
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    70
    /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    71
     * WARNING: Don't call it on the Toolkit thread.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    72
     *
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    73
     * Checks if the component:
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    74
     * 1) accepts focus on click (in general)
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    75
     * 2) may be a focus owner (in particular)
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    76
     */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    77
    public static boolean shouldFocusOnClick(Component component) {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    78
        boolean acceptFocusOnClick = false;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    79
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    80
        // A component is generally allowed to accept focus on click
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    81
        // if its peer is focusable. There're some exceptions though.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    82
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    83
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    84
        // CANVAS & SCROLLBAR accept focus on click
30469
bac0a7ff7e1e 8074028: Remove API references to java.awt.peer
serb
parents: 25859
diff changeset
    85
        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    86
        if (component instanceof Canvas ||
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    87
            component instanceof Scrollbar)
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    88
        {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    89
            acceptFocusOnClick = true;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    90
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    91
        // PANEL, empty only, accepts focus on click
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    92
        } else if (component instanceof Panel) {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    93
            acceptFocusOnClick = (((Panel)component).getComponentCount() == 0);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    94
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    95
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    96
        // Other components
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    97
        } else {
30469
bac0a7ff7e1e 8074028: Remove API references to java.awt.peer
serb
parents: 25859
diff changeset
    98
            ComponentPeer peer = (component != null ? acc.getPeer(component) : null);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    99
            acceptFocusOnClick = (peer != null ? peer.isFocusable() : false);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   100
        }
30469
bac0a7ff7e1e 8074028: Remove API references to java.awt.peer
serb
parents: 25859
diff changeset
   101
        return acceptFocusOnClick && acc.canBeFocusOwner(component);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   104
    /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   105
     * Posts proper lost/gain focus events to the event queue.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   106
     */
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 5506
diff changeset
   107
    @SuppressWarnings("deprecation")
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   108
    public static boolean deliverFocus(Component lightweightChild,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   109
                                       Component target,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   110
                                       boolean temporary,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   111
                                       boolean focusedWindowChangeAllowed,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   112
                                       long time,
37694
c064aefc5a2f 8080395: consider making sun.awt.CausedFocusEvent functionality public
ssadetsky
parents: 33853
diff changeset
   113
                                       FocusEvent.Cause cause,
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   114
                                       Component currentFocusOwner) // provided by the descendant peers
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   115
    {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   116
        if (lightweightChild == null) {
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 5506
diff changeset
   117
            lightweightChild = target;
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   118
        }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   119
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   120
        Component currentOwner = currentFocusOwner;
30469
bac0a7ff7e1e 8074028: Remove API references to java.awt.peer
serb
parents: 25859
diff changeset
   121
        if (currentOwner != null && !currentOwner.isDisplayable()) {
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   122
            currentOwner = null;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   123
        }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   124
        if (currentOwner != null) {
37694
c064aefc5a2f 8080395: consider making sun.awt.CausedFocusEvent functionality public
ssadetsky
parents: 33853
diff changeset
   125
            FocusEvent fl = new FocusEvent(currentOwner, FocusEvent.FOCUS_LOST,
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   126
                                                 false, lightweightChild, cause);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   127
18178
ee71c923891d 8016747: Replace deprecated PlatformLogger isLoggable(int) with isLoggable(Level)
chegar
parents: 16839
diff changeset
   128
            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
3938
ef327bd847c0 6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes
mchung
parents: 2464
diff changeset
   129
                focusLog.finer("Posting focus event: " + fl);
16839
d0f2e97b7359 8010297: Missing isLoggable() checks in logging code
anthony
parents: 13652
diff changeset
   130
            }
13652
42544e68dc39 6981400: Tabbing between textfield do not work properly when ALT+TAB
ant
parents: 13648
diff changeset
   131
            SunToolkit.postEvent(SunToolkit.targetToAppContext(currentOwner), fl);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   132
        }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   133
37694
c064aefc5a2f 8080395: consider making sun.awt.CausedFocusEvent functionality public
ssadetsky
parents: 33853
diff changeset
   134
        FocusEvent fg = new FocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED,
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   135
                                             false, currentOwner, cause);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   136
18178
ee71c923891d 8016747: Replace deprecated PlatformLogger isLoggable(int) with isLoggable(Level)
chegar
parents: 16839
diff changeset
   137
        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
3938
ef327bd847c0 6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes
mchung
parents: 2464
diff changeset
   138
            focusLog.finer("Posting focus event: " + fg);
16839
d0f2e97b7359 8010297: Missing isLoggable() checks in logging code
anthony
parents: 13652
diff changeset
   139
        }
13652
42544e68dc39 6981400: Tabbing between textfield do not work properly when ALT+TAB
ant
parents: 13648
diff changeset
   140
        SunToolkit.postEvent(SunToolkit.targetToAppContext(lightweightChild), fg);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   141
        return true;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   144
    // WARNING: Don't call it on the Toolkit thread.
41805
d30817604de5 8154434: Open the request focus methods of the java.awt.Component which accept FocusEvent.Cause
ssadetsky
parents: 37694
diff changeset
   145
    public static void requestFocusFor(Component target, FocusEvent.Cause cause) {
d30817604de5 8154434: Open the request focus methods of the java.awt.Component which accept FocusEvent.Cause
ssadetsky
parents: 37694
diff changeset
   146
        AWTAccessor.getComponentAccessor().requestFocus(target, cause);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   147
    }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   148
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   149
    // WARNING: Don't call it on the Toolkit thread.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   150
    public static int shouldNativelyFocusHeavyweight(Component heavyweight,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   151
                                                     Component descendant,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   152
                                                     boolean temporary,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   153
                                                     boolean focusedWindowChangeAllowed,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   154
                                                     long time,
37694
c064aefc5a2f 8080395: consider making sun.awt.CausedFocusEvent functionality public
ssadetsky
parents: 33853
diff changeset
   155
                                                     FocusEvent.Cause cause)
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   156
    {
33853
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
   157
        return KfmAccessor.instance.shouldNativelyFocusHeavyweight(
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
   158
            heavyweight, descendant, temporary, focusedWindowChangeAllowed,
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
   159
                time, cause);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   160
    }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   161
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    public static void removeLastFocusRequest(Component heavyweight) {
33853
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
   163
        KfmAccessor.instance.removeLastFocusRequest(heavyweight);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   164
    }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   165
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   166
    // WARNING: Don't call it on the Toolkit thread.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   167
    public static boolean processSynchronousLightweightTransfer(Component heavyweight,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   168
                                                                Component descendant,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   169
                                                                boolean temporary,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   170
                                                                boolean focusedWindowChangeAllowed,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   171
                                                                long time)
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
   172
    {
33853
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
   173
        return KfmAccessor.instance.processSynchronousLightweightTransfer(
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
   174
            heavyweight, descendant, temporary, focusedWindowChangeAllowed,
a26aa530a23a 8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
ssadetsky
parents: 30469
diff changeset
   175
                time);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
}