|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction info.rolandkrueger.roklib.ui.swing.AbstractHoverableAction
public abstract class AbstractHoverableAction
This subclass of AbstractAction
enhances the action
classes with the ability of using hover messages. If the user points at one
of the GUI representations of the AbstractHoverableAction
, a
predefined message can be displayed by all HoverListener
s that have
been registered as listeners with the action object.
In order for this feature to work, an AbstractHoverableAction
must be
added to a menu bar or a tool bar by using methods
attachToMenu(JMenu)
and
attachToToolbar(JToolBar)
, respectively.
Hoverable
,
HoverManager
,
HoverListener
,
Serialized FormField Summary | |
---|---|
protected JButton |
mButton
|
private HoverManager |
mHoverManager
|
protected JMenuItem |
mMenuItem
|
private static long |
serialVersionUID
|
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
AbstractHoverableAction(String name,
Icon icon)
Constructs a new AbstractHoverableAction . |
Method Summary | |
---|---|
boolean |
addHoverListener(HoverListener listener)
Add a HoverListener to the list of listeners. |
void |
attachToMenu(JMenu menu)
Attach this AbstractHoverableAction to the given menu. |
void |
attachToToolbar(JToolBar toolbar)
Attach this AbstractHoverableAction to the given toolbar. |
String |
getHoverText()
Gets the hover text for this action. |
void |
setHoverMessage(String hoverMessage)
Sets the message that can be displayed during hover events. |
void |
setMnemonicKey(int mnemonicKey)
Sets the short key for this action. |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.event.ActionListener |
---|
actionPerformed |
Field Detail |
---|
private static final long serialVersionUID
protected JButton mButton
protected JMenuItem mMenuItem
private HoverManager mHoverManager
Constructor Detail |
---|
public AbstractHoverableAction(String name, Icon icon)
AbstractHoverableAction
.
AbstractAction.AbstractAction(java.lang.String, javax.swing.Icon)
Method Detail |
---|
public void attachToToolbar(JToolBar toolbar)
AbstractHoverableAction
to the given toolbar. By using
this method, the correct MouseListener
s will be
registered so that hover events will correctly by disseminated.
toolbar
- target toolbar that this action will be added topublic void attachToMenu(JMenu menu)
AbstractHoverableAction
to the given menu. By using
this method, the correct MouseListener
s will be
registered so that hover events will correctly by disseminated.
menu
- target menu that this action will be added topublic String getHoverText()
getHoverText
in interface Hoverable
public boolean addHoverListener(HoverListener listener)
HoverListener
to the list of listeners.
listener
- a HoverListener
registering for hover events
true
public void setHoverMessage(String hoverMessage)
hoverMessage
- a help message for this actionpublic void setMnemonicKey(int mnemonicKey)
mnemonicKey
- one of the key constants as defined in Action
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |