public class GeneiousActionToolbar extends GPanel
| Modifier and Type | Class and Description |
|---|---|
static class |
GeneiousActionToolbar.CustomToolbarComponent
Encapsulates the information necessary for adding a custom component to the toolbar.
|
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
GeneiousActionToolbar(Preferences preferences,
boolean defaultLargeIcons,
boolean defaultShowLabels)
Construct a GeneiousActionToolbar where the actions will be in the toolbar in the order determined by
GeneiousActionOptions.getMainToolbarPosition()/alphabetically
for any actions with the same toolbar position value. |
GeneiousActionToolbar(Preferences preferences,
boolean defaultLargeIcons,
boolean defaultShowLabels,
boolean showButtonsInTheOrderTheyAreAdded)
Construct a GeneiousActionToolbar
|
| Modifier and Type | Method and Description |
|---|---|
AbstractButton |
addAction(GeneiousAction action)
Add an action to the toolbar.
|
AbstractButton |
addAction(GeneiousAction action,
boolean defaultVisible)
Add an action to the toolbar.
|
AbstractButton |
addAction(GeneiousAction action,
boolean defaultVisible,
boolean floatRight)
Add an action to the toolbar.
|
void |
addButton(AbstractButton button,
boolean defaultVisible)
|
void |
addCustomComponent(GeneiousActionToolbar.CustomToolbarComponent customToolbarComponent)
Adds a custom component to the toolbar.
|
List<GeneiousAction> |
getActions()
Get all the GeneiousActions that are in this toolbar.
|
Dimension |
getMinimumSize() |
boolean |
isLargeIcons() |
boolean |
isShowLabels() |
void |
removeAction(GeneiousAction action)
Remove an action from the toolbar, the button associated with the action will be removed.
|
void |
removeAll() |
void |
setAutoHideLabels(boolean autoHideLabels)
If set to true and the toolbar is showing small icons, when the toolbar becomes too small to fit all of its buttons,
labels on the buttons will be hidden automatically.
|
void |
setFocusComponent(JComponent component)
set an optional component to be focused when any of the actions are invoked or null
to have no component focused.
|
void |
setIconSizeOptionEnabled(boolean isEnabled)
Set whether the icon size option is available in the popup menu.
|
void |
setLargeIconLabelHorizontal(boolean isHorizontal)
By default, the toolbar displays text beside the icon only if we are using small icons.
|
void |
setLargeIcons(boolean isLarge)
Set whether to display large icons (24x24 pixels) or small icons (16x16 pixels) for all buttons.
|
void |
setOpaque(boolean isOpaque) |
void |
setPopupEnabled(boolean isPopupEnabled)
Set whether the user should be able to right-click on the toolbar to change its properties via a popup menu.
|
void |
setShowLabels(boolean isShowLabels)
Set whether or not text labels are showing on all buttons.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, 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, transferFocusBackward, transferFocusUpCyclepublic GeneiousActionToolbar(Preferences preferences, boolean defaultLargeIcons, boolean defaultShowLabels)
GeneiousActionOptions.getMainToolbarPosition()/alphabetically
for any actions with the same toolbar position value.preferences - the preferences node used to store toolbar statedefaultLargeIcons - true for large icons on the toolbar buttons by defaultdefaultShowLabels - true to show text labels on the toolbar buttons by defaultpublic GeneiousActionToolbar(Preferences preferences, boolean defaultLargeIcons, boolean defaultShowLabels, boolean showButtonsInTheOrderTheyAreAdded)
preferences - the preferences node used to store toolbar statedefaultLargeIcons - true for large icons on the toolbar buttons by defaultdefaultShowLabels - true to show text labels on the toolbar buttons by defaultshowButtonsInTheOrderTheyAreAdded - true to have the buttons shown in the toolbar in the order they are added
useing addButton(...), false to have the buttons in the order determined by
GeneiousActionOptions.getMainToolbarPosition()/alphabetical
for any actions with the same toolbar position value.public void setLargeIcons(boolean isLarge)
isLarge - true for large icons, false for small.public void setShowLabels(boolean isShowLabels)
isShowLabels - true to show labels on all buttons, false for no labels.public boolean isShowLabels()
public boolean isLargeIcons()
public AbstractButton addAction(GeneiousAction action)
action - action to add to the toolbarpublic AbstractButton addAction(GeneiousAction action, boolean defaultVisible)
action - action to add to the toolbardefaultVisible - true to have the button visible by default, false to have it not visible by default.public AbstractButton addAction(GeneiousAction action, boolean defaultVisible, boolean floatRight)
action - action to add to the toolbardefaultVisible - true to have the button visible by default, false to have it not visible by default.floatRight - true to have the button stick to the right hand side of the toolbar@Deprecated public void addButton(AbstractButton button, boolean defaultVisible)
public void addCustomComponent(GeneiousActionToolbar.CustomToolbarComponent customToolbarComponent)
addButton(javax.swing.AbstractButton, boolean, boolean) instead.customToolbarComponent - the custom component to addpublic void removeAction(GeneiousAction action)
action - action to remove from the toolbarpublic void setFocusComponent(JComponent component)
component - JComponent to focus when an action in the toolbar is invoked.public void setAutoHideLabels(boolean autoHideLabels)
autoHideLabels - true to hide labels automatically when the toolbar is too small, false to not hide labels automatically.public List<GeneiousAction> getActions()
public void setPopupEnabled(boolean isPopupEnabled)
isPopupEnabled - true to have the popup menu displayed when the user right-clicks, false otherwise.public void setIconSizeOptionEnabled(boolean isEnabled)
isEnabled - true to have the icon size options available, false otherwise.public void setLargeIconLabelHorizontal(boolean isHorizontal)
isHorizontal - true to display text beside a large icon, false to display text below it as normalpublic void setOpaque(boolean isOpaque)
setOpaque in class JComponentpublic Dimension getMinimumSize()
getMinimumSize in class JComponent