Class CoreRibbonResizePolicies
java.lang.Object
org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies
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:
- Resize policies for the
JFlowRibbonBands. TheCoreRibbonResizePolicies.FlowTwoRowsandCoreRibbonResizePolicies.FlowThreeRowsallow placing the flow ribbon band content in two and three rows respectively. - Resize policies for the
JRibbonBands. TheCoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicyis the base class for these policies. These policies respect theRibbonElementPriorityassociated on command buttons and ribbon galleries inRibbonBandResizePolicy.getPreferredWidth(int, int)andRibbonBandResizePolicy.install(int, int). WhileRibbonBandResizePolicy.install(int, int)call on aJFlowRibbonBandonly changes the bounds of the flow components, this call on aJRibbonBandcan also change the display state of the command buttons (withAbstractCommandButton.setDisplayState(org.pushingpixels.flamingo.api.common.CommandButtonDisplayState)) and the number of visible buttons in the ribbon galleries. - The collapsed policy that replaces the entire content of the ribbon band
with a single popup button. This is done when there is not enough horizontal
space to show the content of the ribbon band under the most restrictive
resize policy. Activating the popup button will show the original content
under the most permissive resize policy in a popup. This policy is
implemented in the
IconRibbonBandResizePolicy.
In addition to the specific resize policies, this class provides three core
resize policies lists for JRibbonBands:
getCorePoliciesPermissive(JRibbonBand)returns a list that starts with a resize policy that shows all command buttons in theCommandButtonDisplayState.BIGand ribbon galleries with the largest number of visible buttons, fully utilizing the available screen space.getCorePoliciesRestrictive(JRibbonBand)returns a list that starts with a resize policy that respects the associated ribbon element priority set on the specific components.-
getCorePoliciesNone(JRibbonBand)returns a list that only has amirrorresize policy that respects the associated ribbon element priority set on the specific components.
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
Nested ClassesModifier and TypeClassDescriptionprotected static classThe base class for mapping-based core resize policies.static classCore resize policy forJFlowRibbonBandthat places the content in three rows.static classCore resize policy forJFlowRibbonBandthat places the content in two rows.static final classCore resize policy that maps allRibbonElementPrioritys toRibbonElementPriority.LOW.static final classCore resize policy that maps:RibbonElementPriority.TOP->RibbonElementPriority.MEDIUMRibbonElementPriority.MEDIUM->RibbonElementPriority.LOWRibbonElementPriority.LOW->RibbonElementPriority.LOWstatic final classCore resize policy that maps:RibbonElementPriority.TOP->RibbonElementPriority.TOPRibbonElementPriority.MEDIUM->RibbonElementPriority.TOPRibbonElementPriority.LOW->RibbonElementPriority.MEDIUMstatic final classCore resize policy that maps:RibbonElementPriority.TOP->RibbonElementPriority.TOPRibbonElementPriority.MEDIUM->RibbonElementPriority.LOWRibbonElementPriority.LOW->RibbonElementPriority.LOWstatic final classCore resize policy that maps:RibbonElementPriority.TOP->RibbonElementPriority.TOPRibbonElementPriority.MEDIUM->RibbonElementPriority.MEDIUMRibbonElementPriority.LOW->RibbonElementPriority.MEDIUMstatic final classMirror core resize policy that maps the values ofRibbonElementPrioritys to themselves.static final classCore resize policy that maps allRibbonElementPrioritys toRibbonElementPriority.TOP. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<RibbonBandResizePolicy>getCoreFlowPoliciesRestrictive(JFlowRibbonBand ribbonBand, int stepsToRepeat) Returns a list that hasCoreRibbonResizePolicies.FlowTwoRowspolicy followed by theCoreRibbonResizePolicies.FlowThreeRowsresize policy.static List<RibbonBandResizePolicy>getCorePoliciesNone(JRibbonBand ribbonBand) Returns a list that only has amirrorresize 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 theCommandButtonDisplayState.BIGand 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.
-
Constructor Details
-
CoreRibbonResizePolicies
public CoreRibbonResizePolicies()
-
-
Method Details
-
getCorePoliciesPermissive
Returns a list that starts with a resize policy that shows all command buttons in theCommandButtonDisplayState.BIGand ribbon galleries with the largest number of visible buttons. The last entry is theIconRibbonBandResizePolicy.- Parameters:
ribbonBand- Ribbon band.- Returns:
- The permissive list of core ribbon band resize policies.
-
getCorePoliciesRestrictive
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 theIconRibbonBandResizePolicy.- Parameters:
ribbonBand- Ribbon band.- Returns:
- The restrictive list of core ribbon band resize policies.
-
getCorePoliciesNone
Returns a list that only has amirrorresize policy that respects the associated ribbon element priority set on the specific components. The last entry is theIconRibbonBandResizePolicy.- 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 hasCoreRibbonResizePolicies.FlowTwoRowspolicy followed by theCoreRibbonResizePolicies.FlowThreeRowsresize policy. The last entry is theIconRibbonBandResizePolicy.- Parameters:
ribbonBand- Ribbon band.stepsToRepeat- The number of times each one of theCoreRibbonResizePolicies.FlowTwoRows/CoreRibbonResizePolicies.FlowThreeRowsshould appear consecutively in the returned list.- Returns:
- The restrictive list of core ribbon band resize policies.
-