|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractAction
translator.ExtendedAction
public class ExtendedAction
This class represents an action object that allows calling methods on objects To use, simply invoke the ExtendedAction constructor by giving the label, icon name, tool tip text and the method to call (which currently must not have any parameters).
| Field Summary | |
|---|---|
protected javax.swing.AbstractButton |
wrapper
The wrapper of the current Action element |
| 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 | |
|---|---|
ExtendedAction(java.lang.String objectKey,
java.util.Locale locale,
ExtendedResourceBundle bundle,
java.lang.Object invocationTargetObject,
Translator translator)
Build a new object for invoking targetCall on the default Animal object |
|
ExtendedAction(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
|
ExtendedAction(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
|
ExtendedAction(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent actionEvent)
Handle the ActionEvent resulting once the object is activated This will try(!) to invoke the method on the target object |
static ExtendedAction |
addToMenu(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
char mnemonic,
javax.swing.JMenu menu,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
static ExtendedAction |
addToToolBar(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
char mnemonic,
javax.swing.JToolBar toolBar,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
static ExtendedAction |
addToToolBar(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
javax.swing.JToolBar toolBar,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
java.lang.Object[] |
getArguments()
Returns the arguments of the method call |
javax.swing.Icon |
getIcon()
Return the icon to display |
java.lang.String |
getLabel()
Return the label of this element |
java.lang.String |
getMethodToCall()
Return the method to be invoked |
java.lang.Object |
getSmallIcon()
|
java.lang.Object |
getTargetObject()
Return the target object of the method invocation |
java.lang.String |
getToolTipText()
Return the tool tip text |
Translator |
getTranslator()
Return the Translator instance |
static ExtendedAction |
insertAction(java.lang.String objectKey,
java.util.Locale locale,
ExtendedResourceBundle bundle,
java.lang.Object invocationTargetObject,
java.lang.Object[] arguments,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
char mnemonic,
javax.swing.JToolBar toolBar,
javax.swing.JMenu menu,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
static ExtendedAction |
insertAction(java.lang.String objectKey,
java.util.Locale locale,
ExtendedResourceBundle bundle,
java.lang.Object invocationTargetObject,
java.lang.Object[] arguments,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
javax.swing.JToolBar toolBar,
javax.swing.JMenu menu,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
static ExtendedAction |
insertAction(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
char mnemonic,
javax.swing.JToolBar toolBar,
javax.swing.JMenu menu,
Translator translator)
Build a new object for invoking targetCall on invocationTargetObject |
void |
setArguments(java.lang.Object[] args)
Sets the arguments of the method call |
void |
setIcon(javax.swing.Icon theIcon)
Change the icon to display |
void |
setIcon(java.lang.String iconName)
Change the icon to display |
void |
setLabel(java.lang.String label)
Change the label to display |
void |
setMethod(java.lang.String methodName)
Set the method to call |
void |
setObject(java.lang.Object target)
Set the object whose method shall be invoked |
void |
setTargetCall(java.lang.String methodName,
java.lang.Object target)
Set the object on which the method of the given name shall be invoked |
void |
setToolTipText(java.lang.String toolTipText)
Set the tool tip text |
java.lang.String |
toString()
Provide a String representation of this object |
| 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, wait, wait, wait |
| Field Detail |
|---|
protected javax.swing.AbstractButton wrapper
| Constructor Detail |
|---|
public ExtendedAction(java.lang.String objectKey,
java.util.Locale locale,
ExtendedResourceBundle bundle,
java.lang.Object invocationTargetObject,
Translator translator)
objectKey - the key for this object, used for retrieving the localized
informationlocale - the current localebundle - the resource bundle used for retrieving the data frominvocationTargetObject - the object on which the method will be invoked
public ExtendedAction(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
Translator translator)
label - the String label shown on the action elementiconName - the filename of the icon to use (which is loaded automatically)toolTipText - the text of the tool tiptargetCall - the method to invoke once the ExtendedAction object is activatedinvocationTargetObject - the object on which the method will be invoked
public ExtendedAction(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
Translator translator)
label - the String label shown on the action elementiconName - the filename of the icon to use (which is loaded automatically)toolTipText - the text of the tool tiptargetCall - the method to invoke once the ExtendedAction object is activatedinvocationTargetObject - the object on which the method will be invokedargs - the arguments for the method invocation
public ExtendedAction(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
Translator translator)
label - the String label shown on the action elementiconName - the filename of the icon to use (which is loaded automatically)toolTipText - the text of the tool tiptargetCall - the method to invoke once the ExtendedAction object is activatedinvocationTargetObject - the object on which the method will be invokedargs - the arguments for the method invocationkey - the key for this action when stored in the Hashtablehash - the Hashtable storing the actions or null if none is used| Method Detail |
|---|
public static ExtendedAction addToToolBar(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
javax.swing.JToolBar toolBar,
Translator translator)
label - the String label shown on the action elementiconName - the filename of the icon to use (which is loaded automatically)toolTipText - the text of the tool tiptargetCall - the method to invoke once the ExtendedAction object is activatedinvocationTargetObject - the object on which the method will be invokedargs - the arguments for the method invocationkey - the key for this action when stored in the Hashtablehash - the Hashtable storing the actions or null if none is usedtoolBar - the JToolBar to which the element is added
public static ExtendedAction addToToolBar(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
char mnemonic,
javax.swing.JToolBar toolBar,
Translator translator)
label - the String label shown on the action elementiconName - the filename of the icon to use (which is loaded automatically)toolTipText - the text of the tool tiptargetCall - the method to invoke once the ExtendedAction object is activatedinvocationTargetObject - the object on which the method will be invokedargs - the arguments for the method invocationkey - the key for this action when stored in the Hashtablehash - the Hashtable storing the actions or null if none is usedmnemonic - the mnemonic to be used for the elementtoolBar - the JToolBar to which the element is addedtranslator - the Translator used for I18N
public static ExtendedAction addToMenu(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
char mnemonic,
javax.swing.JMenu menu,
Translator translator)
label - the String label shown on the action elementiconName - the filename of the icon to use (which is loaded automatically)toolTipText - the text of the tool tiptargetCall - the method to invoke once the ExtendedAction object is activatedinvocationTargetObject - the object on which the method will be invokedargs - the arguments for the method invocationkey - the key for this action when stored in the Hashtablehash - the Hashtable storing the actions or null if none is usedmnemonic - the mnemonic to be used for the elementmenu - the JMenu to which the element is addedtranslator - the Translator used for I18N
public static ExtendedAction insertAction(java.lang.String label,
java.lang.String iconName,
java.lang.String toolTipText,
java.lang.String targetCall,
java.lang.Object invocationTargetObject,
java.lang.Object[] args,
java.lang.String key,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
char mnemonic,
javax.swing.JToolBar toolBar,
javax.swing.JMenu menu,
Translator translator)
label - the String label shown on the action elementiconName - the filename of the icon to use (which is loaded automatically)toolTipText - the text of the tool tiptargetCall - the method to invoke once the ExtendedAction object is activatedinvocationTargetObject - the object on which the method will be invokedargs - the arguments for the method invocationkey - the key for this action when stored in the Hashtablehash - the Hashtable storing the actions or null if none is usedmnemonic - the mnemonic to be used for the elementtoolBar - the JToolBar to which the element is addedmenu - the JMenu to which the element is addedtranslator - the Translator used for I18N
public static ExtendedAction insertAction(java.lang.String objectKey,
java.util.Locale locale,
ExtendedResourceBundle bundle,
java.lang.Object invocationTargetObject,
java.lang.Object[] arguments,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
javax.swing.JToolBar toolBar,
javax.swing.JMenu menu,
Translator translator)
objectKey - the key for the elementlocale - the locale to be used for the labelbundle - the animalResourceBundle used for translating the labelinvocationTargetObject - the object on which the method will be invokedarguments - the arguments for the method invocationhash - the Hashtable storing the actions or null if none is usedtoolBar - the JToolBar to which the element is addedmenu - the JMenu to which the element is added
public static ExtendedAction insertAction(java.lang.String objectKey,
java.util.Locale locale,
ExtendedResourceBundle bundle,
java.lang.Object invocationTargetObject,
java.lang.Object[] arguments,
java.util.Hashtable<java.lang.String,ExtendedAction> hash,
char mnemonic,
javax.swing.JToolBar toolBar,
javax.swing.JMenu menu,
Translator translator)
objectKey - the key for the elementlocale - the locale to be used for the labelbundle - the animalResourceBundle used for translating the labelinvocationTargetObject - the object on which the method will be invokedarguments - the arguments for the method invocationhash - the Hashtable storing the actions or null if none is usedmnemonic - the mnemonic to be used for the elementtoolBar - the JToolBar to which the element is addedmenu - the JMenu to which the element is addedtranslator - the Translator used for I18N
public java.lang.Object[] getArguments()
public javax.swing.Icon getIcon()
public java.lang.String getLabel()
public java.lang.String getMethodToCall()
public java.lang.Object getSmallIcon()
public java.lang.Object getTargetObject()
public java.lang.String getToolTipText()
public Translator getTranslator()
public void setArguments(java.lang.Object[] args)
args - the arguments for the method callpublic void setIcon(javax.swing.Icon theIcon)
theIcon - the icon to usepublic void setIcon(java.lang.String iconName)
iconName - the name of the icon to usepublic void setLabel(java.lang.String label)
label - the new label to usepublic void setMethod(java.lang.String methodName)
methodName - the name of the method to invokepublic void setObject(java.lang.Object target)
target - the object whose method is to be called
public void setTargetCall(java.lang.String methodName,
java.lang.Object target)
methodName - the name of the method to invoketarget - the object whose method is to be calledpublic void setToolTipText(java.lang.String toolTipText)
toolTipText - the text displayed on the tool tip of this Action elementpublic void actionPerformed(java.awt.event.ActionEvent actionEvent)
actionEvent - the ActionEvent objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||