< prev index next >

src/java.desktop/share/classes/javax/swing/UIManager.java

Print this page




1419 
1420     /*
1421      * This method is called before any code that depends on the
1422      * <code>AppContext</code> specific LAFState object runs.  When the AppContext
1423      * corresponds to a set of applets it's possible for this method
1424      * to be re-entered, which is why we grab a lock before calling
1425      * initialize().
1426      */
1427     private static void maybeInitialize() {
1428         synchronized (classLock) {
1429             if (!getLAFState().initialized) {
1430                 getLAFState().initialized = true;
1431                 initialize();
1432             }
1433         }
1434     }
1435 
1436     /*
1437      * Sets default swing focus traversal policy.
1438      */

1439     private static void maybeInitializeFocusPolicy(JComponent comp) {
1440         // Check for JRootPane which indicates that a swing toplevel
1441         // is coming, in which case a swing default focus policy
1442         // should be instatiated. See 7125044.
1443         if (comp instanceof JRootPane) {
1444             synchronized (classLock) {
1445                 if (!getLAFState().focusPolicyInitialized) {
1446                     getLAFState().focusPolicyInitialized = true;
1447 
1448                     if (FocusManager.isFocusManagerEnabled()) {
1449                         KeyboardFocusManager.getCurrentKeyboardFocusManager().
1450                             setDefaultFocusTraversalPolicy(
1451                                 new LayoutFocusTraversalPolicy());
1452                     }
1453                 }
1454             }
1455         }
1456     }
1457 
1458     /*




1419 
1420     /*
1421      * This method is called before any code that depends on the
1422      * <code>AppContext</code> specific LAFState object runs.  When the AppContext
1423      * corresponds to a set of applets it's possible for this method
1424      * to be re-entered, which is why we grab a lock before calling
1425      * initialize().
1426      */
1427     private static void maybeInitialize() {
1428         synchronized (classLock) {
1429             if (!getLAFState().initialized) {
1430                 getLAFState().initialized = true;
1431                 initialize();
1432             }
1433         }
1434     }
1435 
1436     /*
1437      * Sets default swing focus traversal policy.
1438      */
1439     @SuppressWarnings("deprecation")
1440     private static void maybeInitializeFocusPolicy(JComponent comp) {
1441         // Check for JRootPane which indicates that a swing toplevel
1442         // is coming, in which case a swing default focus policy
1443         // should be instatiated. See 7125044.
1444         if (comp instanceof JRootPane) {
1445             synchronized (classLock) {
1446                 if (!getLAFState().focusPolicyInitialized) {
1447                     getLAFState().focusPolicyInitialized = true;
1448 
1449                     if (FocusManager.isFocusManagerEnabled()) {
1450                         KeyboardFocusManager.getCurrentKeyboardFocusManager().
1451                             setDefaultFocusTraversalPolicy(
1452                                 new LayoutFocusTraversalPolicy());
1453                     }
1454                 }
1455             }
1456         }
1457     }
1458 
1459     /*


< prev index next >