Class CoreRibbonResizePolicies
- java.lang.Object
-
- org.pushingpixels.radiance.component.api.ribbon.resize.CoreRibbonResizePolicies
-
public class CoreRibbonResizePolicies extends java.lang.Object
The core resize policies. Provides a number of built in resize policies that respect the application element priorities passed toJRibbonBand.addRibbonCommand(BaseCommandButtonProjection, JRibbonBand.PresentationPriority)
andJRibbonBand.addRibbonGallery(RibbonGalleryProjection, JRibbonBand.PresentationPriority)
APIs. There are three types of built in resize policies:- Resize policies for the
JFlowRibbonBand
s. TheCoreRibbonResizePolicies.FlowTwoRows
andCoreRibbonResizePolicies.FlowThreeRows
allow placing the flow ribbon band content in two and three rows respectively. - Resize policies for the
JRibbonBand
s. TheCoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
is the base class for these policies. These policies respect theJRibbonBand.PresentationPriority
associated with command buttons and ribbon galleries inRibbonBandResizePolicy.getPreferredWidth(int, int)
andRibbonBandResizePolicy.install(int, int)
. WhileRibbonBandResizePolicy.install(int, int)
call on aJFlowRibbonBand
only changes the bounds of the flow components, this call on aJRibbonBand
can also change the presentation state of the command buttons (withJCommandButton.setPresentationState(CommandButtonPresentationState)
) 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
CoreRibbonResizePolicies.IconRibbonBandResizePolicy
.
In addition to the specific resize policies, this class provides three core resize policies lists for
JRibbonBand
s:getCorePoliciesPermissive(JRibbonBand)
returns a list that starts with a resize policy that shows all command buttons in theCommandButtonPresentationState.BIG
and 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 amirror
resize 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 forJFlowRibbonBand
s. The list starts with the two-row policy, goes to the three-row policy and then finally to the collapsed policy. - Resize policies for the
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
The base class for mapping-based core resize policies.static class
CoreRibbonResizePolicies.BaseRibbonBandResizePolicy<B extends AbstractRibbonBand>
static class
CoreRibbonResizePolicies.FlowOneRow
Core resize policy forJFlowRibbonBand
that places the content in a single row.static class
CoreRibbonResizePolicies.FlowThreeRows
Core resize policy forJFlowRibbonBand
that places the content in three rows.static class
CoreRibbonResizePolicies.FlowTwoRows
Core resize policy forJFlowRibbonBand
that places the content in two rows.static class
CoreRibbonResizePolicies.High2Low
Core resize policy that maps allJRibbonBand.PresentationPriority
s toJRibbonBand.PresentationPriority.LOW
.static class
CoreRibbonResizePolicies.High2Mid
static class
CoreRibbonResizePolicies.IconRibbonBandResizePolicy
Special resize policy that is used for collapsed ribbon bands.static class
CoreRibbonResizePolicies.Low2Mid
(package private) static interface
CoreRibbonResizePolicies.Mapping
Maps the element priority associated with a ribbon band component to the element priority assigned by the specific resize policy.static class
CoreRibbonResizePolicies.Mid2Low
static class
CoreRibbonResizePolicies.Mid2Mid
static class
CoreRibbonResizePolicies.Mirror
Mirror core resize policy that maps the values ofJRibbonBand.PresentationPriority
s to themselves.static class
CoreRibbonResizePolicies.None
Core resize policy that maps allJRibbonBand.PresentationPriority
s toJRibbonBand.PresentationPriority.TOP
.
-
Constructor Summary
Constructors Constructor Description CoreRibbonResizePolicies()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<RibbonBandResizePolicy>
getCoreFlowPoliciesRestrictive(JFlowRibbonBand ribbonBand, int stepsToRepeat)
Returns a list that hasCoreRibbonResizePolicies.FlowTwoRows
policy followed by theCoreRibbonResizePolicies.FlowThreeRows
resize policy.static java.util.List<RibbonBandResizePolicy>
getCorePoliciesNone(JRibbonBand ribbonBand)
Returns a list that only has amirror
resize policy that respects the associated ribbon element priority set on the specific components.static java.util.List<RibbonBandResizePolicy>
getCorePoliciesPermissive(JRibbonBand ribbonBand)
Returns a list that starts with a resize policy that shows all command buttons in theCommandButtonPresentationState.BIG
and ribbon galleries with the largest number of visible buttons.static java.util.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.
-
-
-
Method Detail
-
getCorePoliciesPermissive
public static java.util.List<RibbonBandResizePolicy> getCorePoliciesPermissive(JRibbonBand ribbonBand)
Returns a list that starts with a resize policy that shows all command buttons in theCommandButtonPresentationState.BIG
and ribbon galleries with the largest number of visible buttons. The last entry is theCoreRibbonResizePolicies.IconRibbonBandResizePolicy
.- Parameters:
ribbonBand
- Ribbon band.- Returns:
- The permissive list of core ribbon band resize policies.
-
getCorePoliciesRestrictive
public static java.util.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 theCoreRibbonResizePolicies.IconRibbonBandResizePolicy
.- Parameters:
ribbonBand
- Ribbon band.- Returns:
- The restrictive list of core ribbon band resize policies.
-
getCorePoliciesNone
public static java.util.List<RibbonBandResizePolicy> getCorePoliciesNone(JRibbonBand ribbonBand)
Returns a list that only has amirror
resize policy that respects the associated ribbon element priority set on the specific components. The last entry is theCoreRibbonResizePolicies.IconRibbonBandResizePolicy
.- Parameters:
ribbonBand
- Ribbon band.- Returns:
- The mirror list of core ribbon band resize policies.
-
getCoreFlowPoliciesRestrictive
public static java.util.List<RibbonBandResizePolicy> getCoreFlowPoliciesRestrictive(JFlowRibbonBand ribbonBand, int stepsToRepeat)
Returns a list that hasCoreRibbonResizePolicies.FlowTwoRows
policy followed by theCoreRibbonResizePolicies.FlowThreeRows
resize policy. The last entry is theCoreRibbonResizePolicies.IconRibbonBandResizePolicy
.- Parameters:
ribbonBand
- Ribbon band.stepsToRepeat
- The number of times each one of theCoreRibbonResizePolicies.FlowTwoRows
/CoreRibbonResizePolicies.FlowThreeRows
should appear consecutively in the returned list.- Returns:
- The restrictive list of core ribbon band resize policies.
-
-