public class ActionToolbarImpl extends javax.swing.JPanel implements ActionToolbar, QuickActionProvider
Modifier and Type | Class and Description |
---|---|
static interface |
ActionToolbarImpl.PopupStateModifier |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
java.awt.Container.AccessibleAWTContainer
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
ActionToolbar.LayoutPolicy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ACTION_TOOLBAR_PROPERTY_KEY, AUTO_LAYOUT_POLICY, DEFAULT_MINIMUM_BUTTON_SIZE, NAVBAR_MINIMUM_BUTTON_SIZE, NOWRAP_LAYOUT_POLICY, WRAP_LAYOUT_POLICY
KEY
Constructor and Description |
---|
ActionToolbarImpl(java.lang.String place,
ActionGroup actionGroup,
boolean horizontal) |
ActionToolbarImpl(java.lang.String place,
ActionGroup actionGroup,
boolean horizontal,
boolean decorateButtons) |
ActionToolbarImpl(java.lang.String place,
ActionGroup actionGroup,
boolean horizontal,
boolean decorateButtons,
boolean updateActionsNow) |
Modifier and Type | Method and Description |
---|---|
void |
addNotify() |
void |
adjustTheSameSize(boolean value)
If the value is
true then the all button on toolbar are
the same size. |
void |
clearPresentationCache() |
protected ActionButton |
createToolbarButton(AnAction action,
ActionButtonLook look,
java.lang.String place,
Presentation presentation,
java.awt.Dimension minimumSize) |
void |
doLayout() |
ActionGroup |
getActionGroup() |
java.util.List<AnAction> |
getActions() |
java.util.List<AnAction> |
getActions(boolean originalProvider) |
javax.swing.JComponent |
getComponent() |
protected java.awt.Graphics |
getComponentGraphics(java.awt.Graphics graphics) |
protected DataContext |
getDataContext() |
int |
getLayoutPolicy() |
int |
getMaxButtonHeight() |
java.awt.Dimension |
getMinimumSize() |
int |
getOrientation() |
java.lang.String |
getPlace() |
java.awt.Dimension |
getPreferredSize() |
Presentation |
getPresentation(AnAction action) |
ActionButton |
getSecondaryActionsButton() |
protected java.awt.Color |
getSeparatorColor() |
DataContext |
getToolbarDataContext() |
boolean |
hasVisibleActions() |
protected void |
paintComponent(java.awt.Graphics g) |
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent e) |
void |
removeNotify() |
void |
setForceMinimumSize(boolean force)
Forces the minimum size of the toolbar to show all buttons, When set to
true . |
void |
setForceShowFirstComponent(boolean showFirstComponent)
By default minimum size is to show chevron only.
|
void |
setLayoutPolicy(int layoutPolicy)
Sets new component layout policy.
|
void |
setMiniMode(boolean minimalMode) |
void |
setMinimumButtonSize(java.awt.Dimension size)
Sets minimum size of toolbar button.
|
void |
setOrientation(int orientation)
Sets toolbar orientation
|
void |
setReservePlaceAutoPopupIcon(boolean reserve) |
void |
setSecondaryActionsIcon(javax.swing.Icon icon) |
void |
setSecondaryActionsIcon(javax.swing.Icon icon,
boolean hideDropdownIcon) |
void |
setSecondaryActionsShortcut(java.lang.String secondaryActionsShortcut) |
void |
setSecondaryActionsTooltip(java.lang.String secondaryActionsTooltip) |
void |
setSecondaryButtonPopupStateModifier(ActionToolbarImpl.PopupStateModifier popupStateModifier) |
void |
setShowSeparatorTitles(boolean showSeparatorTitles)
Enables showing titles of separators as labels in the toolbar (off by default).
|
void |
setSkipWindowAdjustments(boolean skipWindowAdjustments)
This option makes sense when you use a toolbar inside JBPopup
When some 'actions' are hidden under the chevron the popup with extra components would be shown/hidden
with size adjustments for the main popup (this is default behavior).
|
void |
setTargetComponent(javax.swing.JComponent component)
Will be used for data-context retrieval.
|
void |
updateActionsImmediately()
Forces update of the all actions in the toolbars.
|
static void |
updateAllToolbarsImmediately() |
void |
updateUI() |
void |
validate() |
getAccessibleContext, getUI, getUIClassID, paramString, setUI
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, transferFocusDownCycle, validateTree
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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, isCycleRoot
public ActionToolbarImpl(java.lang.String place, ActionGroup actionGroup, boolean horizontal)
public ActionToolbarImpl(java.lang.String place, ActionGroup actionGroup, boolean horizontal, boolean decorateButtons)
public ActionToolbarImpl(java.lang.String place, ActionGroup actionGroup, boolean horizontal, boolean decorateButtons, boolean updateActionsNow)
public static void updateAllToolbarsImmediately()
public ActionButton getSecondaryActionsButton()
public void updateUI()
updateUI
in class javax.swing.JPanel
public java.lang.String getPlace()
public void addNotify()
addNotify
in class javax.swing.JComponent
public void removeNotify()
removeNotify
in class javax.swing.JComponent
public javax.swing.JComponent getComponent()
getComponent
in interface ActionToolbar
getComponent
in interface QuickActionProvider
public int getLayoutPolicy()
getLayoutPolicy
in interface ActionToolbar
ActionToolbar.NOWRAP_LAYOUT_POLICY
,
ActionToolbar.WRAP_LAYOUT_POLICY
public void setLayoutPolicy(int layoutPolicy)
ActionToolbar
ActionToolbar.WRAP_LAYOUT_POLICY
and
ActionToolbar.NOWRAP_LAYOUT_POLICY
values.setLayoutPolicy
in interface ActionToolbar
protected java.awt.Graphics getComponentGraphics(java.awt.Graphics graphics)
getComponentGraphics
in class javax.swing.JComponent
public ActionGroup getActionGroup()
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void setSecondaryButtonPopupStateModifier(ActionToolbarImpl.PopupStateModifier popupStateModifier)
protected ActionButton createToolbarButton(AnAction action, ActionButtonLook look, java.lang.String place, Presentation presentation, java.awt.Dimension minimumSize)
public void doLayout()
doLayout
in class java.awt.Container
public void validate()
validate
in class java.awt.Container
public int getMaxButtonHeight()
getMaxButtonHeight
in interface ActionToolbar
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void setForceMinimumSize(boolean force)
true
. By default (false
) the
toolbar will shrink further and show the auto popup chevron button.public void setForceShowFirstComponent(boolean showFirstComponent)
true
toolbar shows at least one (the first) component plus chevron (if need)public void setSkipWindowAdjustments(boolean skipWindowAdjustments)
true
size adjustments would be omittedpublic java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
protected java.awt.Color getSeparatorColor()
public void adjustTheSameSize(boolean value)
ActionToolbar
true
then the all button on toolbar are
the same size. It very useful when you create "Outlook" like toolbar.
Currently this method can be considered as hot fix.adjustTheSameSize
in interface ActionToolbar
public void setMinimumButtonSize(java.awt.Dimension size)
ActionToolbar
setMinimumButtonSize
in interface ActionToolbar
public void setOrientation(int orientation)
ActionToolbar
setOrientation
in interface ActionToolbar
SwingConstants.HORIZONTAL
,
SwingConstants.VERTICAL
public int getOrientation()
public void updateActionsImmediately()
ActionToolbar
updateActionsImmediately
in interface ActionToolbar
public boolean hasVisibleActions()
hasVisibleActions
in interface ActionToolbar
public void setTargetComponent(javax.swing.JComponent component)
ActionToolbar
setTargetComponent
in interface ActionToolbar
public DataContext getToolbarDataContext()
getToolbarDataContext
in interface ActionToolbar
public void setShowSeparatorTitles(boolean showSeparatorTitles)
ActionToolbar
setShowSeparatorTitles
in interface ActionToolbar
protected DataContext getDataContext()
protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
processMouseMotionEvent
in class javax.swing.JComponent
public void setReservePlaceAutoPopupIcon(boolean reserve)
setReservePlaceAutoPopupIcon
in interface ActionToolbar
public void setSecondaryActionsTooltip(java.lang.String secondaryActionsTooltip)
setSecondaryActionsTooltip
in interface ActionToolbar
public void setSecondaryActionsShortcut(java.lang.String secondaryActionsShortcut)
public void setSecondaryActionsIcon(javax.swing.Icon icon)
setSecondaryActionsIcon
in interface ActionToolbar
public void setSecondaryActionsIcon(javax.swing.Icon icon, boolean hideDropdownIcon)
setSecondaryActionsIcon
in interface ActionToolbar
public java.util.List<AnAction> getActions(boolean originalProvider)
getActions
in interface QuickActionProvider
public java.util.List<AnAction> getActions()
getActions
in interface ActionToolbar
public void setMiniMode(boolean minimalMode)
setMiniMode
in interface ActionToolbar
public Presentation getPresentation(AnAction action)
public void clearPresentationCache()