Plug A Custom BasicTabbedPaneUI into the Mavenized NetBeans Platform
By Geertjan on Jul 26, 2012
Two NetBeans Platform developers, Bo Conroy and Adriana, mentioned at the end of my blog entry here that plugging in a new tabbed component factory doesn't work for them in their Maven-based NetBeans Platform application. The reason for that is that, in my example code, I used JTabbedPaneAdapter, which is an implementation class in "org.netbeans.core.windows".
So, you could do different things. (1) Create an issue to make that class public (that's something I'll be doing soon), though there may be reasons why this isn't done already. (2) Create your own implementation of "org.netbeans.swing.tabcontrol.customtabs.Tabbed", which could be a bit of work and currently isn't documented. That's something I'll be working on soon. (3) Set the "org.netbeans.core.windows" module as a friend module of your own module, which means that you're conscious that you're using an internal NetBeans Platform class and that if it changes unexpectedly you can't complain because you knew up front that you're not going to be using a public API.
This is how you do that:
- Find the Module Descriptor (module.xml) file in the module where you want to use an internal class:
- In that file, paste this content:
<?xml version="1.0" encoding="UTF-8"?> <nbm> <dependencies> <dependency> <id>org.netbeans.modules:org-netbeans-core-windows</id> <type>impl</type> <explicitValue>org.netbeans.core.windows/2 = 201207171143</explicitValue> </dependency> </dependencies> </nbm>
The pattern for impl dependencies is XXX = IMPL_VERSION where XXX is the codenamebase and IMPL_VERSION is the implementation version from the module's manifest. (Read here.)
The explicitValue element can be constructed by looking in the manifest of the JAR that you want to make your friend:
Then build the application and everything will work as expected:
Sources of this sample are here: