|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand<JBandControlPanel>
org.pushingpixels.flamingo.api.ribbon.JRibbonBand
public class JRibbonBand
Ribbon band component. Can host three types of content:
addCommandButton(AbstractCommandButton, RibbonElementPriority)
.addRibbonComponent(JRibbonComponent)
or
addRibbonComponent(JRibbonComponent, int)
.addRibbonGallery(String, List, Map, int, int, RibbonElementPriority)
.
Command buttons are added with associated RibbonElementPriority
. The
higher the priority, the longer the button "stays" in the
CommandButtonDisplayState.BIG
or
CommandButtonDisplayState.MEDIUM
state - depending on the available
resize policies.
Wrapped components can span one or multiple rows. Use the
addRibbonComponent(JRibbonComponent, int)
API to add a wrapped
component that spans more than one row.
Once a ribbon gallery is added with
addRibbonGallery(String, List, Map, int, int, RibbonElementPriority)
, you can use the following APIs to configure the content and behavior of
that gallery:
addRibbonGalleryButtons(String, String, JCommandToggleButton...)
removeRibbonGalleryButtons(String, JCommandToggleButton...)
setSelectedRibbonGalleryButton(String, JCommandToggleButton)
setRibbonGalleryExpandKeyTip(String, String)
setRibbonGalleryPopupCallback(String, RibbonGalleryPopupCallback)
A ribbon band can have multiple visual groups separated with vertical
separator lines. To start a new unnamed group use the startGroup()
API. To start a new named group use the startGroup(String)
API.
Unnamed groups will have three rows of controls. Named groups will have two
rows of controls, with the top row showing the group title.
Nested Class Summary | |
---|---|
static interface |
JRibbonBand.RibbonGalleryPopupCallback
This callback allows application code to place additional menu entries in the popup menu shown when the ribbon gallery expand button is clicked. |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static CommandButtonDisplayState |
BIG_FIXED
Big size with landscape orientation. |
static CommandButtonDisplayState |
BIG_FIXED_LANDSCAPE
Big size with landscape orientation. |
Fields inherited from class org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand |
---|
controlPanel, resizePolicies, uiClassID |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JRibbonBand(java.lang.String title,
ResizableIcon icon)
Creates a new ribbon band. |
|
JRibbonBand(java.lang.String title,
ResizableIcon icon,
java.awt.event.ActionListener expandActionListener)
Creates a new ribbon band. |
Method Summary | |
---|---|
void |
addCommandButton(AbstractCommandButton commandButton,
RibbonElementPriority priority)
Adds the specified command button to this band. |
void |
addRibbonComponent(JRibbonComponent comp)
Adds the specified ribbon component to this ribbon band. |
void |
addRibbonComponent(JRibbonComponent comp,
int rowSpan)
Adds the specified ribbon component to this ribbon band. |
void |
addRibbonGallery(java.lang.String galleryName,
java.util.List<StringValuePair<java.util.List<JCommandToggleButton>>> buttons,
java.util.Map<RibbonElementPriority,java.lang.Integer> preferredVisibleButtonCounts,
int preferredPopupMaxButtonColumns,
int preferredPopupMaxVisibleButtonRows,
CommandButtonDisplayState ribbonButtonDisplayState,
RibbonElementPriority priority)
Adds a new ribbon gallery to this band. |
void |
addRibbonGallery(java.lang.String galleryName,
java.util.List<StringValuePair<java.util.List<JCommandToggleButton>>> buttons,
java.util.Map<RibbonElementPriority,java.lang.Integer> preferredVisibleButtonCounts,
int preferredPopupMaxButtonColumns,
int preferredPopupMaxVisibleButtonRows,
RibbonElementPriority priority)
|
void |
addRibbonGalleryButtons(java.lang.String galleryName,
java.lang.String buttonGroupName,
JCommandToggleButton... buttons)
Adds the specified command toggle buttons to a button group in the specified ribbon gallery. |
AbstractRibbonBand<JBandControlPanel> |
cloneBand()
Returns a clone of this ribbon band. |
java.util.List<JRibbonComponent> |
getRibbonComponents(int groupIndex)
|
void |
removeRibbonGalleryButtons(java.lang.String galleryName,
JCommandToggleButton... buttons)
Removes command toggle buttons from the specified ribbon gallery. |
void |
setGroupTitle(int groupIndex,
java.lang.String groupTitle)
Changes the title of the specified group. |
void |
setRibbonGalleryButtonDisplayState(java.lang.String galleryName,
CommandButtonDisplayState displayState)
Sets the display state for the buttons of the specified ribbon gallery. |
void |
setRibbonGalleryExpandKeyTip(java.lang.String galleryName,
java.lang.String expandKeyTip)
Sets the key tip on the expand button of the specified ribbon gallery. |
void |
setRibbonGalleryPopupCallback(java.lang.String galleryName,
JRibbonBand.RibbonGalleryPopupCallback popupCallback)
Sets the application callback to place additional entries in the popup menu shown when the specified ribbon gallery is expanded. |
void |
setSelectedRibbonGalleryButton(java.lang.String galleryName,
JCommandToggleButton buttonToSelect)
Selects the specified command toggle button in the specified ribbon gallery. |
int |
startGroup()
Starts a new unnamed group. |
int |
startGroup(java.lang.String groupTitle)
Starts a new named group. |
Methods inherited from class org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand |
---|
getCollapsedStateKeyTip, getControlPanel, getCurrentResizePolicy, getExpandActionListener, getExpandButtonKeyTip, getExpandButtonRichTooltip, getIcon, getPopupRibbonBand, getResizePolicies, getTitle, getUI, getUIClassID, setCollapsedStateKeyTip, setControlPanel, setCurrentResizePolicy, setExpandActionListener, setExpandButtonKeyTip, setExpandButtonRichTooltip, setIcon, setPopupRibbonBand, setResizePolicies, setTitle, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final CommandButtonDisplayState BIG_FIXED_LANDSCAPE
public static final CommandButtonDisplayState BIG_FIXED
Constructor Detail |
---|
public JRibbonBand(java.lang.String title, ResizableIcon icon)
title
- Band title.icon
- Associated icon (for collapsed state).public JRibbonBand(java.lang.String title, ResizableIcon icon, java.awt.event.ActionListener expandActionListener)
title
- Band title.icon
- Associated icon (for collapsed state).expandActionListener
- Expand action listener (can be null
).Method Detail |
---|
public void addCommandButton(AbstractCommandButton commandButton, RibbonElementPriority priority)
this
band.
commandButton
- Command button to add.priority
- Priority of the button.public void addRibbonGallery(java.lang.String galleryName, java.util.List<StringValuePair<java.util.List<JCommandToggleButton>>> buttons, java.util.Map<RibbonElementPriority,java.lang.Integer> preferredVisibleButtonCounts, int preferredPopupMaxButtonColumns, int preferredPopupMaxVisibleButtonRows, RibbonElementPriority priority)
public void addRibbonGallery(java.lang.String galleryName, java.util.List<StringValuePair<java.util.List<JCommandToggleButton>>> buttons, java.util.Map<RibbonElementPriority,java.lang.Integer> preferredVisibleButtonCounts, int preferredPopupMaxButtonColumns, int preferredPopupMaxVisibleButtonRows, CommandButtonDisplayState ribbonButtonDisplayState, RibbonElementPriority priority)
this
band.
galleryName
- Gallery name.buttons
- Button groups.preferredVisibleButtonCounts
- Preferred count of visible buttons of the ribbon gallery under
different states.preferredPopupMaxButtonColumns
- Preferred maximum columns in the popup gallery associated with
the ribbon gallery.preferredPopupMaxVisibleButtonRows
- Preferred maximum visible rows in the popup gallery associated
with the ribbon gallery.priority
- The initial ribbon gallery priority.addRibbonGalleryButtons(String, String, JCommandToggleButton...)
,
removeRibbonGalleryButtons(String, JCommandToggleButton...)
,
setSelectedRibbonGalleryButton(String, JCommandToggleButton)
public void addRibbonGalleryButtons(java.lang.String galleryName, java.lang.String buttonGroupName, JCommandToggleButton... buttons)
galleryName
- Ribbon gallery name.buttonGroupName
- Button group name.buttons
- Buttons to add.addRibbonGallery(String, List, Map, int, int,
RibbonElementPriority)
,
removeRibbonGalleryButtons(String, JCommandToggleButton...)
,
setSelectedRibbonGalleryButton(String, JCommandToggleButton)
public void removeRibbonGalleryButtons(java.lang.String galleryName, JCommandToggleButton... buttons)
galleryName
- Ribbon gallery name.buttons
- Buttons to remove.addRibbonGallery(String, List, Map, int, int,
RibbonElementPriority)
,
addRibbonGalleryButtons(String, String, JCommandToggleButton...)
,
setSelectedRibbonGalleryButton(String, JCommandToggleButton)
public void setSelectedRibbonGalleryButton(java.lang.String galleryName, JCommandToggleButton buttonToSelect)
galleryName
- Ribbon gallery name.buttonToSelect
- Button to select.addRibbonGallery(String, List, Map, int, int,
RibbonElementPriority)
,
addRibbonGalleryButtons(String, String, JCommandToggleButton...)
,
removeRibbonGalleryButtons(String, JCommandToggleButton...)
public void setRibbonGalleryButtonDisplayState(java.lang.String galleryName, CommandButtonDisplayState displayState)
galleryName
- Ribbon gallery name.displayState
- Display state for the buttons of the matching ribbon gallery.public void setRibbonGalleryPopupCallback(java.lang.String galleryName, JRibbonBand.RibbonGalleryPopupCallback popupCallback)
galleryName
- Gallery name.popupCallback
- Application callback.JRibbonBand.RibbonGalleryPopupCallback
public void setRibbonGalleryExpandKeyTip(java.lang.String galleryName, java.lang.String expandKeyTip)
galleryName
- Gallery name.expandKeyTip
- The key tip on the expand button of the specified ribbon
gallery.public void addRibbonComponent(JRibbonComponent comp)
comp
- The ribbon component to add.public void addRibbonComponent(JRibbonComponent comp, int rowSpan)
comp
- The ribbon component to add.rowSpan
- Row span of the ribbon component.
java.lang.IllegalArgumentException
- if the row span is not legal. Legal row span is 1..3 for
unnamed groups and 1..2 for named groups.startGroup()
,
startGroup(String)
public int startGroup()
public int startGroup(java.lang.String groupTitle)
groupTitle
- The group title.
public void setGroupTitle(int groupIndex, java.lang.String groupTitle)
groupIndex
- Group index.groupTitle
- The new title for this group.public java.util.List<JRibbonComponent> getRibbonComponents(int groupIndex)
public AbstractRibbonBand<JBandControlPanel> cloneBand()
AbstractRibbonBand
cloneBand
in class AbstractRibbonBand<JBandControlPanel>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |