|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
org.crosswire.common.swing.CWAction
public class CWAction
A CrossWire Action is a generic extension of AbstractAction, that adds LARGE_ICON to Action and also forwards the Action to its listeners after modifying the ActionEvent to include the ACTION_COMMAND_KEY.
for license details.
The copyright to this program is held by it's authors.
,
Serialized FormField Summary | |
---|---|
static String |
LARGE_ICON
The icon to display when a large one is needed. |
private EventListenerList |
listeners
|
private static org.slf4j.Logger |
log
The log stream |
private static long |
serialVersionUID
Serialization ID |
static String |
TOOL_TIP
The tooltip to display. |
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 | |
---|---|
CWAction()
|
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent evt)
Forwards the ActionEvent to the registered listener. |
void |
addActionListener(ActionListener listener)
Adds a listener for Action events. |
CWAction |
clone()
Create a clone that does not copy the listeners. |
CWAction |
enable(boolean newEnabled)
Set enabled either true or false on this action. |
private KeyStroke |
getAccelerator(String acceleratorSpec)
Convert the string to a valid Accelerator (that is a KeyStroke) |
private KeyStroke |
getKeyStroke(String acceleratorSpec)
|
void |
removeActionListener(ActionListener listener)
Remove an ActionListener |
CWAction |
setAccelerator(String acceleratorSpec)
Set the accelerator key from spec. |
CWAction |
setLargeIcon(Icon icon)
Set or clear, using null, the icon on this action. |
CWAction |
setLargeIcon(String iconPath)
|
CWAction |
setListener(ActionListener listener)
Create a clone of this action and attache the listener. |
CWAction |
setSmallIcon(Icon icon)
Set or clear, using null, the icon on this action. |
CWAction |
setSmallIcon(String iconPath)
|
CWAction |
setTooltip(String tooltip)
|
String |
toString()
String representation of this object suitable for debugging |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String LARGE_ICON
public static final String TOOL_TIP
private EventListenerList listeners
private static final org.slf4j.Logger log
private static final long serialVersionUID
Constructor Detail |
---|
public CWAction()
Method Detail |
---|
public CWAction setLargeIcon(Icon icon)
icon
- the small icon to set
public CWAction setLargeIcon(String iconPath)
public CWAction setTooltip(String tooltip)
public CWAction setSmallIcon(Icon icon)
icon
- the small icon to set
public CWAction setSmallIcon(String iconPath)
public CWAction setAccelerator(String acceleratorSpec)
acceleratorSpec
-
public CWAction enable(boolean newEnabled)
newEnabled
- the desired state
public CWAction setListener(ActionListener listener)
listener
- the listener for the action
public void actionPerformed(ActionEvent evt)
evt
- ActionEventpublic void addActionListener(ActionListener listener)
listener
- ActionListener
to addpublic void removeActionListener(ActionListener listener)
listener
- ActionListener
to removepublic String toString()
toString
in class Object
public CWAction clone()
clone
in class AbstractAction
AbstractAction.clone()
private KeyStroke getAccelerator(String acceleratorSpec)
private KeyStroke getKeyStroke(String acceleratorSpec) throws NumberFormatException
NumberFormatException
|
Copyright ยจ 2003-2013 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |