diff -r 4e7d8438f660 core.startup/src/org/netbeans/core/startup/CLIOptions.java --- a/core.startup/src/org/netbeans/core/startup/CLIOptions.java Mon Apr 21 13:26:54 2008 +0200 +++ b/core.startup/src/org/netbeans/core/startup/CLIOptions.java Tue Apr 22 17:40:26 2008 +0200 @@ -46,7 +46,6 @@ import java.util.Locale; import java.util.Locale; import java.util.MissingResourceException; import org.netbeans.CLIHandler; -import org.netbeans.TopSecurityManager; import org.openide.filesystems.FileUtil; import org.openide.util.NbBundle; @@ -138,6 +137,18 @@ public class CLIOptions extends CLIHandl args[i] = null; try { String ui = args[++i]; + //Translate L&F ID into L&F class for known IDs + if ("Metal".equals(ui)) { + ui = "javax.swing.plaf.metal.MetalLookAndFeel"; + } else if ("GTK".equals(ui)) { + ui = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; + } else if ("Nimbus".equals(ui)) { + ui = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"; + } else if ("Windows".equals(ui)) { + ui = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; + } else if ("Aqua".equals(ui)) { + ui = "apple.laf.AquaLookAndFeel"; + } uiClass = Class.forName(ui); } catch(ArrayIndexOutOfBoundsException e) { System.err.println(getString("ERR_UIExpected")); diff -r 4e7d8438f660 core.startup/test/unit/src/org/netbeans/core/startup/CLIOptionsTest.java --- a/core.startup/test/unit/src/org/netbeans/core/startup/CLIOptionsTest.java Mon Apr 21 13:26:54 2008 +0200 +++ b/core.startup/test/unit/src/org/netbeans/core/startup/CLIOptionsTest.java Tue Apr 22 17:40:26 2008 +0200 @@ -41,6 +41,7 @@ package org.netbeans.core.startup; package org.netbeans.core.startup; import org.netbeans.junit.NbTestCase; +import org.openide.util.Utilities; /** * @@ -69,6 +70,31 @@ public class CLIOptionsTest extends NbTe assertTrue("Splash is explicitly disabled", CLIOptions.isNoSplash()); } + /** + * Test translation from L&F ID to L&F class. + */ + public void testLafId2LafClass () { + new CLIOptions().cli(new String[] { "--laf", "Metal" }); + try { + assertEquals("Must be Metal", CLIOptions.uiClass, Class.forName("javax.swing.plaf.metal.MetalLookAndFeel")); + } catch (ClassNotFoundException exc) { + } + if (Utilities.isWindows()) { + new CLIOptions().cli(new String[] { "--laf", "Windows" }); + try { + assertEquals("Must be Windows", CLIOptions.uiClass, Class.forName("com.sun.java.swing.plaf.windows.WindowsLookAndFeel")); + } catch (ClassNotFoundException exc) { + } + } + if (Utilities.isMac()) { + new CLIOptions().cli(new String[] { "--laf", "Aqua" }); + try { + assertEquals("Must be MacOS", CLIOptions.uiClass, Class.forName("apple.laf.AquaLookAndFeel")); + } catch (ClassNotFoundException exc) { + } + } + } + public void testUserdir() { String orig = System.setProperty("netbeans.user", "before"); new CLIOptions().cli(new String[] { "-userdir", "wrong" }); diff -r 4e7d8438f660 o.n.bootstrap/arch.xml --- a/o.n.bootstrap/arch.xml Mon Apr 21 13:26:54 2008 +0200 +++ b/o.n.bootstrap/arch.xml Tue Apr 22 17:40:26 2008 +0200 @@ -629,7 +629,22 @@ made subject to such option by the copyr
  • - Specify a look & feel. + Specify a look & feel. The same as --laf. + To make human life easier simple translation was added to convert L&F ID to + L&F class name for known L&Fs. + + + +
  • +
  • + + Specify a look & feel. The same as --ui.
  • @@ -1358,4 +1373,49 @@ made subject to such option by the copyr

    + + + + + +

    + XXX no answer for compat-deprecation +

    +
    + + + + + +

    + XXX no answer for resources-preferences +

    +
    +