be.ugent.caagt.swirl.actions

Class ToolBarToggleButton


public class ToolBarToggleButton
extends JToggleButton

Button for use on a tool bar. Has the same functionality as JToggleButton but with a slightly different look and feel. See the documentation of ToolBarToggleButton for details.

Constructor Summary

ToolBarToggleButton(Action action)
Create a tool bar toggle button from the given action.

Method Summary

protected void
configurePropertiesFromAction(Action a)
protected PropertyChangeListener
createActionPropertyChangeListener(Action a)

Constructor Details

ToolBarToggleButton

public ToolBarToggleButton(Action action)
Create a tool bar toggle button from the given action. The following action properties are used:
  • The text of the button is set to null - and not to Action.NAME as might be expected.
  • The tool tip text is set to Action.SHORT_DESCRIPTION if it is non null, and otherwise to Action.NAME.
  • The icon is taken from SimpleAction.MEDIUM_ICON, unless this is null in which case Action.SMALL_ICON is used.
  • The icon for the disabled button is taken from SimpleAction.MEDIUM_DISABLED_ICON if it is non-null.
Note that no accelerator key or mnemonic is installed.

Method Details

configurePropertiesFromAction

protected void configurePropertiesFromAction(Action a)

createActionPropertyChangeListener

protected PropertyChangeListener createActionPropertyChangeListener(Action a)