com.esri.adf.web.faces.event
Interface MapToolAction

All Superinterfaces:
Serializable, ToolAction
All Known Implementing Classes:
ButtonControl, PanToolAction, ZoomInToolAction, ZoomOutToolAction

public interface MapToolAction
extends ToolAction

The MapToolAction interface represents the server tool actions which are invoked by the MapControl

Out of the box tool actions such as ZoomInToolAction as well as custom map tool actions implement this interface. The MapControl creates the MapEvent and passes that to the execute(MapEvent) method of the tool. The business logic for the tool should be implemented in this method according to the event.

Tools get important information from the MapEvent such as the associated WebContext, the ClientActionArgs and a WebGeometry representing the shape drawn by the client on the screen. Please refer to the documentation for the MapEvent for more details.

A tool is expressed on a JSP page with the tool tag as such:

 <ags:tool serverAction="com.esri.adf.web.faces.event.ZoomInToolAction" ... />
 

While implementing a MapToolAction is one way of implementing tools, users can also designate any method in a Java bean with a specific signature as a tool too. Any method with the signature:

 public void anyMethodName(MapEvent event)
 

is also a first-class tool. Users can express that on a JSP tag again with the tool tag as such:

 <ags:tool serverMethod="#{bean.anyMethodName}" ... />
 

The MapControl will invoke this method just like any other tool passing it the appropriate event.

Tasks can also contain tools. For more information see documentation for the com.esri.adf.web.data.tasks package.


Method Summary
 void execute(MapEvent event)
           The method called by the MapControl when the client invokes this tool action.
 

Method Detail

execute

void execute(MapEvent event)
             throws Exception

The method called by the MapControl when the client invokes this tool action.

Tools get important information from the MapEvent such as the associated WebContext, the ClientActionArgs and a WebGeometry representing the shape drawn by the client on the screen. Please refer to the documentation for the MapEvent for more details.

Parameters:
event - the MapEvent to execute this tool
Throws:
Exception - if an error happens while executing the tool. The MapControl aborts processing the current event when this happens.