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
public abstract class BasicCommandButtonUI extends CommandButtonUI
Basic UI for command buttonJCommandButton.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.event.ChangeListeneractionPreviewChangeListenerprotected RadianceThemingSlices.BackgroundAppearanceStrategybackgroundAppearanceStrategyprivate BasicCommandButtonListenerbasicPopupButtonListenerTracks user interaction with the command button (including keyboard and mouse).protected JCommandButtoncommandButtonThe associated command button.private javax.swing.event.ChangeListenercommandMenuContentChangeListenerprivate java.beans.PropertyChangeListenercommandPropertyChangeListenerprivate CommandActiondisposePopupsActionListenerThis listener disposes all popup panels when button's action is activated.static java.lang.StringDO_NOT_DISPOSE_POPUPSClient property to mark the command button to not dispose the popups on activation.protected java.lang.StringextraTextprivate java.awt.event.FocusListenerfocusListenerprotected HorizontalAlignmenthorizontalAlignmentprotected RadianceIconiconprotected booleanisInnerFocusOnActionprotected CommandButtonLayoutManager.CommandButtonLayoutInfolayoutInfoLayout information.protected CommandButtonLayoutManagerlayoutManagerprivate PopupActionListenerpopupActionListenerAction listener on the popup area.protected RadianceIconpopupIconThe popup indicator icon.private java.beans.PropertyChangeListenerpropertyChangeListenerProperty change listener.protected java.lang.Stringtext
-
Constructor Summary
Constructors Modifier Constructor Description protectedBasicCommandButtonUI()Creates a new UI delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BasicCommandButtonListenercreateButtonListener()Creates the button listener for the specified command button.protected PopupActionListenercreatePopupActionListener()Creates the popup action listener for this command button.java.awt.PointgetActionKeyTipAnchorCenterPoint()RadianceThemingSlices.BackgroundAppearanceStrategygetBackgroundAppearanceStrategy()CommandButtonLayoutManager.CommandButtonLayoutInfogetLayoutInfo()Returns the layout information for the associated button.CommandButtonLayoutManagergetLayoutManager()java.awt.PointgetPopupKeyTipAnchorCenterPoint()java.awt.DimensiongetPreferredSize(javax.swing.JComponent c)protected voidinstallComponents()Installs subcomponents on the associated command button.protected voidinstallDefaults()Installs defaults on the associated command button.protected voidinstallKeyboardActions()Installs the keyboard actions on the associated command button.protected voidinstallListeners()Installs listeners on the associated command button.voidinstallUI(javax.swing.JComponent c)booleanisInnerFocusOnAction()protected booleanisPaintingBackground()Returns indication whether the button background is painted.protected booleanisPaintingSeparators()Returns indication whether the action-popup areas separator is painted.voidprocessPopupAction()voidsetInnerFocusOnAction(boolean innerFocusOnAction)private voidsyncActionPreview(BaseCommand<?> command, BaseCommand.CommandActionPreview actionPreview)private voidsyncIconDimension()private voidsyncInitialInnerFocus()private voidtoggleInnerFocus()protected voiduninstallComponents()Uninstalls subcomponents from the associated command button.protected voiduninstallDefaults()Uninstalls defaults from the associated command button.protected voiduninstallKeyboardActions()Uninstalls the keyboard actions from the associated command button.protected voiduninstallListeners()Uninstalls listeners from the associated command button.voiduninstallUI(javax.swing.JComponent c)voidupdate(java.awt.Graphics g, javax.swing.JComponent c)private voidupdateBorder()private voidupdateIconDimension()Updates the icon dimension.protected voidupdatePopupIcon()Updates the popup indicator icon.
-
-
-
Field Detail
-
commandButton
protected JCommandButton commandButton
The associated command button.
-
propertyChangeListener
private java.beans.PropertyChangeListener propertyChangeListener
Property change listener.
-
commandPropertyChangeListener
private java.beans.PropertyChangeListener commandPropertyChangeListener
-
commandMenuContentChangeListener
private javax.swing.event.ChangeListener commandMenuContentChangeListener
-
basicPopupButtonListener
private BasicCommandButtonListener basicPopupButtonListener
Tracks user interaction with the command button (including keyboard and mouse).
-
layoutInfo
protected CommandButtonLayoutManager.CommandButtonLayoutInfo layoutInfo
Layout information.
-
actionPreviewChangeListener
private javax.swing.event.ChangeListener actionPreviewChangeListener
-
focusListener
private java.awt.event.FocusListener focusListener
-
isInnerFocusOnAction
protected boolean isInnerFocusOnAction
-
text
protected java.lang.String text
-
extraText
protected java.lang.String extraText
-
icon
protected RadianceIcon icon
-
horizontalAlignment
protected HorizontalAlignment horizontalAlignment
-
backgroundAppearanceStrategy
protected RadianceThemingSlices.BackgroundAppearanceStrategy backgroundAppearanceStrategy
-
DO_NOT_DISPOSE_POPUPS
public static final java.lang.String DO_NOT_DISPOSE_POPUPS
Client property to mark the command button to not dispose the popups on activation.- See Also:
disposePopupsActionListener, Constant Field Values
-
disposePopupsActionListener
private CommandAction 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:
DO_NOT_DISPOSE_POPUPS
-
popupActionListener
private PopupActionListener popupActionListener
Action listener on the popup area.
-
popupIcon
protected RadianceIcon popupIcon
The popup indicator icon.
-
layoutManager
protected CommandButtonLayoutManager layoutManager
-
-
Method Detail
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUIin classjavax.swing.plaf.ComponentUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUIin classjavax.swing.plaf.ComponentUI
-
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
protected BasicCommandButtonListener 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
public void update(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
updatein classjavax.swing.plaf.ComponentUI
-
updateIconDimension
private void updateIconDimension()
Updates the icon dimension.
-
updatePopupIcon
protected void updatePopupIcon()
Updates the popup indicator icon.
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSizein classjavax.swing.plaf.ComponentUI
-
getLayoutInfo
public CommandButtonLayoutManager.CommandButtonLayoutInfo 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
public CommandButtonLayoutManager 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
protected PopupActionListener 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
public java.awt.Point getActionKeyTipAnchorCenterPoint()
- Specified by:
getActionKeyTipAnchorCenterPointin classCommandButtonUI
-
getPopupKeyTipAnchorCenterPoint
public java.awt.Point 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
public RadianceThemingSlices.BackgroundAppearanceStrategy getBackgroundAppearanceStrategy()
-
-