Class BasicCommandButtonUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
org.pushingpixels.radiance.component.internal.ui.common.CommandButtonUI
org.pushingpixels.radiance.component.internal.ui.common.BasicCommandButtonUI
- All Implemented Interfaces:
RadianceCoreUtilities.BackgroundAppearanceStrategyAware
- Direct Known Subclasses:
BasicRibbonTaskToggleButtonUI, RadianceCommandButtonUI
Basic UI for command button
JCommandButton.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChangeListenerprivate BasicCommandButtonListenerTracks user interaction with the command button (including keyboard and mouse).protected JCommandButtonThe associated command button.private ChangeListenerprivate PropertyChangeListenerprivate CommandActionThis listener disposes all popup panels when button's action is activated.static final StringClient property to mark the command button to not dispose the popups on activation.protected Stringprivate FocusListenerprotected HorizontalAlignmentprotected RadianceIconprotected booleanLayout information.protected CommandButtonLayoutManagerprivate PopupActionListenerAction listener on the popup area.protected RadianceIconThe popup indicator icon.private PropertyChangeListenerProperty change listener.protected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BasicCommandButtonListenerCreates the button listener for the specified command button.protected PopupActionListenerCreates the popup action listener for this command button.Returns the layout information for the associated button.protected voidInstalls subcomponents on the associated command button.protected voidInstalls defaults on the associated command button.protected voidInstalls the keyboard actions on the associated command button.protected voidInstalls listeners on the associated command button.voidbooleanprotected booleanReturns indication whether the button background is painted.protected booleanReturns indication whether the action-popup areas separator is painted.voidvoidsetInnerFocusOnAction(boolean innerFocusOnAction) private voidsyncActionPreview(BaseCommand<?> command, BaseCommand.CommandActionPreview actionPreview) private voidprivate voidprivate voidprotected voidUninstalls subcomponents from the associated command button.protected voidUninstalls defaults from the associated command button.protected voidUninstalls the keyboard actions from the associated command button.protected voidUninstalls listeners from the associated command button.voidvoidupdate(Graphics g, JComponent c) private voidprivate voidUpdates the icon dimension.protected voidUpdates the popup indicator icon.Methods inherited from class ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, paint
-
Field Details
-
commandButton
The associated command button. -
propertyChangeListener
Property change listener. -
commandPropertyChangeListener
-
commandMenuContentChangeListener
-
basicPopupButtonListener
Tracks user interaction with the command button (including keyboard and mouse). -
layoutInfo
Layout information. -
actionPreviewChangeListener
-
focusListener
-
isInnerFocusOnAction
protected boolean isInnerFocusOnAction -
text
-
extraText
-
icon
-
horizontalAlignment
-
backgroundAppearanceStrategy
-
DO_NOT_DISPOSE_POPUPS
Client property to mark the command button to not dispose the popups on activation.- See Also:
-
disposePopupsActionListener
This listener disposes all popup panels when button's action is activated. An example of scenario would be a command button in the popup panel of an in-ribbon gallery. When this command button is activated, the associated popup panel is dismissed.- See Also:
-
popupActionListener
Action listener on the popup area. -
popupIcon
The popup indicator icon. -
layoutManager
-
-
Constructor Details
-
BasicCommandButtonUI
protected BasicCommandButtonUI()Creates a new UI delegate.
-
-
Method Details
-
installUI
- Overrides:
installUIin classComponentUI
-
uninstallUI
- Overrides:
uninstallUIin classComponentUI
-
installDefaults
protected void installDefaults()Installs defaults on the associated command button. -
updateBorder
private void updateBorder() -
installComponents
protected void installComponents()Installs subcomponents on the associated command button. -
installListeners
protected void installListeners()Installs listeners on the associated command button. -
createButtonListener
Creates the button listener for the specified command button.- Returns:
- The button listener for the specified command button.
-
installKeyboardActions
protected void installKeyboardActions()Installs the keyboard actions on the associated command button. -
uninstallDefaults
protected void uninstallDefaults()Uninstalls defaults from the associated command button. -
uninstallComponents
protected void uninstallComponents()Uninstalls subcomponents from the associated command button. -
uninstallListeners
protected void uninstallListeners()Uninstalls listeners from the associated command button. -
uninstallKeyboardActions
protected void uninstallKeyboardActions()Uninstalls the keyboard actions from the associated command button. -
update
- Overrides:
updatein classComponentUI
-
updateIconDimension
private void updateIconDimension()Updates the icon dimension. -
updatePopupIcon
protected void updatePopupIcon()Updates the popup indicator icon. -
getPreferredSize
- Overrides:
getPreferredSizein classComponentUI
-
getLayoutInfo
Description copied from class:CommandButtonUIReturns the layout information for the associated button.- Specified by:
getLayoutInfoin classCommandButtonUI- Returns:
- Layout information for the associated button.
-
getLayoutManager
- Specified by:
getLayoutManagerin classCommandButtonUI
-
isPaintingSeparators
protected boolean isPaintingSeparators()Returns indication whether the action-popup areas separator is painted.- Returns:
trueif the action-popup areas separator is painted.
-
isPaintingBackground
protected boolean isPaintingBackground()Returns indication whether the button background is painted.- Returns:
trueif the button background is painted.
-
createPopupActionListener
Creates the popup action listener for this command button.- Returns:
- Popup action listener for this command button.
-
processPopupAction
public void processPopupAction() -
syncIconDimension
private void syncIconDimension() -
syncActionPreview
private void syncActionPreview(BaseCommand<?> command, BaseCommand.CommandActionPreview actionPreview) -
getActionKeyTipAnchorCenterPoint
- Specified by:
getActionKeyTipAnchorCenterPointin classCommandButtonUI
-
getPopupKeyTipAnchorCenterPoint
- Specified by:
getPopupKeyTipAnchorCenterPointin classCommandButtonUI
-
syncInitialInnerFocus
private void syncInitialInnerFocus() -
toggleInnerFocus
private void toggleInnerFocus() -
isInnerFocusOnAction
public boolean isInnerFocusOnAction()- Specified by:
isInnerFocusOnActionin classCommandButtonUI
-
setInnerFocusOnAction
public void setInnerFocusOnAction(boolean innerFocusOnAction) - Specified by:
setInnerFocusOnActionin classCommandButtonUI
-
getBackgroundAppearanceStrategy
-