com.pietschy.command.annotation.impl
Class ReflectionSwingWorkerCommand
java.lang.Object
com.pietschy.command.Command
com.pietschy.command.ActionCommand
com.pietschy.command.worker.SwingWorkerCommand<java.lang.Object,java.lang.Object>
com.pietschy.command.annotation.impl.ReflectionSwingWorkerCommand
- All Implemented Interfaces:
- ActionCommandExecutor, Bindable, Identifiable
public class ReflectionSwingWorkerCommand
- extends SwingWorkerCommand<java.lang.Object,java.lang.Object>
SwingWorkerCommand implementation that uses reflection to invoke a method
on another class.
|
Constructor Summary |
ReflectionSwingWorkerCommand(java.lang.String id,
java.lang.Object target,
java.lang.reflect.Method method)
Creates a new instance. |
| Methods inherited from class com.pietschy.command.worker.SwingWorkerCommand |
beforeStarting, cancel, cancelled, done, failed, finished, get, get, getGlassPaneStrategy, getProgress, getState, getWorkingMode, handleExecute, isActivateGlassPane, isCancelled, isDisableWhileWorking, isDone, isEnabled, isWorking, postExecute, process, publish, setActivateGlassPane, setDisableWhileWorking, setProgress, setWorkingMode |
| Methods inherited from class com.pietschy.command.ActionCommand |
addActionCommandListener, addInterceptor, bindToContainer, createButton, createButton, createButton, createButton, createMenuItem, createMenuItem, createMenuItem, createMenuItem, doButtonAttachments, doButtonDetachments, execute, execute, getActionAdapter, getActionAdapter, getActionEvent, getInvoker, getInvokerWindow, getModifiers, getParameter, getParameter, getParameters, installShortCut, installShortCut, preExecute, putParameter, putParameters, removeActionCommandListener, removeInterceptor, requestDefaultIn, unbindFromContainer, uninstallShortCut, uninstallShortCut |
| Methods inherited from class com.pietschy.command.Command |
addContainerPropertyListener, addFace, addHoverListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, attach, bind, bind, bind, buttonIterator, configureAppearance, configureAppearances, configureButtonAppearances, configureButtonStates, configureButtonStates, createButton, createButton, createButton, createButton, createComponent, createMenuItem, createMenuItem, createMenuItem, createMenuItem, detach, faceExists, findBestFace, fireHoverEnded, fireHoverStarted, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlternativeFaceContexts, getButtonFactory, getButtonIn, getCommandContainer, getContainerProperty, getDefaultFace, getDefaultFace, getFace, getFace, getId, getMenuFactory, getProperty, getProperty, getPropertyNames, getToolbarFactory, isAnonymous, isAttachedTo, isBound, isVisible, loadConfiguration, notifyCommandContainerHierarchyChanged, putProperties, putProperty, rebind, removeContainerPropertyListener, removeHoverListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, requestFocusIn, setButtonFactory, setEnabled, setMenuFactory, setToolbarFactory, setVisible, toString, unbind, validateId |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ReflectionSwingWorkerCommand
public ReflectionSwingWorkerCommand(java.lang.String id,
java.lang.Object target,
java.lang.reflect.Method method)
- Creates a new instance.
- Parameters:
id - the command id.target - the target object to invoke the method on.method - the target method.
doInBackground
protected java.lang.Object doInBackground()
throws java.lang.Exception
- Invokes the target method.
- Specified by:
doInBackground in class SwingWorkerCommand<java.lang.Object,java.lang.Object>
- Returns:
- the result of the target method.
- Throws:
java.lang.Exception - if the method call failed.
getArgs
protected java.lang.Object[] getArgs()
- Gets the argument list for the method invocation. This method will return
the result of the current
ArgumentProvider.
- Returns:
- the arguments provided by the current
ArgumentProvider or null
if non provider has been configured. - See Also:
setArgumentProvider(ArgumentProvider)
getTarget
public java.lang.Object getTarget()
- Gets the target object.
- Returns:
- the target object.
getMethod
public java.lang.reflect.Method getMethod()
- Gets the target method.
- Returns:
- the target method.
getArgumentProvider
public ArgumentProvider getArgumentProvider()
- Gets the current
ArgumentProvider.
- Returns:
- the current
ArgumentProvider.
setArgumentProvider
public void setArgumentProvider(ArgumentProvider argumentProvider)
- Sets the current
ArgumentProvider.
- Parameters:
argumentProvider - the new ArgumentProvider.
Copyright © 2006 - 2007 Andrew Pietsch