Decreasing the Height of the PinkMatter Flamingo Ribbon Bar

Posted by Geertjan on Oracle Blogs See other posts from Oracle Blogs or by Geertjan
Published on Tue, 28 Jun 2011 12:36:21 -0700 Indexed on 2011/06/29 0:28 UTC
Read the original article Hit count: 286

Filed under:

The one and only thing prohibiting wide adoption of PinkMatter's amazing Flamingo ribbon bar integration for NetBeans Platform applications (watch the YouTube movie here and follow the tutorial here) is... the amount of real estate taken up by the height of the taskpane:

I was Skyping with Bruce Schubert about this and he suggested that a first step might me to remove the application menu. OK, once that had been done there was still a lot of height:

But then I configured a bit further and now have this, which is pretty squishy but at least shows there are possibilities:

How to get to the above point? Get the PinkMatter Flamingo ribbon bar from java.net (http://java.net/projects/nbribbonbar), which is now the official place where it is found, and then look in the "Flaming Integration" module. There you'll find com.pinkmatter.modules.flamingo.LayerRibbonComponentProvider.

Do the following:

  1. Comment out "addAppMenu(ribbon);" in "createRibbon()". That's the end of the application menu.

  2. Change the "addTaskPanes(JRibbon ribbon)" method from this...
    private void addTaskPanes(JRibbon ribbon) {
        RibbonComponentFactory factory = new RibbonComponentFactory();
        for (ActionItem item : ActionItems.forPath("Ribbon/TaskPanes")) {// NOI18N
             ribbon.addTask(factory.createRibbonTask(item));
        }
    }

    ...to the following:

    private void addTaskPanes(JRibbon ribbon) {
        RibbonComponentFactory factory = new RibbonComponentFactory();
        for (ActionItem item : ActionItems.forPath("Ribbon/TaskPanes")) { // NOI18N
            RibbonTask rt = factory.createRibbonTask(item);
            List<AbstractRibbonBand<?>> bands = rt.getBands();
            for (AbstractRibbonBand arb : bands) {
                arb.setPreferredSize(new Dimension(40,60));
            }
            ribbon.addTask(rt);
        }
    }

Hurray, you're done. Not a very great result yet, but at least you've made a start in decreasing the height of the PinkMatter Flamingo ribbon bar. If anyone gets further with this, I'd be very happy to hear about it!

© Oracle Blogs or respective owner

Related posts about /NetBeans IDE