Interface RibbonBandResizePolicy
-
- All Known Implementing Classes:
CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy,CoreRibbonResizePolicies.BaseRibbonBandResizePolicy,CoreRibbonResizePolicies.FlowThreeRows,CoreRibbonResizePolicies.FlowTwoRows,CoreRibbonResizePolicies.High2Low,CoreRibbonResizePolicies.High2Mid,CoreRibbonResizePolicies.IconRibbonBandResizePolicy,CoreRibbonResizePolicies.Low2Mid,CoreRibbonResizePolicies.Mid2Low,CoreRibbonResizePolicies.Mid2Mid,CoreRibbonResizePolicies.Mirror,CoreRibbonResizePolicies.None
public interface RibbonBandResizePolicyDefines the resize policies for theJRibbonBands andJFlowRibbonBands.The resize policy defines a single visual state of the given ribbon band. For every control in the specific ribbon band (command button, gallery etc), the resize policy defines what is its presentation state.
The resize policies are installed with
AbstractRibbonBand.setResizePolicies(java.util.List)API. The order of the resize policies in this list is important. The first entry in the list must be the most permissive policy that returns the largest value from itsgetPreferredWidth(int, int). Each successive entry in the list must return the value smaller than its predecessors.As the ribbon horizontal size is changed (by the user resizing the application window), the ribbon task resize sequencing policy set by
RibbonTask.setResizeSequencingPolicy(RibbonBandResizeSequencingPolicy)determines the order of ribbon bands to shrink / expand. See more details in the documentation of theRibbonBandResizeSequencingPolicy.The
CoreRibbonResizePoliciesprovides a number of built in resize policies that respect the application element priorities passed toJRibbonBand.addRibbonCommand(CommandButtonProjection, JRibbonBand.PresentationPriority)andJRibbonBand.addRibbonGallery(RibbonGalleryProjection, JRibbonBand.PresentationPriority)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 theJRibbonBand.PresentationPriorityassociated on command buttons and ribbon galleries ingetPreferredWidth(int, int)andinstall(int, int). Whileinstall(int, int)call on aJFlowRibbonBandonly changes the bounds of the flow components, this call on aJRibbonBandcan 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, the
CoreRibbonResizePoliciesprovides three core resize policies lists forJRibbonBands:CoreRibbonResizePolicies.getCorePoliciesPermissive(JRibbonBand)returns a list that starts with a resize policy that shows all command buttons in theCommandButtonPresentationState.BIGand ribbon galleries with the largest number of visible buttons, fully utilizing the available screen space.CoreRibbonResizePolicies.getCorePoliciesRestrictive(JRibbonBand)returns a list that starts with a resize policy that respects the associated ribbon element priority set on the specific components.-
CoreRibbonResizePolicies.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
collapsedpolicy as their last element.In addition, the
CoreRibbonResizePolicies.getCoreFlowPoliciesRestrictive(JFlowRibbonBand, int)returns a restrictive resize policy forJFlowRibbonBands. The list starts with the two-row policy, goes to the three-row policy and then finally to the collapsed policy.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetPreferredWidth(int availableHeight, int gap)Returns the preferred width of the associated ribbon band under the specified dimensions.voidinstall(int availableHeight, int gap)Installs this resize policy on the associated ribbon band.
-
-
-
Method Detail
-
getPreferredWidth
int getPreferredWidth(int availableHeight, int gap)Returns the preferred width of the associated ribbon band under the specified dimensions.- Parameters:
availableHeight- The height available for the associated ribbon band.gap- The inter-component gap.- Returns:
- The preferred width of the associated ribbon band under the specified dimensions.
-
install
void install(int availableHeight, int gap)Installs this resize policy on the associated ribbon band. ForJFlowRibbonBands only changes the bounds of the flow components. ForJRibbonBands can also change the presentation state of the command buttons (withJCommandButton.setPresentationState(CommandButtonPresentationState)) and the number of visible buttons in the ribbon galleries. Note that this method is for internal use only and should not be called by the application code.- Parameters:
availableHeight- The height available for the associated ribbon band.gap- The inter-component gap.
-
-