Class AbstractRibbonBand<T extends AbstractBandControlPanel>

  • Type Parameters:
    T - Class parameter that specifies the type of band control panel implementation.
    All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable
    Direct Known Subclasses:
    JFlowRibbonBand, JRibbonBand

    public abstract class AbstractRibbonBand<T extends AbstractBandControlPanel>
    extends JComponent
    Ribbon band. Is part of a logical RibbonTask. This is an abstract base class for two types of ribbon bands - flow in JFlowRibbonBand and general in JRibbonBand.

    This class provides the following common functionality:

    • Tracking the available and current resize policies.
    • Tracking the collapsed state of the ribbon band - when there is not enough horizontal space to show this panel under the smallest resize setting (see RibbonBandResizePolicy and CoreRibbonResizePolicies) - the band content is replaced by one collapsed button. When that button is activated, the original ribbon band content is shown in a popup panel.
    • Associating key tip and rich tooltip with the expand button of the ribbon band.
    • Associating key tip with the collapsed button of the ribbon band.
    See Also:
    Serialized Form
    • Constructor Detail

      • AbstractRibbonBand

        public AbstractRibbonBand​(String title,
                                  ResizableIcon icon,
                                  ActionListener expandActionListener,
                                  T controlPanel)
        Creates a new ribbon band.
        Parameters:
        title - Band title.
        icon - Associated icon (for collapsed state).
        expandActionListener - Expand action listener (can be null).
        controlPanel - The control panel of this ribbon band.
    • Method Detail

      • cloneBand

        public abstract AbstractRibbonBand<T> cloneBand()
        Returns a clone of this ribbon band.
        Returns:
        A clone of this ribbon band.
      • setUI

        public void setUI​(RibbonBandUI ui)
        Sets the new UI delegate.
        Parameters:
        ui - New UI delegate.
      • getTitle

        public String getTitle()
        Returns the title of this band.
        Returns:
        Title of this band.
        See Also:
        setTitle(String)
      • setExpandActionListener

        public void setExpandActionListener​(ActionListener expandActionListener)
        Sets the specified action listener to be activated when the user clicks the expand button on this ribbon band. Passing null will remove the expand button from this ribbon band.
        Parameters:
        expandActionListener - Expand action listener for this ribbon band.
        See Also:
        getExpandActionListener()
      • getPopupRibbonBand

        public AbstractRibbonBand getPopupRibbonBand()
        Returns the ribbon band shown in a popup panel when this ribbon band is in a collapsed state. This method is for internal use only and should not be called by the application code.
        Returns:
        The ribbon band shown in a popup panel when this ribbon band is in a collapsed state.
        See Also:
        setPopupRibbonBand(AbstractRibbonBand)
      • setPopupRibbonBand

        public void setPopupRibbonBand​(AbstractRibbonBand popupRibbonBand)
        Sets the specified parameter to be the ribbon band shown in a popup panel when this ribbon band is in a collapsed state. This method is for internal use only and should not be called by the application code.
        Parameters:
        popupRibbonBand - The ribbon band to be shown in a popup panel when this ribbon band is in a collapsed state.
      • getCurrentResizePolicy

        public RibbonBandResizePolicy getCurrentResizePolicy()
        Returns the current resize policy of this ribbon band.
        Returns:
        The current resize policy of this ribbon band.
      • setCurrentResizePolicy

        public void setCurrentResizePolicy​(RibbonBandResizePolicy resizePolicy)
        Sets the specified parameter to be the current resize policy of this ribbon band. This method is for internal use only and should not be called by the application code.
        Parameters:
        resizePolicy - The new resize policy for this ribbon band.
        See Also:
        getCurrentResizePolicy(), getResizePolicies()
      • getResizePolicies

        public List<RibbonBandResizePolicy> getResizePolicies()
        Returns an unmodifiable list of available resize policies of this ribbon band.
        Returns:
        An unmodifiable list of available resize policies of this ribbon band.
      • setResizePolicies

        public void setResizePolicies​(List<RibbonBandResizePolicy> resizePolicies)
        Sets the specified parameter as the available resize policies of this ribbon band. The order of the resize policies in this list is important. The first entry in the list must be the most permissive policies that returns the largest value from its RibbonBandResizePolicy.getPreferredWidth(int, int). Each successive entry in the list must return the value smaller than its predecessors. If IconRibbonBandResizePolicy is in the list, it must be the last entry.
        Parameters:
        resizePolicies - The new available resize policies of this ribbon band.
      • getExpandButtonKeyTip

        public String getExpandButtonKeyTip()
        Returns the key tip for the expand button of this ribbon band.
        Returns:
        The key tip for the expand button of this ribbon band.
        See Also:
        setExpandButtonKeyTip(String)
      • setExpandButtonKeyTip

        public void setExpandButtonKeyTip​(String expandButtonKeyTip)
        Changes the key tip for the expand button of this ribbon band. Fires an expandButtonKeyTip property change event.
        Parameters:
        expandButtonKeyTip - The new key tip for the expand button of this ribbon band.
        See Also:
        getExpandButtonKeyTip()
      • getExpandButtonRichTooltip

        public RichTooltip getExpandButtonRichTooltip()
        Returns the rich tooltip for the expand button of this ribbon band.
        Returns:
        The rich tooltip for the expand button of this ribbon band.
        See Also:
        setExpandButtonRichTooltip(RichTooltip)
      • setExpandButtonRichTooltip

        public void setExpandButtonRichTooltip​(RichTooltip expandButtonRichTooltip)
        Changes the rich tooltip for the expand button of this ribbon band. Fires an expandButtonRichTooltip property change event.
        Parameters:
        expandButtonRichTooltip - The new rich tooltip for the expand button of this ribbon band.
        See Also:
        getExpandButtonRichTooltip()
      • getCollapsedStateKeyTip

        public String getCollapsedStateKeyTip()
        Returns the key tip for the collapsed button which is shown when there is not enough horizontal space to show the ribbon band content under the most restrictive resize policy.
        Returns:
        The key tip for the collapsed button of this ribbon band.
        See Also:
        setCollapsedStateKeyTip(String)
      • setCollapsedStateKeyTip

        public void setCollapsedStateKeyTip​(String collapsedStateKeyTip)
        Changes the key tip for the collapsed button which is shown when there is not enough horizontal space to show the ribbon band content under the most restrictive resize policy. Fires a collapsedStateKeyTip property change event.
        Parameters:
        collapsedStateKeyTip - The new key tip for the collapsed button of this ribbon band.
        See Also:
        getCollapsedStateKeyTip()