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
- Direct Known Subclasses:
BasicRibbonTaskToggleButtonUI
,RadianceCommandButtonUI
Basic UI for command button
JCommandButton
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChangeListener
private BasicCommandButtonListener
Tracks user interaction with the command button (including keyboard and mouse).protected JCommandButton
The associated command button.private PropertyChangeListener
private CommandAction
This listener disposes all popup panels when button's action is activated.static final String
Client property to mark the command button to not dispose the popups on activation.protected String
private FocusListener
protected HorizontalAlignment
protected RadianceIcon
protected boolean
Layout information.protected CommandButtonLayoutManager
private PopupActionListener
Action listener on the popup area.protected RadianceIcon
The popup indicator icon.private PropertyChangeListener
Property change listener.protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BasicCommandButtonListener
Creates the button listener for the specified command button.protected PopupActionListener
Creates the popup action listener for this command button.Returns the layout information for the associated button.protected void
Installs subcomponents on the associated command button.protected void
Installs defaults on the associated command button.protected void
Installs the keyboard actions on the associated command button.protected void
Installs listeners on the associated command button.void
boolean
protected boolean
Returns indication whether the button background is painted.protected boolean
Returns indication whether the action-popup areas separator is painted.void
void
setInnerFocusOnAction
(boolean innerFocusOnAction) private void
syncActionPreview
(BaseCommand<?> command, BaseCommand.CommandActionPreview actionPreview) private void
private void
private void
protected void
Uninstalls subcomponents from the associated command button.protected void
Uninstalls defaults from the associated command button.protected void
Uninstalls the keyboard actions from the associated command button.protected void
Uninstalls listeners from the associated command button.void
void
update
(Graphics g, JComponent c) private void
private void
Updates the icon dimension.protected void
Updates the popup indicator icon.Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, paint
-
Field Details
-
commandButton
The associated command button. -
propertyChangeListener
Property change listener. -
commandPropertyChangeListener
-
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:
installUI
in classComponentUI
-
uninstallUI
- Overrides:
uninstallUI
in 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:
update
in classComponentUI
-
updateIconDimension
private void updateIconDimension()Updates the icon dimension. -
updatePopupIcon
protected void updatePopupIcon()Updates the popup indicator icon. -
getPreferredSize
- Overrides:
getPreferredSize
in classComponentUI
-
getLayoutInfo
Description copied from class:CommandButtonUI
Returns the layout information for the associated button.- Specified by:
getLayoutInfo
in classCommandButtonUI
- Returns:
- Layout information for the associated button.
-
getLayoutManager
- Specified by:
getLayoutManager
in classCommandButtonUI
-
isPaintingSeparators
protected boolean isPaintingSeparators()Returns indication whether the action-popup areas separator is painted.- Returns:
true
if the action-popup areas separator is painted.
-
isPaintingBackground
protected boolean isPaintingBackground()Returns indication whether the button background is painted.- Returns:
true
if 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:
getActionKeyTipAnchorCenterPoint
in classCommandButtonUI
-
getPopupKeyTipAnchorCenterPoint
- Specified by:
getPopupKeyTipAnchorCenterPoint
in classCommandButtonUI
-
syncInitialInnerFocus
private void syncInitialInnerFocus() -
toggleInnerFocus
private void toggleInnerFocus() -
isInnerFocusOnAction
public boolean isInnerFocusOnAction()- Specified by:
isInnerFocusOnAction
in classCommandButtonUI
-
setInnerFocusOnAction
public void setInnerFocusOnAction(boolean innerFocusOnAction) - Specified by:
setInnerFocusOnAction
in classCommandButtonUI
-