org.pushingpixels.flamingo.api.ribbon.resize
Class CoreRibbonResizePolicies

java.lang.Object
  extended by org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies

public class CoreRibbonResizePolicies
extends Object

The core resize policies. Provides a number of built in resize policies that respect the application element priorities passed to JRibbonBand.addCommandButton(org.pushingpixels.flamingo.api.common.AbstractCommandButton, org.pushingpixels.flamingo.api.ribbon.RibbonElementPriority) and JRibbonBand.addRibbonGallery(String, java.util.List, java.util.Map, int, int, org.pushingpixels.flamingo.api.ribbon.RibbonElementPriority) APIs. There are three types of built in resize policies:

In addition to the specific resize policies, this class provides three core resize policies lists for JRibbonBands:

Note that as mentioned above, all the three lists above have the collapsed policy as their last element.

In addition, the getCoreFlowPoliciesRestrictive(JFlowRibbonBand, int) returns a restrictive resize policy for JFlowRibbonBands. The list starts with the two-row policy, goes to the three-row policy and then finally to the collapsed policy.


Nested Class Summary
protected static class CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
          The base class for mapping-based core resize policies.
static class CoreRibbonResizePolicies.FlowThreeRows
          Core resize policy for JFlowRibbonBand that places the content in three rows.
static class CoreRibbonResizePolicies.FlowTwoRows
          Core resize policy for JFlowRibbonBand that places the content in two rows.
static class CoreRibbonResizePolicies.High2Low
          Core resize policy that maps all RibbonElementPrioritys to RibbonElementPriority.LOW.
static class CoreRibbonResizePolicies.High2Mid
          Core resize policy that maps: RibbonElementPriority.TOP -> RibbonElementPriority.MEDIUM RibbonElementPriority.MEDIUM -> RibbonElementPriority.LOW RibbonElementPriority.LOW -> RibbonElementPriority.LOW
static class CoreRibbonResizePolicies.Low2Mid
          Core resize policy that maps: RibbonElementPriority.TOP -> RibbonElementPriority.TOP RibbonElementPriority.MEDIUM -> RibbonElementPriority.TOP RibbonElementPriority.LOW -> RibbonElementPriority.MEDIUM
static class CoreRibbonResizePolicies.Mid2Low
          Core resize policy that maps: RibbonElementPriority.TOP -> RibbonElementPriority.TOP RibbonElementPriority.MEDIUM -> RibbonElementPriority.LOW RibbonElementPriority.LOW -> RibbonElementPriority.LOW
static class CoreRibbonResizePolicies.Mid2Mid
          Core resize policy that maps: RibbonElementPriority.TOP -> RibbonElementPriority.TOP RibbonElementPriority.MEDIUM -> RibbonElementPriority.MEDIUM RibbonElementPriority.LOW -> RibbonElementPriority.MEDIUM
static class CoreRibbonResizePolicies.Mirror
          Mirror core resize policy that maps the values of RibbonElementPrioritys to themselves.
static class CoreRibbonResizePolicies.None
          Core resize policy that maps all RibbonElementPrioritys to RibbonElementPriority.TOP.
 
Constructor Summary
CoreRibbonResizePolicies()
           
 
Method Summary
static List<RibbonBandResizePolicy> getCoreFlowPoliciesRestrictive(JFlowRibbonBand ribbonBand, int stepsToRepeat)
          Returns a list that has CoreRibbonResizePolicies.FlowTwoRows policy followed by the CoreRibbonResizePolicies.FlowThreeRows resize policy.
static List<RibbonBandResizePolicy> getCorePoliciesNone(JRibbonBand ribbonBand)
          Returns a list that only has a mirror resize policy that respects the associated ribbon element priority set on the specific components.
static List<RibbonBandResizePolicy> getCorePoliciesPermissive(JRibbonBand ribbonBand)
          Returns a list that starts with a resize policy that shows all command buttons in the CommandButtonDisplayState.BIG and ribbon galleries with the largest number of visible buttons.
static List<RibbonBandResizePolicy> getCorePoliciesRestrictive(JRibbonBand ribbonBand)
          Returns a list that starts with a resize policy that respects the associated ribbon element priority set on the specific components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoreRibbonResizePolicies

public CoreRibbonResizePolicies()
Method Detail

getCorePoliciesPermissive

public static List<RibbonBandResizePolicy> getCorePoliciesPermissive(JRibbonBand ribbonBand)
Returns a list that starts with a resize policy that shows all command buttons in the CommandButtonDisplayState.BIG and ribbon galleries with the largest number of visible buttons. The last entry is the IconRibbonBandResizePolicy.

Parameters:
ribbonBand - Ribbon band.
Returns:
The permissive list of core ribbon band resize policies.

getCorePoliciesRestrictive

public static List<RibbonBandResizePolicy> getCorePoliciesRestrictive(JRibbonBand ribbonBand)
Returns a list that starts with a resize policy that respects the associated ribbon element priority set on the specific components. The last entry is the IconRibbonBandResizePolicy.

Parameters:
ribbonBand - Ribbon band.
Returns:
The restrictive list of core ribbon band resize policies.

getCorePoliciesNone

public static List<RibbonBandResizePolicy> getCorePoliciesNone(JRibbonBand ribbonBand)
Returns a list that only has a mirror resize policy that respects the associated ribbon element priority set on the specific components. The last entry is the IconRibbonBandResizePolicy.

Parameters:
ribbonBand - Ribbon band.
Returns:
The mirror list of core ribbon band resize policies.

getCoreFlowPoliciesRestrictive

public static List<RibbonBandResizePolicy> getCoreFlowPoliciesRestrictive(JFlowRibbonBand ribbonBand,
                                                                          int stepsToRepeat)
Returns a list that has CoreRibbonResizePolicies.FlowTwoRows policy followed by the CoreRibbonResizePolicies.FlowThreeRows resize policy. The last entry is the IconRibbonBandResizePolicy.

Parameters:
ribbonBand - Ribbon band.
stepsToRepeat - The number of times each one of the CoreRibbonResizePolicies.FlowTwoRows / CoreRibbonResizePolicies.FlowThreeRows should appear consecutively in the returned list.
Returns:
The restrictive list of core ribbon band resize policies.