org.pushingpixels.flamingo.api.ribbon.resize
public class CoreRibbonResizePolicies extends Object
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:
JFlowRibbonBand
s. The CoreRibbonResizePolicies.FlowTwoRows
and CoreRibbonResizePolicies.FlowThreeRows
allow placing the flow ribbon band content in two
and three rows respectively.JRibbonBand
s. The
CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
is the base class for these policies.
These policies respect the RibbonElementPriority
associated on
command buttons and ribbon galleries in
CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy.getPreferredWidth(int, int)
and
CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy.install(int, int)
. While
CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy.install(int, int)
call on a
JFlowRibbonBand
only changes the bounds of the flow components, this
call on a JRibbonBand
can also change the display state of the
command buttons (with
AbstractCommandButton.setDisplayState(org.pushingpixels.flamingo.api.common.CommandButtonDisplayState)
) and the number of visible buttons in the ribbon galleries.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 the
CommandButtonDisplayState.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 a
mirror
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 for JFlowRibbonBand
s. The list starts with
the two-row policy, goes to the three-row policy and then finally to the
collapsed policy.
Constructor and Description |
---|
CoreRibbonResizePolicies() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static List<RibbonBandResizePolicy> getCorePoliciesPermissive(JRibbonBand ribbonBand)
CommandButtonDisplayState.BIG
and ribbon galleries
with the largest number of visible buttons. The last entry is the
IconRibbonBandResizePolicy
.ribbonBand
- Ribbon band.public static List<RibbonBandResizePolicy> getCorePoliciesRestrictive(JRibbonBand ribbonBand)
IconRibbonBandResizePolicy
.ribbonBand
- Ribbon band.public static List<RibbonBandResizePolicy> getCorePoliciesNone(JRibbonBand ribbonBand)
mirror
resize policy that
respects the associated ribbon element priority set on the specific
components. The last entry is the IconRibbonBandResizePolicy
.ribbonBand
- Ribbon band.public static List<RibbonBandResizePolicy> getCoreFlowPoliciesRestrictive(JFlowRibbonBand ribbonBand, int stepsToRepeat)
CoreRibbonResizePolicies.FlowTwoRows
policy followed by the
CoreRibbonResizePolicies.FlowThreeRows
resize policy. The last entry is the
IconRibbonBandResizePolicy
.ribbonBand
- Ribbon band.stepsToRepeat
- The number of times each one of the CoreRibbonResizePolicies.FlowTwoRows
/
CoreRibbonResizePolicies.FlowThreeRows
should appear consecutively in the
returned list.