Class JRibbonComponent

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class JRibbonComponent extends RichToolTipManager.JTrackableComponent
Wrapper around core and 3rd party Swing controls to allow placing them in the JRibbonBand.
See Also:
  • Field Details

  • Constructor Details

    • JRibbonComponent

      public JRibbonComponent(JComponent mainComponent)
      Creates a simple wrapper with no icon and no caption.
      Parameters:
      mainComponent - Wrapped component. Can not be null.
      Throws:
      IllegalArgumentException - if mainComponent is null.
    • JRibbonComponent

      public JRibbonComponent(ResizableIcon icon, String caption, JComponent mainComponent)
      Creates a wrapper with an icon and a caption.
      Parameters:
      icon - Wrapper icon. Can be null.
      caption - Wrapper caption. Can not be null.
      mainComponent - Wrapped component. Can not be null.
      Throws:
      IllegalArgumentException - if caption or mainComponent is null.
  • Method Details

    • updateUI

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

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

      public RibbonComponentUI getUI()
      Returns the UI object which implements the L&F for this component.
      Overrides:
      getUI in class JComponent
      Returns:
      a RibbonUI object
      See Also:
    • getIcon

      public ResizableIcon getIcon()
      Returns the wrapper icon of this wrapper component. Can return null.
      Returns:
      The wrapper icon of this wrapper component.
      See Also:
    • getCaption

      public String getCaption()
      Returns the caption of this wrapper component. Can return null.
      Returns:
      The caption of this wrapper component.
      See Also:
    • setCaption

      public void setCaption(String caption)
      Sets new value for the caption of this wrapper component.
      Parameters:
      caption - The new caption.
    • getMainComponent

      public JComponent getMainComponent()
      Returns the wrapped component of this wrapper component. The result is guaranteed to be non null.
      Returns:
      The wrapped component of this wrapper component.
    • isSimpleWrapper

      public boolean isSimpleWrapper()
      Returns indication whether this wrapper is simple.
      Returns:
      true if both getIcon() and getCaption() return null, false otherwise.
    • getKeyTip

      public String getKeyTip()
      Returns the key tip for this wrapper component.
      Returns:
      The key tip for this wrapper component.
      See Also:
    • setKeyTip

      public void setKeyTip(String keyTip)
      Sets the specified string to be the key tip for this wrapper component. Fires a keyTip property change event.
      Parameters:
      keyTip - The new key tip for this wrapper component.
    • getRichTooltip

      public RichTooltip getRichTooltip(MouseEvent mouseEvent)
      Specified by:
      getRichTooltip in class RichToolTipManager.JTrackableComponent
    • setRichTooltip

      public void setRichTooltip(RichTooltip richTooltip)
      Sets the rich tooltip for this wrapper component.
      Parameters:
      richTooltip -
      See Also:
    • getHorizontalAlignment

      public HorizontalAlignment getHorizontalAlignment()
      Returns the horizontal alignment for this wrapper component.
      Returns:
      The horizontal alignment for this wrapper component.
      See Also:
    • setHorizontalAlignment

      public void setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
      Sets the specified parameter to be the horizontal alignment for this wrapper component.
      Parameters:
      horizontalAlignment - The new horizontal alignment for this wrapper component.
      See Also:
    • getDisplayPriority

      public RibbonElementPriority getDisplayPriority()
    • setDisplayPriority

      public void setDisplayPriority(RibbonElementPriority displayPriority)
    • isResizingAware

      public boolean isResizingAware()
    • setResizingAware

      public void setResizingAware(boolean isResizingAware)