Class AbstractRibbonBand<T extends AbstractBandControlPanel>

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand<T>
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:
  • Field Details

  • Constructor Details

    • 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 Details

    • cloneBand

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

      public RibbonBandUI getUI()
      Returns the UI object which implements the Linvalid input: '&F' for this component.
      Overrides:
      getUI in class JComponent
      Returns:
      a RibbonBandUI object
      See Also:
    • setUI

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

      public void updateUI()
      Overrides:
      updateUI in class JComponent
    • getUIClassID

      public String getUIClassID()
      Overrides:
      getUIClassID in class JComponent
    • getIcon

      public ResizableIcon getIcon()
      Returns the icon for the collapsed state.
      Returns:
      The icon for the collapsed state.
      See Also:
    • setIcon

      public void setIcon(ResizableIcon icon)
      Changes the icon for the collapsed state of this ribbon band. Fires a icon property change event.
      Parameters:
      icon - The new icon for the collapsed state.
      See Also:
    • getTitle

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

      public void setTitle(String title)
      Changes the title of this ribbon band. Fires a title property change event.
      Parameters:
      title - The new title for this ribbon band.
      See Also:
    • getExpandActionListener

      public ActionListener getExpandActionListener()
      Returns the expand action listener of this ribbon band. The result may be null.
      Returns:
      Expand action listener of this ribbon band.
      See Also:
    • 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:
    • getControlPanel

      public T getControlPanel()
      Returns the control panel of this ribbon band. The result may be null.
      Returns:
      Control panel of this ribbon band.
      See Also:
    • setControlPanel

      public void setControlPanel(T controlPanel)
      Sets the control panel of this ribbon band. The parameter may be null. This method is for internal use only.
      Parameters:
      controlPanel - The new control panel for this ribbon band. May be null.
      See Also:
    • 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

      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:
    • 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

      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:
    • 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

      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:
    • 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

      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: