X

Geertjan's Blog

  • June 28, 2011

Decreasing the Height of the PinkMatter Flamingo Ribbon Bar (Part 1)

Geertjan Wielenga
Product Manager

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!

(Now read part 2.)

Join the discussion

Comments ( 8 )
  • Danno Ferrin Tuesday, June 28, 2011

    You can also go into a "collapsed" mode by double clicking the tabs. Thent he bands will pop over the content like an old school menuing systen. Double click it to go back.

    This has existed in Flamingo for a while and has also existed in Office 2007. In Office 2010 they added a "collapse" button next to the help button to make it a bit more obvious.

    I personally find this more amenable to the issues of cramped space, which ultimately is always a user level issue. Some are bothered by it, some are not.


  • guest Wednesday, June 29, 2011

    Why can't the tabs move up beside the save icon?


  • Bruce Schubert Wednesday, June 29, 2011

    I'm not a fan of the Taskbar (i.e., the Save and Save All icons etc above the Task Panes), so I reclaim this space by overriding the BasicRibbonUI.getTaskbarHeight() in a derived class so that it returns zero. To realize this customization, modify the LAFConfiguration.getClassDefaults() to include ["RibbonUI, "org.my.package.MyCustomRibbonUI"] in the Object array.


  • Bruce Schubert Wednesday, June 29, 2011

    Also, by simply removing the Taskbar, the application menu button (the cube) will dynamically size itself to the same height as the task pane menu items (e.g., Home and Formatting). With this modification you can retain the application menu and its functionality without the extra large footprint. I'm working on an implementation that mimics MS Office 2010 task panes where the application menu button is replaced with a less esoteric "File" menu item that will sit next to the "Home" task pane.


  • Ash Khote Wednesday, December 7, 2011

    Checkout this link for library and tutorial of JRibbon

    http://javaswingcomponents.blogspot.com/2011/12/jribbon.html


  • guest Sunday, January 1, 2012

    Hello Sir,

    I am trying to use Office LAF module for my Netbeans Platform application.

    I know how to put the task in taskpane using layer.xml file.

    Now my problem is that i done this using flamingo ribbon integration tutorial from netbeans.

    I want to use OfficeLAF module, please can you tell me is there any way in this module so that if i write in layer.xml file so that it will take effect after running the application.


  • guest Wednesday, May 16, 2012

    hi,

    I am using PinkMatterFlamingo into my module and problem that i was getting is, am unable to add new task pane into it after editing layer.xml ,as i addED few task plane given in this link under heading task pane http://platform.netbeans.org/tutorials/nbm-ribbonbar.html that are working fine but whenever i was trying to add new task plane unable to do so.


  • Rohani Jagdale Thursday, August 27, 2015

    I have question regarding to JRibbonBand resizing policy. I found following code,

    <code>

    List<RibbonBandResizePolicy> resizePolicies = new ArrayList<RibbonBandResizePolicy>();

    resizePolicies.add(new CoreRibbonResizePolicies.Mirror(fileBand.getControlPanel()));

    resizePolicies.add(new CoreRibbonResizePolicies.Mid2Low(fileBand.getControlPanel()));

    fileBand.setResizePolicies(resizePolicies);

    </code>

    at <a href="http://www.pointbaba.com/blog/11/jribbon-structure-and-simple-program">http://www.pointbaba.com/blog/11/jribbon-structure-and-simple-program</a>.

    I am ver confuse what is this actually. and its purpose.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha