flamingo
  1. flamingo
  2. FLAMINGO-57

4.2 Relase causes IllegalStateException at startup

    Details

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

      Operating System: All
      Platform: All

    • Issuezilla Id:
      57

      Description

      Under flamingo release 4.1_01 there are not exceptions on startup. When
      running with flamingo release 4.2 (Oct 25), I get the following exception when
      starting up my application:

      java.lang.IllegalStateException: Inconsistent preferred widths
      Ribbon band 'Preferences has the following resize policies
      org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$None with
      preferred width 72
      org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$Low2Mid with
      preferred width 72
      org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$Mid2Mid with
      preferred width 72
      org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$Mirror with
      preferred width 72
      org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$Mid2Low with
      preferred width 72
      org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$High2Mid with
      preferred width 119
      org.jvnet.flamingo.ribbon.resize.IconRibbonBandResizePolicy with
      preferred width 72
      org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$Mid2Low with pref
      width 72 is followed by resize policy
      org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$High2Mid with larger
      pref width

      at
      org.jvnet.flamingo.utils.FlamingoUtilities.checkResizePoliciesConsistency
      (FlamingoUtilities.java:575)

      It is unclear how to resolve this issue from the application code standpoint.

        Activity

        Hide
        kirillcool added a comment -

        This is the designed behavior to enforce predictable resizing at runtime. For
        more information please see the thread at [1], and specifically my message at
        [2] - formatting is a little off, so you'll have to scroll.

        By the way, what controls do you have in "Preferences" ribbon band?

        Since there is no AS_DESIGNED resolution, i'm marking this as INVALID. Use
        AbstractRibbonBand.setResizePolicies API to set the specific list of resize
        policies.

        [1]
        https://flamingo.dev.java.net/servlets/BrowseList?list=users&by=thread&from=2017721
        [2] https://flamingo.dev.java.net/servlets/ReadMsg?list=users&msgNo=429

        Show
        kirillcool added a comment - This is the designed behavior to enforce predictable resizing at runtime. For more information please see the thread at [1] , and specifically my message at [2] - formatting is a little off, so you'll have to scroll. By the way, what controls do you have in "Preferences" ribbon band? Since there is no AS_DESIGNED resolution, i'm marking this as INVALID. Use AbstractRibbonBand.setResizePolicies API to set the specific list of resize policies. [1] https://flamingo.dev.java.net/servlets/BrowseList?list=users&by=thread&from=2017721 [2] https://flamingo.dev.java.net/servlets/ReadMsg?list=users&msgNo=429
        Hide
        jhawthorne added a comment -

        The Preferences Ribbon Band contains a single ACTION_ONLY JCommandButton. It
        is the fourth band within the RibbonTask.

        Show
        jhawthorne added a comment - The Preferences Ribbon Band contains a single ACTION_ONLY JCommandButton. It is the fourth band within the RibbonTask.
        Hide
        kirillcool added a comment -

        There are two factors that you should consider when creating ribbon bands with
        very small number of controls.

        1. Design wise, a ribbon band is a logical grouping of related controls. It
        shouldn't have too many controls, but it shouldn't have too few. I would say
        that a ribbon band with a single button is not the right use of the ribbon control.
        2. The rule enforced on resize policies may not allow you to create such ribbon
        bands at all. The last resize policy must always be the ICON state (when the
        ribbon band is collapsed), and if the ribbon band title is longer than the title
        of that single action command button, this rule can only be satisfied when the
        only available resize policy is ICON - effectively enforcing this ribbon band to
        always be collapsed. This behavior is by design and you will need to consider
        redesigning this specific band to comply with the resize policy rule that
        enforces predictable dynamic runtime behavior when the user resizes your
        application.

        Thanks
        Kirill

        Show
        kirillcool added a comment - There are two factors that you should consider when creating ribbon bands with very small number of controls. 1. Design wise, a ribbon band is a logical grouping of related controls. It shouldn't have too many controls, but it shouldn't have too few. I would say that a ribbon band with a single button is not the right use of the ribbon control. 2. The rule enforced on resize policies may not allow you to create such ribbon bands at all. The last resize policy must always be the ICON state (when the ribbon band is collapsed), and if the ribbon band title is longer than the title of that single action command button, this rule can only be satisfied when the only available resize policy is ICON - effectively enforcing this ribbon band to always be collapsed. This behavior is by design and you will need to consider redesigning this specific band to comply with the resize policy rule that enforces predictable dynamic runtime behavior when the user resizes your application. Thanks Kirill

          People

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

            Dates

            • Created:
              Updated:
              Resolved: