|
|||||||||
| 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 java.lang.String |
clientAction
The name of the JavaScript method to be executed on the client for this tool |
protected java.lang.String |
cursor
The cursor to be displayed on the map control when this tool is active. |
protected java.lang.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 java.lang.reflect.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, rendererType, selectedImage, showLoadingImage, style, styleClass, TEXT_RENDERER_TYPE, toolTip |
| Fields inherited from interface com.esri.adf.web.data.tasks.TaskToolDescriptorModel |
|---|
TOOL_NAME |
| Constructor Summary | |
|---|---|
TaskToolDescriptor(java.lang.Class taskClass,
java.lang.String toolActionMethodName,
java.lang.String displayName,
java.lang.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(java.lang.String taskControlId)
Creates a ToolItem object for this tool. |
org.w3c.dom.Element |
generateXML(java.lang.Object task)
Generates the XML content for this tool. |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns the name-value attributes of this tool |
java.lang.String |
getClientAction()
Returns the name of the JavaScript method to be executed on the client for this tool |
java.lang.String |
getCursor()
Returns the cursor to be displayed on the map control when this tool is active. |
java.lang.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 |
java.lang.String |
getName()
Returns the name of the tool method. |
java.lang.reflect.Method |
getToolActionMethod()
Returns the server-side method that processes the tool |
java.lang.Object |
processToolAction(java.lang.Object task,
MapEvent event)
Calls the tool method on the specified task by passing it the MapEvent object. |
void |
setAttributes(java.util.Map<java.lang.String,?> attributes)
Sets the name-value attributes of this tool |
void |
setClientAction(java.lang.String clientAction)
Sets the name of the JavaScript method to be executed on the client for this tool |
void |
setCursor(java.lang.String cursor)
Sets the cursor to be displayed on the map control when this tool is active. |
void |
setLineColor(java.lang.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 |
java.lang.String |
toString()
|
| Methods inherited from class com.esri.adf.web.data.tasks.ButtonDescriptor |
|---|
generateButtonXML, getDefaultImage, getDisabledImage, getHoverImage, getRendererType, getSelectedImage, getStyle, getStyleClass, getToolTip, isDisabled, isShowLoadingImage, setDefaultImage, setDisabled, setDisabledImage, setHoverImage, 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 java.lang.reflect.Method toolActionMethod
protected java.lang.String clientAction
protected java.lang.String cursor
protected java.lang.String lineColor
protected int lineWidth
| Constructor Detail |
|---|
public TaskToolDescriptor(java.lang.Class taskClass,
java.lang.String toolActionMethodName,
java.lang.String displayName,
java.lang.String clientAction)
TaskToolDescriptor for the given server-side toolActionMethodName and JavaScript clientAction method
with a text button renderer.
taskClass - the task ClasstoolActionMethodName - the name of the server-side tool methoddisplayName - the display text for the tool buttonclientAction - the name of the client-side JavaScript method| Method Detail |
|---|
public ToolItem createToolItem(java.lang.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 TaskToolDescriptorModeltaskControlId - the ID of the task control which contains this tool
ToolItem object for this toolpublic java.lang.String getName()
TaskToolDescriptorModelReturns the name of the tool method.
Note that action methods take MapEvent as its argument.
getName in interface TaskToolDescriptorModelgetName in class java.beans.FeatureDescriptorpublic java.lang.reflect.Method getToolActionMethod()
public java.lang.Object processToolAction(java.lang.Object task,
MapEvent event)
TaskToolDescriptorModeltask by passing it the MapEvent object.
processToolAction in interface TaskToolDescriptorModeltask - 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 org.w3c.dom.Element generateXML(java.lang.Object task)
TaskToolDescriptorModelGenerates 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 TaskToolDescriptorModeltask - the task object
Elementpublic java.util.Map<java.lang.String,java.lang.Object> getAttributes()
public java.lang.String getClientAction()
public java.lang.String getCursor()
public int getLineWidth()
public java.lang.String getLineColor()
public void setAttributes(java.util.Map<java.lang.String,?> attributes)
attributes - the name-value attributes of this toolpublic void setClientAction(java.lang.String clientAction)
clientAction - the name of the JavaScript method to be executed on the client for this toolpublic void setCursor(java.lang.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(java.lang.String lineColor)
lineColor - the color of the line drawn when this tool is used on the map controlpublic 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 | ||||||||