|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.beans.FeatureDescriptor
com.esri.adf.web.data.tasks.ButtonDescriptor
com.esri.adf.web.data.tasks.TaskToolDescriptor
public class TaskToolDescriptor
The TaskToolDescriptor
class provides metadata for the task tools.
The tool methods executed on the server take MapEvent
as its argument. Since tools also have a corresponding
client-side behavior, the clientAction
is an important property which specifies the JavaScript method to be
executed on the client for this tool.
This is the out of box implementation of the TaskToolDescriptorModel
interface and supports the rendering of
tool buttons as text-only buttons, image-only buttons and image-and-text buttons.
Field Summary | |
---|---|
protected String |
clientAction
The name of the JavaScript method to be executed on the client for this tool |
protected String |
cursor
The cursor to be displayed on the map control when this tool is active. |
protected String |
lineColor
The color of the line drawn when this tool is used on the map control. |
protected int |
lineWidth
The width of the line drawn when this tool is used on the map control. |
protected Method |
toolActionMethod
The server-side method that processes this tool. |
Fields inherited from class com.esri.adf.web.data.tasks.ButtonDescriptor |
---|
defaultImage, disabled, disabledImage, hoverImage, IMAGE_RENDERER_TYPE, IMAGEANDTEXT_RENDERER_TYPE, justBeenDisabled, rendererType, selectedImage, showLoadingImage, style, styleClass, TEXT_RENDERER_TYPE, toolTip, VALIDATE_ALL_PARAMS, VALIDATE_NONE_PARAMS |
Fields inherited from interface com.esri.adf.web.data.tasks.TaskToolDescriptorModel |
---|
TOOL_NAME |
Constructor Summary | |
---|---|
TaskToolDescriptor(Class taskClass,
String toolActionMethodName,
String displayName,
String clientAction)
Creates a new TaskToolDescriptor for the given server-side toolActionMethodName and
JavaScript clientAction method with a text button renderer. |
Method Summary | |
---|---|
ToolItem |
createToolItem(String taskControlId)
Creates a ToolItem object for this tool. |
Element |
generateXML(Object task)
Generates the XML content for this tool. |
Map<String,Object> |
getAttributes()
Returns the name-value attributes of this tool |
String |
getClientAction()
Returns the name of the JavaScript method to be executed on the client for this tool |
String |
getCursor()
Returns the cursor to be displayed on the map control when this tool is active. |
String |
getLineColor()
Returns the color of the line drawn when this tool is used on the map control. |
int |
getLineWidth()
Returns the width of the line drawn when this tool is used on the map control |
String |
getName()
Returns the name of the tool method. |
Method |
getToolActionMethod()
Returns the server-side method that processes the tool |
Object |
processToolAction(Object task,
MapEvent event)
Calls the tool method on the specified task by passing it the MapEvent object. |
void |
setAttributes(Map<String,?> attributes)
Sets the name-value attributes of this tool |
void |
setClientAction(String clientAction)
Sets the name of the JavaScript method to be executed on the client for this tool |
void |
setCursor(String cursor)
Sets the cursor to be displayed on the map control when this tool is active. |
void |
setLineColor(String lineColor)
Sets the color of the line drawn when this tool is used on the map control. |
void |
setLineWidth(int lineWidth)
Sets the width of the line drawn when this tool is used on the map control |
String |
toString()
|
Methods inherited from class com.esri.adf.web.data.tasks.ButtonDescriptor |
---|
generateButtonXML, getDefaultImage, getDisabledImage, getHoverImage, getParamsToValidate, getRendererType, getSelectedImage, getStyle, getStyleClass, getToolTip, isDisabled, isShowLoadingImage, setDefaultImage, setDisabled, setDisabledImage, setHoverImage, setParamsToValidate, setRendererType, setSelectedImage, setShowLoadingImage, setStyle, setStyleClass, setToolTip |
Methods inherited from class java.beans.FeatureDescriptor |
---|
attributeNames, getDisplayName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.esri.adf.web.data.tasks.TaskToolDescriptorModel |
---|
getDisplayName, getRendererType, isHidden |
Field Detail |
---|
protected transient Method toolActionMethod
protected String clientAction
protected String cursor
protected String lineColor
protected int lineWidth
Constructor Detail |
---|
public TaskToolDescriptor(Class taskClass, String toolActionMethodName, String displayName, String clientAction)
TaskToolDescriptor
for the given server-side toolActionMethodName
and
JavaScript clientAction
method with a text button renderer.
taskClass
- the task Class
toolActionMethodName
- the name of the server-side tool methoddisplayName
- the display text for the tool buttonclientAction
- the name of the client-side JavaScript methodMethod Detail |
---|
public ToolItem createToolItem(String taskControlId)
TaskToolDescriptorModel
Creates a ToolItem
object for this tool.
This method is called by the task control and the ToolItem
created by this method is
eventually used to generate the markup / UI for the tool.
createToolItem
in interface TaskToolDescriptorModel
taskControlId
- the ID of the task control which contains this tool
ToolItem
object for this toolpublic String getName()
TaskToolDescriptorModel
Returns the name of the tool method.
Note that action methods take MapEvent
as its argument.
getName
in interface TaskToolDescriptorModel
getName
in class FeatureDescriptor
public Method getToolActionMethod()
public Object processToolAction(Object task, MapEvent event)
TaskToolDescriptorModel
task
by passing it the MapEvent
object.
processToolAction
in interface TaskToolDescriptorModel
task
- the task object on which the tool method will be invokedevent
- the MapEvent
method which will be passed as an argument to the tool method
public Element generateXML(Object task)
TaskToolDescriptorModel
Generates the XML content for this tool. This XML is then transformed by the XSL used by the task control to generate the appropriate markup.
Note that if you implement this method and generate custom XML,
you'll also need to provide the XSL that transforms this XML into the appropriate markup.
The XSL file that the task control should use can be specified by using the xslFile
attribute of the task
tag.
generateXML
in interface TaskToolDescriptorModel
task
- the task object
Element
public Map<String,Object> getAttributes()
public String getClientAction()
public String getCursor()
public int getLineWidth()
public String getLineColor()
public void setAttributes(Map<String,?> attributes)
attributes
- the name-value attributes of this toolpublic void setClientAction(String clientAction)
clientAction
- the name of the JavaScript method to be executed on the client for this toolpublic void setCursor(String cursor)
cursor
- the cursor to be displayed on the map control when this tool is active. e.g. crosshairpublic void setLineWidth(int lineWidth)
lineWidth
- the width of the line drawn when this tool is used on the map controlpublic void setLineColor(String lineColor)
lineColor
- the color of the line drawn when this tool is used on the map controlpublic String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |