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

Print this page
rev 4258 : [NEW BUG]: Add Look&Feel support for AIX platform
Contributed-by: Sean Chou <zhouyx@linux.vnet.ibm.com>


 591      * @see #getCrossPlatformLookAndFeelClassName
 592      */
 593     public static String getSystemLookAndFeelClassName() {
 594         String systemLAF = AccessController.doPrivileged(
 595                              new GetPropertyAction("swing.systemlaf"));
 596         if (systemLAF != null) {
 597             return systemLAF;
 598         }
 599         OSInfo.OSType osType = AccessController.doPrivileged(OSInfo.getOSTypeAction());
 600         if (osType == OSInfo.OSType.WINDOWS) {
 601             return "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
 602         } else {
 603             String desktop = AccessController.doPrivileged(new GetPropertyAction("sun.desktop"));
 604             Toolkit toolkit = Toolkit.getDefaultToolkit();
 605             if ("gnome".equals(desktop) &&
 606                     toolkit instanceof SunToolkit &&
 607                     ((SunToolkit) toolkit).isNativeGTKAvailable()) {
 608                 // May be set on Linux and Solaris boxs.
 609                 return "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
 610             }
 611             if (osType == OSInfo.OSType.SOLARIS) {
 612                 return "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
 613             }
 614         }
 615         return getCrossPlatformLookAndFeelClassName();
 616     }
 617 
 618 
 619     /**
 620      * Returns the name of the <code>LookAndFeel</code> class that implements
 621      * the default cross platform look and feel -- the Java
 622      * Look and Feel (JLF).  This value can be overriden by setting the
 623      * <code>swing.crossplatformlaf</code> system property.
 624      *
 625      * @return  a string with the JLF implementation-class
 626      * @see #setLookAndFeel
 627      * @see #getSystemLookAndFeelClassName
 628      */
 629     public static String getCrossPlatformLookAndFeelClassName() {
 630         String laf = AccessController.doPrivileged(
 631                              new GetPropertyAction("swing.crossplatformlaf"));




 591      * @see #getCrossPlatformLookAndFeelClassName
 592      */
 593     public static String getSystemLookAndFeelClassName() {
 594         String systemLAF = AccessController.doPrivileged(
 595                              new GetPropertyAction("swing.systemlaf"));
 596         if (systemLAF != null) {
 597             return systemLAF;
 598         }
 599         OSInfo.OSType osType = AccessController.doPrivileged(OSInfo.getOSTypeAction());
 600         if (osType == OSInfo.OSType.WINDOWS) {
 601             return "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
 602         } else {
 603             String desktop = AccessController.doPrivileged(new GetPropertyAction("sun.desktop"));
 604             Toolkit toolkit = Toolkit.getDefaultToolkit();
 605             if ("gnome".equals(desktop) &&
 606                     toolkit instanceof SunToolkit &&
 607                     ((SunToolkit) toolkit).isNativeGTKAvailable()) {
 608                 // May be set on Linux and Solaris boxs.
 609                 return "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
 610             }
 611             if (osType == OSInfo.OSType.SOLARIS || osType == OSInfo.OSType.AIX) {
 612                 return "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
 613             }
 614         }
 615         return getCrossPlatformLookAndFeelClassName();
 616     }
 617 
 618 
 619     /**
 620      * Returns the name of the <code>LookAndFeel</code> class that implements
 621      * the default cross platform look and feel -- the Java
 622      * Look and Feel (JLF).  This value can be overriden by setting the
 623      * <code>swing.crossplatformlaf</code> system property.
 624      *
 625      * @return  a string with the JLF implementation-class
 626      * @see #setLookAndFeel
 627      * @see #getSystemLookAndFeelClassName
 628      */
 629     public static String getCrossPlatformLookAndFeelClassName() {
 630         String laf = AccessController.doPrivileged(
 631                              new GetPropertyAction("swing.crossplatformlaf"));