Quaqua Look and Feel in Netbeans

View: New views
3 Messages — Rating Filter:   Alert me  

Quaqua Look and Feel in Netbeans

by jmborer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

I like Netbeans Mac OS X theme. However it uses the ugly JFileChooser
from Swing. Quaqua provides an interesting implementation of the
latter and a jar that contains only this dialog. There is however one
diffulty: it requires the use of a native library which comes with the
look and feel.

I was able to make it work by putting the quaqua Jar and the native
libraries into my netbeans platform*/lib folder and then modifying the
etc/netbeans.conf accordingly (I can send you the details if someone
is interested).

Then I tried to write module that does all that stuff so that other
people could benefit from it easily. I created a module that has a
ModuleInstall class and set the look and feel int the restored method
by instantiating the laf and then invoking the
UIManager.setLookAndFeel method. I bundled the quaqua jar into
modules/ext and the native libraries into modules/lib. Apparently I am
missing something here because it doesn't work: no quaqua file chooser
in "Open File" with this method.

By setting traces, I see that the module is loaded and the installer
called. I install the native library into the modules/lib as
recommended in the netbeans faq. Calling System.loadLibary doesn't
throw and exception, so I suppose the library was not found (setting a
dummy name raises an exception).  There is a method in quaqua that
allows to check whether the lib is available and that one returns an
error by complaining that the lib is not on java.library.path... Info
about JNI can be found here
http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html

I googled the mailing lists and checked the Napkin, Substance and
Bluemarine projects for their netbeans integration. Napkin uses the
Startup.run method and bluemarine used the System class loader to
instantiate and install the laf. Other documents like
http://wiki.netbeans.org/DevFaqClassLoaders read that one should use
the application class loader and do that early especially for laf. How
do you do that?

So my question is: did anyone manage to install quaqua laf in a
module. What did you do? Did it load the native libraries?

What I am not getting yet is: does my look and feel be actually
installed or is it a native lib problem or both? Is it related to the
class loaders? I am still a bit new to Netbeans so it is probably my
ignorance that make it not work...

Thanks for help,

Jean-Marc

Re: Quaqua Look and Feel in Netbeans

by Fabrizio Giudici :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jean-Marc Borer wrote:
> Hi guys,
>
> I like Netbeans Mac OS X theme. However it uses the ugly JFileChooser
> from Swing. Quaqua provides an interesting implementation of the
> latter and a jar that contains only this dialog. There is however one
> diffulty: it requires the use of a native library which comes with the
> look and feel.
>
>  
What you did seems correct. BTW, I don't believe the native library is
required for the filechooser, unless you use JSheet. I have to go back
and check, indeed, since I don't recall a lot about that (with the
exception that it worked ;-)

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@... - mobile: +39 348.150.6941


Re: Quaqua Look and Feel in Netbeans

by jmborer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Fabrizio,

> What you did seems correct. BTW, I don't believe the native library is
>
> required for the filechooser, unless you use JSheet. I have to go back
>
> and check, indeed, since I don't recall a lot about that (with the
>
> exception that it worked ;-)

That would be very nice.

After doing some more tests, I found out that the Quaqua AND the
native libraries are actually installed. However they are not always
taken into account (i should say unpredictably). I only notice that
when it worked, the plugin was loaded/installed earlier in the startup
sequence as in the other cases. So my issue seems more related to
module loading order than installing properly the look and feel.

Do you how to influence the loading order of module?
Any idea when my module should be loaded, I mean before/after a
certain module? Which could be this annoying other module that
overrides my laf settings?

I suspect somehow early because when I put the jars into
platform10/lib and specify the look and feel with --laf it works
always.

PS: Sorry for double posting. Just new to mailing lists.

Fabrizio Giudici wrote:
Jean-Marc Borer wrote:
> Hi guys,
>
> I like Netbeans Mac OS X theme. However it uses the ugly JFileChooser
> from Swing. Quaqua provides an interesting implementation of the
> latter and a jar that contains only this dialog. There is however one
> diffulty: it requires the use of a native library which comes with the
> look and feel.
>
>  
What you did seems correct. BTW, I don't believe the native library is
required for the filechooser, unless you use JSheet. I have to go back
and check, indeed, since I don't recall a lot about that (with the
exception that it worked ;-)

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941