com.esri.adf.web.data.tasks
Class ButtonDescriptor

java.lang.Object
  extended by java.beans.FeatureDescriptor
      extended by com.esri.adf.web.data.tasks.ButtonDescriptor
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TaskActionDescriptor, TaskToolDescriptor

public class ButtonDescriptor
extends FeatureDescriptor
implements Serializable

The ButtonDescriptor is an intermediary class and its primary purpose is to serve as a super-class with basic implementations for some methods for the TaskActionDescriptor and TaskToolDescriptor classes.

See Also:
Serialized Form

Field Summary
protected  String defaultImage
          The default image URL for the button.
protected  boolean disabled
          If true, the button will be disabled in the task UI
protected  String disabledImage
          The disabled image URL for the button.
protected  String hoverImage
          The hover image URL for the button.
static String IMAGE_RENDERER_TYPE
          The image-only renderer type.
static String IMAGEANDTEXT_RENDERER_TYPE
          The image-and-text renderer type.
protected  boolean justBeenDisabled
           
protected  String rendererType
          The renderer type of this parameter.
protected  String selectedImage
          The selected image URL for the button.
protected  boolean showLoadingImage
          If true, a loading image will be displayed while the action / tool is being processed.
protected  String style
          The CSS style to be applied to the button.
protected  String styleClass
          The CSS style class to be applied to the button.
static String TEXT_RENDERER_TYPE
          The text-only renderer type.
protected  String toolTip
          The tool tip text for the button.
static List<TaskParamDescriptor> VALIDATE_ALL_PARAMS
          An option that indicates that all Task parameters must pass validation before this button is invoked.
static List<TaskParamDescriptor> VALIDATE_NONE_PARAMS
          An option that indicates that no Task parameters must pass validation before this button is invoked.
 
Constructor Summary
ButtonDescriptor()
           
 
Method Summary
protected  void generateButtonXML(Element element)
           Generates the XML content for this button.
 String getDefaultImage()
          Returns the default image URL for the button
 String getDisabledImage()
          Returns the disabled image URL for the button
 String getHoverImage()
          Returns the hover image URL for the button
 List<TaskParamDescriptor> getParamsToValidate()
          Returns the list of Task parameters that must pass validation when this button is invoked.
 String getRendererType()
          Returns the renderer type of this parameter
 String getSelectedImage()
          Returns the selected image URL for the button
 String getStyle()
          Returns the CSS style to be applied to the button
 String getStyleClass()
          Returns the CSS style class to be applied to the button
 String getToolTip()
          Returns the tool tip text for the button
 boolean isDisabled()
          If true, the button will be disabled in the task UI
 boolean isShowLoadingImage()
          If true, a loading image will be displayed while the action / tool is being processed
 void setDefaultImage(String defaultImage)
          Sets the default image URL for the button
 void setDisabled(boolean disabled)
          If set to true, the button will be disabled in the task UI
 void setDisabledImage(String disabledImage)
          Returns the disabled image URL for the button
 void setHoverImage(String hoverImage)
          Sets the hover image URL for the button
 void setParamsToValidate(List<? extends TaskParamDescriptor> paramToValidate)
          Sets the list of Task parameters that must pass validation when this button is invoked.
 void setRendererType(String rendererType)
          Sets the renderer type of this parameter
 void setSelectedImage(String selectedImage)
          Sets the selected image URL for the button
 void setShowLoadingImage(boolean showLoadingImage)
          If set to true, a loading image will be displayed while the action / tool is being processed
 void setStyle(String style)
          Sets the CSS style to be applied to the button
 void setStyleClass(String styleClass)
          Sets the CSS style class to be applied to the button
 void setToolTip(String toolTip)
          Sets the tooltip text for the button
 
Methods inherited from class java.beans.FeatureDescriptor
attributeNames, getDisplayName, getName, 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, toString, wait, wait, wait
 

Field Detail

IMAGEANDTEXT_RENDERER_TYPE

public static final String IMAGEANDTEXT_RENDERER_TYPE
The image-and-text renderer type. Buttons with this renderer type are displayed as image and text combined.

See Also:
Constant Field Values

TEXT_RENDERER_TYPE

public static final String TEXT_RENDERER_TYPE
The text-only renderer type. Buttons with this renderer type are displayed as text.

See Also:
Constant Field Values

IMAGE_RENDERER_TYPE

public static final String IMAGE_RENDERER_TYPE
The image-only renderer type. Buttons with this renderer type are displayed as images.

See Also:
Constant Field Values

VALIDATE_ALL_PARAMS

public static final List<TaskParamDescriptor> VALIDATE_ALL_PARAMS
An option that indicates that all Task parameters must pass validation before this button is invoked.

See Also:
setParamsToValidate(List)

VALIDATE_NONE_PARAMS

public static final List<TaskParamDescriptor> VALIDATE_NONE_PARAMS
An option that indicates that no Task parameters must pass validation before this button is invoked.

See Also:
setParamsToValidate(List)

style

protected String style
The CSS style to be applied to the button.


styleClass

protected String styleClass
The CSS style class to be applied to the button.


toolTip

protected String toolTip
The tool tip text for the button.


defaultImage

protected String defaultImage
The default image URL for the button. Note that this property is applicable only for image renderers


hoverImage

protected String hoverImage
The hover image URL for the button. Note that this property is applicable only for image renderers


selectedImage

protected String selectedImage
The selected image URL for the button. Note that this property is applicable only for image renderers


disabledImage

protected String disabledImage
The disabled image URL for the button. Note that this property is applicable only for image renderers


disabled

protected boolean disabled
If true, the button will be disabled in the task UI


justBeenDisabled

protected boolean justBeenDisabled

showLoadingImage

protected boolean showLoadingImage
If true, a loading image will be displayed while the action / tool is being processed.


rendererType

protected String rendererType
The renderer type of this parameter. The default renderer is TEXT_RENDERER_TYPE

Constructor Detail

ButtonDescriptor

public ButtonDescriptor()
Method Detail

generateButtonXML

protected void generateButtonXML(Element element)

Generates the XML content for this button. Sub-classes can call this method to generate the basic XML content for the button.

Parameters:
element - the XML Element for the content

getStyle

public String getStyle()
Returns the CSS style to be applied to the button

Returns:
the CSS style to be applied to the button

setStyle

public void setStyle(String style)
Sets the CSS style to be applied to the button

Parameters:
style - the CSS style to be applied to the button

getStyleClass

public String getStyleClass()
Returns the CSS style class to be applied to the button

Returns:
the CSS style class to be applied to the button

setStyleClass

public void setStyleClass(String styleClass)
Sets the CSS style class to be applied to the button

Parameters:
styleClass - the CSS style class to be applied to the button

getToolTip

public String getToolTip()
Returns the tool tip text for the button

Returns:
the tool tip text for the button

setToolTip

public void setToolTip(String toolTip)
Sets the tooltip text for the button

Parameters:
toolTip - the tooltip text for the button

getDefaultImage

public String getDefaultImage()
Returns the default image URL for the button

Returns:
the default image URL for the button

setDefaultImage

public void setDefaultImage(String defaultImage)
Sets the default image URL for the button

Parameters:
defaultImage - the default image URL for the button

getHoverImage

public String getHoverImage()
Returns the hover image URL for the button

Returns:
the hover image URL for the button

setHoverImage

public void setHoverImage(String hoverImage)
Sets the hover image URL for the button

Parameters:
hoverImage - the hover image URL for the button

getSelectedImage

public String getSelectedImage()
Returns the selected image URL for the button

Returns:
the selected image URL for the button

setSelectedImage

public void setSelectedImage(String selectedImage)
Sets the selected image URL for the button

Parameters:
selectedImage - the selected image URL for the button

getDisabledImage

public String getDisabledImage()
Returns the disabled image URL for the button

Returns:
the disabled image URL for the button

setDisabledImage

public void setDisabledImage(String disabledImage)
Returns the disabled image URL for the button

Parameters:
disabledImage - the disabled image URL for the button

isDisabled

public boolean isDisabled()
If true, the button will be disabled in the task UI

Returns:
if true, the button will be disabled in the task UI

setDisabled

public void setDisabled(boolean disabled)
If set to true, the button will be disabled in the task UI

Parameters:
disabled - if true, the button will be disabled in the task UI

isShowLoadingImage

public boolean isShowLoadingImage()
If true, a loading image will be displayed while the action / tool is being processed

Returns:
if true, a loading image will be displayed while the action / tool is being processed

setShowLoadingImage

public void setShowLoadingImage(boolean showLoadingImage)
If set to true, a loading image will be displayed while the action / tool is being processed

Parameters:
showLoadingImage - if true, a loading image will be displayed while the action / tool is being processed

getRendererType

public String getRendererType()
Returns the renderer type of this parameter

Returns:
the renderer type of this parameter

setRendererType

public void setRendererType(String rendererType)
Sets the renderer type of this parameter

Parameters:
rendererType - the renderer type of this parameter

getParamsToValidate

public List<TaskParamDescriptor> getParamsToValidate()
Returns the list of Task parameters that must pass validation when this button is invoked. The AJAX request will not be submitted if any of the Task parameters fail validation. Default value is VALIDATE_ALL_PARAMS which indicates that all Task parameters must pass validation.

Returns:
the list of parameters to be validated.

setParamsToValidate

public void setParamsToValidate(List<? extends TaskParamDescriptor> paramToValidate)
Sets the list of Task parameters that must pass validation when this button is invoked. The AJAX request will not be submitted if any of the Task parameters fail validation. Default value is VALIDATE_ALL_PARAMS which indicates that all Task parameters must pass validation. You can control which parameters must pass validation by specifying list of TaskParamDescriptor objects. Alternatively, you can bypass validation altogether by using VALIDATE_NONE_PARAMS.

    TaskActionDescriptor actionDescriptor = ...;
    //validate specified parameters(s)
    List<TaskParamDescriptor> params = ...;
    actionDescriptor.setParamsToValidate(params);
    
    //or, bypass validation
    actionDescriptor.setParamsToValidate(ButtonDescriptor.VALIDATE_NONE_PARAMS);
 
 

Parameters:
paramToValidate - the list of parameters to be validated.