This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 67805 - Module unable to set LookAndFeel - compatibility breakage
Summary: Module unable to set LookAndFeel - compatibility breakage
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2005-10-30 22:04 UTC by _ ttran
Modified: 2008-12-22 20:44 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Quaqua LaF module (917.76 KB, application/octet-stream)
2005-10-30 22:21 UTC, _ ttran
Details
quaqua LaF module sources (919.28 KB, application/x-compressed)
2005-10-30 22:24 UTC, _ ttran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ ttran 2005-10-30 22:04:05 UTC
I have a trivial module which detects if the current LookAndFeel is Aqua and if so then installs Quaqua 
LooAndFeel.  Quaqua is a proxy LaF which delegates most of its work to Aqua LaF but reimplements 
some controls to fix UI bugs in Apple Aqua LaF.   The notable one is the file chooser.

In essense what the quaqualaf module does is to have this piece of code in its ModuleInstall.restored()

    public void restored () {
        String laf = UIManager.getLookAndFeel().getClass().getName();
        if ("apple.laf.AquaLookAndFeel".equals(laf)) {
            try {
                UIManager.setLookAndFeel(
                    "ch.randelshofer.quaqua.QuaquaLookAndFeel");
            } catch (InstantiationException ex) {
                ex.printStackTrace();
            } catch (UnsupportedLookAndFeelException ex) {
                ex.printStackTrace();
            } catch (ClassNotFoundException ex) {
                ex.printStackTrace();
            } catch (IllegalAccessException ex) {
                ex.printStackTrace();
            }
        }
    }  

This is similar to what Petr Nejedly did a while ago in his contrib/plafswitcher module except quaqualaf 
does it only for quaqua and includes quaqua.jar library.

This module worked perfectly well in 4.0, 4.1 and probably all older versions of NB but does not work 
anymore in 5.0dev builds.  We changed the startup sequence.  The core now sets LaF after all 
ModuleInstall.restored() are called.

Two points

1) this is compatibility breakage

2) it seems there is no way to achieve the same thing in 5.0: a module wants to package a LaF and sets 
it when the IDE is run.  This was possible in all previous versions

I'll attach the NBM and the code of quaqualaf module.  On non-Mac platform this bug can be 
reproduced by a similar module which sets LaF to the non-default one in its ModuleInstall.restored(), ie 
to Metal on windows, motif or gtk on unix
Comment 1 _ ttran 2005-10-30 22:21:31 UTC
Created attachment 26458 [details]
Quaqua LaF module
Comment 2 _ ttran 2005-10-30 22:24:58 UTC
Created attachment 26459 [details]
quaqua LaF module sources
Comment 3 Jan Chalupa 2005-10-31 07:50:09 UTC
Yarda, as discussed...

Radim, fyi, a potential startup sequence change.
Comment 4 Jaroslav Tulach 2005-10-31 09:20:14 UTC
Compatibility is important. 
Comment 5 Jaroslav Tulach 2005-10-31 09:26:23 UTC
cvs -q ci -m "#67805: Initializing UI as soon as classloaders are ready" 
Checking in startup/src/org/netbeans/core/startup/Main.java; 
/cvs/core/startup/src/org/netbeans/core/startup/Main.java,v  <--  Main.java 
new revision: 1.8; previous revision: 1.7 
done 
Checking in startup/src/org/netbeans/core/startup/NbInstaller.java; 
/cvs/core/startup/src/org/netbeans/core/startup/NbInstaller.java,v  <--  
NbInstaller.java 
new revision: 1.20; previous revision: 1.19 
 
 
I believe this is going to fix the problem. Milosi, can you try that on Mac 
with the attached NBMs? 
Comment 6 Milos Kleint 2005-10-31 12:14:01 UTC
yes it fixes the problem. quaqua LF gets installed.