Class JRibbonGallery

    • Field Detail

      • buttonSelectionGroup

        protected CommandToggleButtonGroup buttonSelectionGroup
        Button group for ensuring that only one button is selected.
      • displayPriority

        protected RibbonElementPriority displayPriority
        The current display priority of this in-ribbon gallery.
      • preferredVisibleIconCount

        protected Map<RibbonElementPriority,​Integer> preferredVisibleIconCount
        Preferred widths for each possible display state (set in the user code according to design preferences).
      • preferredPopupMaxButtonColumns

        protected int preferredPopupMaxButtonColumns
        Preferred maximum number of button columns for the popup panel.
      • preferredPopupMaxVisibleButtonRows

        protected int preferredPopupMaxVisibleButtonRows
        Preferred maximum number of visible button rows for the popup panel.
      • isShowingPopupPanel

        protected boolean isShowingPopupPanel
        Indication whether the ribbon gallery is showing the popup panel.
    • Constructor Detail

      • JRibbonGallery

        public JRibbonGallery()
        Creates new in-ribbon gallery.
    • Method Detail

      • setUI

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

        public void setPreferredVisibleButtonCount​(RibbonElementPriority state,
                                                   int visibleButtonCount)
        Set preferred width of this in-ribbon gallery for the specified display state.
        Parameters:
        state - Display state.
        visibleButtonCount - Preferred width for the specified state.
      • getPreferredWidth

        public int getPreferredWidth​(RibbonElementPriority state,
                                     int availableHeight)
        Returns the preferred width of this in-ribbon gallery for the specified display state.
        Parameters:
        state - Display state.
        availableHeight - Available height in pixels.
        Returns:
        The preferred width of this in-ribbon gallery for the specified display state.
      • setDisplayPriority

        public void setDisplayPriority​(RibbonElementPriority displayPriority)
        Sets new display priority for this in-ribbon gallery.
        Parameters:
        displayPriority - New display priority for this in-ribbon gallery.
      • getDisplayPriority

        public RibbonElementPriority getDisplayPriority()
        Returns the current display priority for this in-ribbon gallery.
        Returns:
        The current display priority for this in-ribbon gallery.
      • getButtonGroupCount

        public int getButtonGroupCount()
        Returns the number of button groups in this in-ribbon gallery.
        Returns:
        The number of button groups in this in-ribbon gallery.
      • getButtonGroup

        public List<JCommandToggleButton> getButtonGroup​(String buttonGroupName)
        Returns the list of buttons in the specifed button group.
        Parameters:
        buttonGroupName - Button group name.
        Returns:
        The list of buttons in the specifed button group.
      • getButtonCount

        public int getButtonCount()
        Returns the number of gallery buttons in this in-ribbon gallery.
        Returns:
        The number of gallery buttons in this in-ribbon gallery.
      • getButtonAt

        public JCommandToggleButton getButtonAt​(int index)
        Returns the gallery button at specified index.
        Parameters:
        index - Gallery button index.
        Returns:
        Gallery button at specified index.
      • getSelectedButton

        public JCommandToggleButton getSelectedButton()
        Returns the currently selected gallery button.
        Returns:
        The currently selected gallery button.
      • setSelectedButton

        public void setSelectedButton​(JCommandToggleButton selectedButton)
        Sets new value for the currently selected gallery button.
        Parameters:
        selectedButton - New value for the currently selected gallery button.
      • getPopupButtonPanel

        public JCommandButtonPanel getPopupButtonPanel()
        Returns the associated popup gallery.
        Returns:
        The associated popup gallery.
      • setShowingPopupPanel

        public void setShowingPopupPanel​(boolean isShowingPopupPanel)
        Sets indication whether the popup panel is showing.
        Parameters:
        isShowingPopupPanel - Indication whether the popup panel is showing.
      • isShowingPopupPanel

        public boolean isShowingPopupPanel()
        Returns indication whether the popup panel is showing.
        Returns:
        true if the popup panel is showing, false otherwise.
      • addRibbonGalleryButtons

        public void addRibbonGalleryButtons​(String buttonGroupName,
                                            JCommandToggleButton... buttons)
        Adds toggle command buttons to the specified button group in this ribbon gallery.
        Parameters:
        buttonGroupName - Button group name.
        buttons - Toggle command buttons to add to the specified button group.
      • removeRibbonGalleryButtons

        public void removeRibbonGalleryButtons​(JCommandToggleButton... buttons)
        Removes the specified toggle command buttons from this ribbon gallery.
        Parameters:
        buttons - Toggle command buttons to remove from this gallery.
      • setPreferredPopupPanelDimension

        public void setPreferredPopupPanelDimension​(int preferredPopupMaxButtonColumns,
                                                    int preferredPopupMaxVisibleButtonRows)
        Sets the preferred dimension of the popup panel.
        Parameters:
        preferredPopupMaxButtonColumns - Preferred maximum number of button columns for the popup panel.
        preferredPopupMaxVisibleButtonRows - Preferred maximum number of visible button rows for the popup panel.
      • getPreferredPopupMaxButtonColumns

        public int getPreferredPopupMaxButtonColumns()
      • getPreferredPopupMaxVisibleButtonRows

        public int getPreferredPopupMaxVisibleButtonRows()
      • setExpandKeyTip

        public void setExpandKeyTip​(String expandKeyTip)
      • getExpandKeyTip

        public String getExpandKeyTip()