Quantcast
Channel: Oracle Bloggers
Viewing all articles
Browse latest Browse all 19780

Fixing the Ribbon Bar Integration Tutorial

$
0
0

The NetBeans Platform Ribbon Bar Integration Tutorial has an Installer class that needs to be rewritten if you're using it with NetBeans Platform 8.0 and 8.0.1.

In the Flamingo Integration module, delete the content of the Installer class, in the modules.flamingo package, and replace it with the code shown below:

https://netbeans.org/projects/platform/lists/dev/archive/2014-10/message/107

The problem with the original Installer class in the repo is that it is a little bit hacked together, i.e., it uses the ModuleInstall class, registered in the Manifest, but then delays loading via SwingUtilities.invokeLater. So, when the loading sequence in the NetBeans Platform changes, even slightly, as it does from release to release, with performance enhancements and so on, the hacked code stops working correctly... and the rewritten components, i.e., the ribbon, is loaded incorrectly.

UIDefaults.getUI() failed: no ComponentUI class for: org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=16777216,maximumSize=,minimumSize=,preferredSize=]
java.lang.Error
    at javax.swing.UIDefaults.getUIError(UIDefaults.java:732)
    at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:130)
    at javax.swing.UIDefaults.getUI(UIDefaults.java:762)
    at javax.swing.UIManager.getUI(UIManager.java:1016)
    at org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton.updateUI(JRibbonApplicationMenuButton.java:124)
    at org.pushingpixels.flamingo.api.common.JCommandButton.<init>(JCommandButton.java:433)
    at org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton.<init>(JRibbonApplicationMenuButton.java:110)

Until you do the rewrite described in the link above, you'll see the error above when running the application and find the icon in the top left missing, as shown below.

The changed code in the link above fixes the problem.

If you feel the Ribbon application menu button, the big one top left above, is taking up too much space, you can take a look at the com.pinkmatter.modules.flamingo.LAFConfiguration class, and replace one statement with two statements, to use Bruce Schubert's rewritten application menu:



Viewing all articles
Browse latest Browse all 19780

Trending Articles