flamingo
  1. flamingo
  2. FLAMINGO-44

Empty Ribbon with undecorated frame causes NPE

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: milestone 1
    • Component/s: ribbon
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      44

      Description

      When the ribbon is undecorated and empty, you can get an NPE when resizing the
      window. The NPE is below. I'll attach a sample program (a very slightly
      modified version of EmptyRibbon from the test packages.

      Workaround: Set a minimum size on the ribbon manually (doesn't seem to matter
      the size).

      NPE:

      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at
      org.jvnet.flamingo.ribbon.ui.BasicRibbonUI$RibbonLayout.minimumLayoutSize(BasicRibbonUI.java:692)
      at java.awt.Container.minimumSize(Container.java:1633)
      at java.awt.Container.getMinimumSize(Container.java:1618)
      at javax.swing.JComponent.getMinimumSize(JComponent.java:1714)
      at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:651)
      at java.awt.Container.minimumSize(Container.java:1633)
      at java.awt.Container.getMinimumSize(Container.java:1618)
      at javax.swing.JComponent.getMinimumSize(JComponent.java:1714)
      at
      javax.swing.plaf.metal.MetalRootPaneUI$MetalRootLayout.minimumLayoutSize(MetalRootPaneUI.java:484)
      at java.awt.Container.minimumSize(Container.java:1633)
      at java.awt.Container.getMinimumSize(Container.java:1618)
      at javax.swing.JComponent.getMinimumSize(JComponent.java:1714)
      at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:646)
      at java.awt.Container.minimumSize(Container.java:1633)
      at java.awt.Container.getMinimumSize(Container.java:1618)
      at
      javax.swing.plaf.metal.MetalRootPaneUI$MouseInputHandler.mouseDragged(MetalRootPaneUI.java:821)
      at java.awt.Component.processMouseMotionEvent(Component.java:6182)
      at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3283)
      at java.awt.Component.processEvent(Component.java:5903)
      at java.awt.Container.processEvent(Container.java:2023)
      at java.awt.Component.dispatchEventImpl(Component.java:4501)
      at java.awt.Container.dispatchEventImpl(Container.java:2081)
      at java.awt.Component.dispatchEvent(Component.java:4331)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3982)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
      at java.awt.Container.dispatchEventImpl(Container.java:2067)
      at java.awt.Window.dispatchEventImpl(Window.java:2458)
      at java.awt.Component.dispatchEvent(Component.java:4331)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at
      java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

        Activity

        Hide
        flynnk added a comment -

        Created an attachment (id=18)
        Sample program to reproduce the problem

        Show
        flynnk added a comment - Created an attachment (id=18) Sample program to reproduce the problem
        Hide
        kirillcool added a comment -

        Will fix this, but empty ribbon content isn't really a target scenario

        Thanks
        Kirill

        Show
        kirillcool added a comment - Will fix this, but empty ribbon content isn't really a target scenario Thanks Kirill
        Hide
        flynnk added a comment -

        Understood.

        I do kind of like the application menu by itself, though. I understand the
        concerns with very small amounts of content in the ribbon (Notepad shouldn't
        have a ribbon, although I've found 5 versions of that on the 'net...), but I
        think the application button by itself is probably better than the "just a file
        menu" option. Or at least, I think that enough to try it out and see what kind
        of feedback I get. I haven't read through all the Ribbon guidelines, but I
        wonder about this specific scenario.

        Just a thought. Issue tracker is probably not the best place for
        philosophical musing though....

        Show
        flynnk added a comment - Understood. I do kind of like the application menu by itself, though. I understand the concerns with very small amounts of content in the ribbon (Notepad shouldn't have a ribbon, although I've found 5 versions of that on the 'net...), but I think the application button by itself is probably better than the "just a file menu" option. Or at least, I think that enough to try it out and see what kind of feedback I get. I haven't read through all the Ribbon guidelines, but I wonder about this specific scenario. Just a thought. Issue tracker is probably not the best place for philosophical musing though....
        Hide
        kirillcool added a comment -

        Moving to version 4.1 to fix.

        Show
        kirillcool added a comment - Moving to version 4.1 to fix.
        Hide
        kirillcool added a comment -

        The NPE should be fixed in the latest 4.1dev drop.

        Thanks
        Kirill

        Show
        kirillcool added a comment - The NPE should be fixed in the latest 4.1dev drop. Thanks Kirill

          People

          • Assignee:
            kirillcool
            Reporter:
            flynnk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: