<action method="..." args="...">
<action method="..." args="component_id[,...]" class="...">
An Action reproduces a user semantic action (such as a mouse click, menu selection, or drag/drop action) on a particular component. The id of the component being operated on must be the first argument, and the class of that component must be identified by the class tag if the action is not provided by the base ComponentTester class.Note that the method name is the name of the actionXXX method, e.g. to click a button (actionClick on AbstractButtonTester), the XML would appear thus:
<action method="actionClick" args="My Button" class=javax.swing.AbstractButton>
Note that if the first argument is a Component, the class tag is required. Note also that the specified class is the tested class, not the target class for the method invocation. The target class for the method invocation is always a ComponentTester-derived class.
Action
class defines a new action that the main driver is capable of executing. Each instance of Action
is inserted into a hash map in the main class, with the key being its name. For example, the action to simulate a program is inserted into this hash map with the key "simulate", and an instance of avrora.actions.SimulateAction
.
Action
is java code that can be mounted to a specific url and that will be executed if these conditions hold: Once a request hits the mountpoint of an action, the action is then called in this order:
Note: A class that implements the Action
interface must provide a default constructor (no arguments), since action handlers are created using reflection.
Action methods are invoked as the XML file is parsed.
This class is largely inspired from the relevant class in the commons-digester project of the Apache Software Foundation. @author Craig McClanahan @author Christopher Lenz @author Ceki Gülcü
An {@link Action} is the abstraction of a user's interaction with a Tabris UI. Actions can have different visualrepresentations rendered differently by each platform. As it is with {@link Page} types they need to be registeredwith their type and will be created by the framework. Therefore an implementation needs to provide a no-argument constructor.
During runtime you can influence an {@link Action} by changing it's visibility or it's enablement using the{@link ActionManager}.
@see ActionConfiguration @see ActionManager @since 0.11action
@author Yann Cébron
execute()
method. However, as of XWork 1.1, this is not required and is only here to assist users. You are free to create POJOs that honor the same contract defined by this interface without actually implementing the interface.
init()
. Exactly one instance will be created per action configuration.
@author Christoph Beck
This interface is likely the most important abstraction in WEB4J. Almost every feature implemented by the programmer will need an implementation of this interface.
Typically, one of the ActionXXX abstract base classes are used to build implementations of this interface.
{@link Action}s added to a model object creates additional URL subspace under the parent model object, through which it can interact with users. {@link Action}s are also capable of exposing themselves to the left hand side menu of a {@link ModelObject} (for example to {@link Project}, {@link Build}, and etc.)
Some actions use the latter without the former (for example, to add a link to an external website), while others do the former without the latter (for example, to just draw some graphs in floatingBox.jelly), and still some others do both.
If an action has a view named floatingBox.jelly, it will be displayed as a floating box on the top page of the target {@link ModelObject}. (For example, this is how the JUnit test result trend shows up in the project top page. See {@link TestResultProjectAction}.
On the target {@link ModelObject} page, actions are rendered as an item in the side panelby the "/lib/hudson:actions" jelly tag, but you can override this for your action by writing {@code action.jelly}. See the "actions" tag for what the default handling is and tweak from there. One of the use cases of this is to show nested actions, like where Jenkins show the option to wipe out the workspace inside the workspace link:
<l:task icon="images/24x24/folder.gif" href="${url}/ws/" title="${%Workspace}"> <l:task icon="images/24x24/folder-delete.gif" href="${url}/wipeOutWorkspace" title="${%Wipe Out Workspace}" /> </l:task>
Actions are often persisted as a part of {@link Actionable}(for example with {@link Build}) via XStream. In some other cases, {@link Action}s are transient and not persisted (such as when it's used with {@link Job}). @author Kohsuke Kawaguchi
action
operator of the FIPA SL0 action.
@author Giovanni Caire - TILAB
Action
class provides a simple facility for creating and deploying actions in a UI-type setting. It uses Java's Reflection API to store a method call, which is performed when the performAction()
method is called on the Action object. Generally, you probably shouldn't be creating your own Action methods unless you're extending some of the built-in Menu stuff. Instead, an Action should be created via a call to a MenuItem's create()
or add()
method.
Shortcuts (which are a simple facility for keyboard shortcuts) generally contain a reference to an Action object, which is called when the keyboard shortcut is pressed.
TODO: Split the current Action
class into an interface and a default implementation. Similar to Swing's Action class, an Action
object should simply be a guarantee that the object has an actionPerformed
method. Then, the default implementation, MethodAction
, would have the functionality that is currently within the Action
class, and we could create other, new types of actions: ThreadAction
, CalculationAction
, ListenableAction
... I'm out of ideas, but come up with some yourself!
@author Gregory Jordan
@see org.andrewberman.ui.MenuItem
@see org.andrewberman.ui.Shortcut
@see org.andrewberman.ui.menu.MenuItem
Action
...
Action
defines the final state of a MailAdapter
instance.
An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request. The controller (RequestProcessor) will select an appropriate Action for each request, create an instance (if necessary), and call the execute
method.
Actions must be programmed in a thread-safe manner, because the controller will share the same instance for multiple simultaneous requests. This means you should design with the following items in mind:
When an Action
instance is first created, the controller will call setServlet
with a non-null argument to identify the servlet instance to which this Action is attached. When the servlet is to be shut down (or restarted), the setServlet
method will be called with a null
argument, which can be used to clean up any allocated resources in use by this Action.
Action
represents some default action which should occur when a rule matches a node in the XSLT processing model.
This api is experimental and thus the classes and the interfaces returned are subject to change.
Subclasses must implement the IAction.run
method to carry out the action's semantics.
An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request. The controller (RequestProcessor) will select an appropriate Action for each request, create an instance (if necessary), and call the execute
method.
Actions must be programmed in a thread-safe manner, because the controller will share the same instance for multiple simultaneous requests. This means you should design with the following items in mind:
When an Action
instance is first created, the controller will call setServlet
with a non-null argument to identify the servlet instance to which this Action is attached. When the servlet is to be shut down (or restarted), the setServlet
method will be called with a null
argument, which can be used to clean up any allocated resources in use by this Action.
This interface exists only to define the API for {@code Actions}. It is not intended to be implemented by clients. @author georgopoulos.georgios(at)gmail.com @see CommandAction
Actions are typically referred to by class, so are not designed to be stateful or mutable. @author jkaplan
ActionProducer
instance.
@see org.netbeans.jemmy.ActionProducer
@author Alexandre Iline (alexandre.iline@sun.com)
Action
element behaves
To implement a new Action: - Create a Component Service that extend AbstractAction - Create a static method in there that creates an ActionConfig for the new Action. This method defines the "interface" for this action: What data does the execute method need in addition to the data {@link CommandTransformation#getInputCommand()}? - Implement the execute method: Read the attributes created with the static factory method, execute the action.@author Vladimir Tihomirov
Actions typically delegate down to the application (or service) layer to perform business operations. They often retrieve data to support response rendering. They act as a bridge between a SWF web-tier and your middle-tier business logic layer.
When an action completes execution it signals a result event describing the outcome of that execution (for example, "success", "error", "yes", "no", "tryAgain", etc). In addition to providing a logical outcome the flow can respond to, a result event may have payload associated with it, for example a "success" return value or an "error" error code. The result event is typically used as grounds for a state transition out of the current state of the calling Flow.
Action implementations are often application-scoped singletons instantiated and managed by a web-tier Spring application context to take advantage of Spring's externalized configuration and dependency injection capabilities (which is a form of Inversion of Control [IoC]). Actions may also be stateful prototypes, storing conversational state as instance variables. Action instance definitions may also be locally scoped to a specific flow definition (see use of the "import" element of the root XML flow definition element.)
Note: Actions are directly instantiatable for use in a standalone test environment and can be parameterized with mocks or stubs, as they are simple POJOs. Action proxies may also be generated at runtime for delegating to POJO business operations that have no dependency on the Spring Web Flow API.
Note: if an Action is a singleton managed in application scope, take care not to store and/or modify caller-specific state in a unsafe manner. The Action {@link #execute(RequestContext)} method runs in an independently executingthread on each invocation so make sure you deal only with local data or internal, thread-safe services.
Note: an Action is not a controller like a Spring MVC controller or a Struts action is a controller. Flow actions are commands. Such commands do not select views, they execute arbitrary behavioral logic and then return an logical execution result. The flow that invokes an Action is responsible for responding to the execution result to decide what to do next. In Spring Web Flow, the flow is the controller. @author Keith Donald @author Erwin Vervaet
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|