How to add a third-party module to your RCP
In a recent blog entry “Branding & Substance plugin” I mentioned that the substance plugin would be great to change the look & feel of a NetBeans based application. I just received an email asking for more details how to do this:
“I have started to create an application based on the netbeans platform.
After having seen the substance LAF, I have tried to use it for the netbeans application platform.
First, I have installed the substance netbeans plugin. It works like a charm.
Then, I de-install the substance plugin.
My goal is to use the substance LAF only for the target application, and not the development platform.
How to use the substance LAF on a netbeans application platform
1. On possibility is to include the update center to the target application and then include the netbeans substance plugin. It works, but I do not like this manual operation
2. Another possibility would be to run the target application with the substance LAF.
In the project.properties file of my netbeans application I set the following:
run.args.extra=–laf org.jvnet.substance.SubstanceLookAndFeel –cp:p “C:/Java/substance.jar”
It works but it is not totally perfect. The tabbed container is a netbeans specific component and it not recognized by the LAF.
So I have decided to add in the classpath, jar: org-jvnet-substance-netbeans.jar (I found it in the substance netbeans plugin).
Unfortunatly, this produces a crash
So my question would be: how to run a netbeans application platform using substance LAF without having to download the substance plugin from the target platform ?“
That’s a good question, so how can we go about it? Can you take an existing nbm and add it to your distribution? The files should all be there in the nbm.
Some of you might ask now: “Toni, why don’t you just check out the project from cvs at https://substance-netbeans.dev.java.net/ move it to your module_suite, right click the modules node of the suite, select “add existing” from the context menu and choose “substance-netbeans”?”.
And, again, that’s a fair question :), but let’s just pretend we only have the nbm, so what can we do? So far solution 1, installing the module manually has the best result, but needs user interaction. One thing you can do about this is to copy the nbm into the update/download directory of your suite. nbms that sit here are installed automatically without user interaction. So a quick and dirty solution would be to build your suite, go to the build dir create a folder “update/download” and move the nbm there. I just tried it, it works…
The problem now is, that before the application starts the updater is launched, better than manual install, but still not perfect. But it’s easier than I thought: Since we’re in the IDE, with this first run the updates have been installed in my build directory. So the first run did the job I thought I’d have to do manually. Now just “Create zip distribution” and you’re done. I gotta get one of those “That was easy!” Buttons from staples
.



[...] Update: Since there were questions how you can add the module to your own suite I’ve added some information hereĀ [...]
Pingback by Branding & Substance plugin | Toni Epple
— 5. February 2008 @ 21:08