|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
com.ehsbe.commons.action.AbstractActionExt
public abstract class AbstractActionExt
Extends the concept of the Action to include toggle or group states.
Field Summary | |
---|---|
static String |
GROUP
The key for the button group |
static String |
IS_STATE
The key for the flag which indicates that this is a state type. |
static String |
LARGE_ICON_P_KEY
The key for the large pressed icon |
static String |
SELECT_PROPERTY_NAME
the property name to be used, when a selection property change gets fired. |
static String |
SMALL_ICON_P_KEY
The key for the small pressed icon |
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 | |
---|---|
AbstractActionExt(String name)
Create a action with the given name. |
|
AbstractActionExt(String name,
Icon icon)
Create a action with the given name and icon. |
|
AbstractActionExt(String name,
String command)
Constructs an Action with the label and command |
|
AbstractActionExt(String name,
String command,
Icon icon)
Constructs an action with the given name, icon and command key. |
Method Summary | |
---|---|
AbstractActionExt |
clone()
|
void |
dispose()
Will perform cleanup on the object. |
KeyStroke |
getAccelerator()
Returns the key stroke which represents an accelerator for the action. |
String |
getActionCommand()
Returns the action command. |
String |
getGroup()
Get the id of the group, to which this action belongs to. |
Icon |
getLargeIcon()
Returns a large icon which represents the action. |
Icon |
getLargePressedIcon()
Returns a large pressed icon which represents the action. |
String |
getLongDescription()
Returns a long desciption of the action. |
int |
getMnemonic()
Return the mnemonic key code for the action. |
String |
getName()
Returns the name of the action. |
String |
getShortDescription()
Returns a short desciption of the action. |
Icon |
getSmallIcon()
Returns a small icon which represents the action. |
Icon |
getSmallPressedIcon()
Returns a small pressed icon which represents the action. |
boolean |
isSelected()
Check the selection state of this action. |
boolean |
isStateAction()
Indicates if this action has states. |
void |
setAccelerator(KeyStroke key)
Sets the key stroke which represents an accelerator for the action. |
void |
setActionCommand(String key)
Sets the action command key. |
void |
setGroup(String group)
Sets the group identity of the state action. |
void |
setLargeIcon(Icon icon)
Sets the large icon which represents the action. |
void |
setLargePressedIcon(Icon icon)
Sets the large pressed icon which represents the action. |
void |
setLongDescription(String desc)
Sets the long desciption of the action. |
void |
setMnemonic(int mnemonic)
Sets the mnemonic key code for the action. |
void |
setMnemonic(String mnemonic)
Set the mnemonic for this action. |
void |
setName(String name)
Sets the name of the action. |
void |
setSelected(boolean newValue)
Changes the state of the action If this property has been changed, a property change event with the name selected gets fired. |
void |
setShortDescription(String desc)
Sets the short desciption of the action. |
void |
setSmallIcon(Icon icon)
Sets the small icon which represents the action. |
void |
setSmallPressedIcon(Icon icon)
Sets the small pressed icon which represents the action. |
void |
setStateAction()
Set the state property to true. |
void |
setStateAction(boolean state)
Set the state property. |
String |
toString()
|
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 |
Methods inherited from interface java.awt.event.ItemListener |
---|
itemStateChanged |
Methods inherited from interface java.awt.event.ActionListener |
---|
actionPerformed |
Field Detail |
---|
public static final String LARGE_ICON_P_KEY
public static final String SMALL_ICON_P_KEY
public static final String GROUP
public static final String IS_STATE
public static final String SELECT_PROPERTY_NAME
Constructor Detail |
---|
public AbstractActionExt(String name)
name
- action's nameAbstractAction.AbstractAction(String)
public AbstractActionExt(String name, Icon icon)
name
- action's nameicon
- small icon to setAbstractAction.AbstractAction(String, Icon)
public AbstractActionExt(String name, String command)
name
- name of the action usually used as a labelcommand
- command key of the actionpublic AbstractActionExt(String name, String command, Icon icon)
name
- display name of the actioncommand
- the value of the action command keyicon
- icon to displayMethod Detail |
---|
public String getShortDescription()
null
public void setShortDescription(String desc)
null
.
This is a convenience method for putValue
with the
Action.SHORT_DESCRIPTION
key.
desc
- the short description; can be null
Action.SHORT_DESCRIPTION
,
Action.putValue(java.lang.String, java.lang.Object)
public String getLongDescription()
null
public void setLongDescription(String desc)
null
.
This is a convenience method for putValue
with the
Action.LONG_DESCRIPTION
key.
desc
- the long description; can be null
Action.LONG_DESCRIPTION
,
Action.putValue(java.lang.String, java.lang.Object)
public Icon getSmallIcon()
null
public void setSmallIcon(Icon icon)
This is a convenience method for putValue
with the
Action.SMALL_ICON
key.
icon
- the small icon; can be null
Action.SMALL_ICON
,
Action.putValue(java.lang.String, java.lang.Object)
public Icon getSmallPressedIcon()
null
public void setSmallPressedIcon(Icon icon)
This is a convenience method for putValue
with the
SMALL_ICON_P_KEY
key.
icon
- the small icon; can be null
Action.SMALL_ICON
,
Action.putValue(java.lang.String, java.lang.Object)
public Icon getLargeIcon()
null
public void setLargeIcon(Icon icon)
This is a convenience method for putValue
with the
LARGE_ICON
key.
icon
- the large icon; can be null
Action.LARGE_ICON_KEY
,
Action.putValue(java.lang.String, java.lang.Object)
public Icon getLargePressedIcon()
null
public void setLargePressedIcon(Icon icon)
This is a convenience method for putValue
with the
LARGE_ICON_P_KEY
key.
icon
- the large icon; can be null
LARGE_ICON_P_KEY
,
Action.putValue(java.lang.String, java.lang.Object)
public void setName(String name)
This is a convenience method for putValue
with the
Action.NAME
key.
name
- the name of the action; can be null
Action.NAME
,
Action.putValue(java.lang.String, java.lang.Object)
public String getName()
null
public void setMnemonic(String mnemonic)
mnemonic
- only the first character of this parameter will be usedpublic void setMnemonic(int mnemonic)
This is a convenience method for putValue
with the
Action.MNEMONIC_KEY
key.
This method does not validate the value. Please see
AbstractButton.setMnemonic(int)
for details
concerning the value of the mnemonic.
mnemonic
- an int key code mnemonic or 0AbstractButton.setMnemonic(int)
,
Action.MNEMONIC_KEY
,
Action.putValue(java.lang.String, java.lang.Object)
public int getMnemonic()
public void setActionCommand(String key)
This is a convenience method for putValue
with the
Action.ACTION_COMMAND_KEY
key.
key
- the action commandAction.ACTION_COMMAND_KEY
,
Action.putValue(java.lang.String, java.lang.Object)
public String getActionCommand()
null
public KeyStroke getAccelerator()
null
public void setAccelerator(KeyStroke key)
This is a convenience method for putValue
with the
Action.ACCELERATOR_KEY
key.
key
- the key stroke; can be null
Action.ACCELERATOR_KEY
,
Action.putValue(java.lang.String, java.lang.Object)
public void setGroup(String group)
group
- groupId to setpublic String getGroup()
null
if this action belongs to no group, the
group's id otherwise.public void dispose()
public boolean isStateAction()
public void setStateAction()
public void setStateAction(boolean state)
state
- if true
then this action will fire ItemEventspublic boolean isSelected()
true
if the action is in the selected statepublic void setSelected(boolean newValue)
If this property has been changed, a property change event with the
name selected
gets fired.
newValue
- true to set the action as selected of the action.public String toString()
toString
in class Object
public AbstractActionExt clone() throws CloneNotSupportedException
clone
in class AbstractAction
CloneNotSupportedException
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |