com.smartgwt.client.widgets.form.fields
Class ButtonItem

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.core.RefDataClass
              extended by com.smartgwt.client.widgets.form.fields.FormItem
                  extended by com.smartgwt.client.widgets.form.fields.CanvasItem
                      extended by com.smartgwt.client.widgets.form.fields.ButtonItem
All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasPickerIconClickHandlers, HasShowValueHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers
Direct Known Subclasses:
CancelItem, ResetItem, SubmitItem

public class ButtonItem
extends CanvasItem
implements HasClickHandlers

FormItem for adding a Button to a form.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
ButtonItem()
           
ButtonItem(JavaScriptObject jsObj)
           
ButtonItem(String name)
           
ButtonItem(String name, String title)
           
 
Method Summary
 HandlerRegistration addClickHandler(ClickHandler handler)
          Add a click handler.
 Boolean getAutoFit()
          Should the button auto fit to its title.
 String getBaseStyle()
          Optional baseStyle will be applied to the button.
 Canvas getCanvas()
          The canvas that will be displayed inside this item.
 Boolean getEndRow()
          These items are in a row by themselves by default
 String getIcon()
          Optional icon image to display on the button for this item.
static ButtonItem getOrCreateRef(JavaScriptObject jsObj)
           
 Boolean getShowTitle()
          Buttons do not show a title by default.
 Boolean getStartRow()
          These items are in a row by themselves by default
 void setAutoFit(Boolean autoFit)
          Should the button auto fit to its title.
 void setBaseStyle(String baseStyle)
          Optional baseStyle will be applied to the button.
 void setButtonProperties(Button buttonProperties)
          Custom Properties to apply to the button item.
 void setEndRow(Boolean endRow)
          These items are in a row by themselves by default
 void setIcon(String icon)
          Optional icon image to display on the button for this item.
 void setJavaScriptObject(JavaScriptObject jsObj)
           
 void setShowTitle(Boolean showTitle)
          Buttons do not show a title by default.
 void setStartRow(Boolean startRow)
          These items are in a row by themselves by default
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.CanvasItem
addShowValueHandler, createCanvas, getApplyPromptToCanvas, getAutoDestroy, getEditCriteriaInInnerForm, getOverflow, getPrompt, getShouldSaveValue, hasAdvancedCriteria, setApplyPromptToCanvas, setAutoDestroy, setCanEditCriterionPredicate, setCanvas, setCriterionGetter, setCriterionSetter, setEditCriteriaInInnerForm, setOverflow, setPrompt, setShouldSaveValue, setupCanvasConstructor, storeValue, storeValue, storeValue
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPickerIconClickHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, blurItem, canEditCriterion, clearValue, convertToFormItemArray, disable, enable, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getBrowserSpellCheck, getCanEdit, getCanFocus, getCellHeight, getCellStyle, getClassName, getConfig, getContainerWidget, getCriteriaField, getCriterion, getCriterion, getDataPath, getDateFormatter, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDisabled, getDisableIconsOnReadOnly, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEmptyDisplayValue, getEmptyValueIcon, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getFetchMissingValues, getFieldName, getFilterLocally, getForm, getFullDataPath, getGlobalTabIndex, getHeight, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverHeight, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getIcon, getIconHeight, getIconPageRect, getIconPrompt, getIconRect, getIconVAlign, getIconWidth, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLocateItemBy, getMultipleValueSeparator, getName, getOperator, getOptionCriteria, getOptionFilterContext, getOptionOperationId, getPageLeft, getPageRect, getPageTop, getPickerIconHeight, getPickerIconName, getPickerIconPrompt, getPickerIconSrc, getPickerIconWidth, getPrintTextBoxStyle, getPrintTitleStyle, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRowSpan, getSaveOnEnter, getSelectedRecord, getSelectOnFocus, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOverIcons, getShowPickerIcon, getShowValueIconOnly, getStopOnError, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTextBoxStyle, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleWidth, getWidth, getWrapTitle, hide, hideIcon, invalidateDisplayValueCache, isCreated, isDisabled, isDrawn, isVisible, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBrowserSpellCheck, setCanEdit, setCanFocus, setCellHeight, setCellStyle, setColSpan, setColSpan, setCriteriaField, setCriterion, setDataPath, setDateFormatter, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisableIconsOnReadOnly, setDisplayField, setDisplayFormat, setDisplayFormat, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEmptyDisplayValue, setEmptyValueIcon, setErrorFormatter, setErrorIconHeight, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setFetchMissingValues, setFilterLocally, setGlobalTabIndex, setHeight, setHeight, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverHeight, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setIconHeight, setIconPrompt, setIcons, setIconVAlign, setIconWidth, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setLeft, setLocateItemBy, setMultipleValueSeparator, setName, setOperator, setOptionCriteria, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setPickerIconHeight, setPickerIconName, setPickerIconPrompt, setPickerIconSrc, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setProperty, setProperty, setProperty, setProperty, setProperty, setRedrawOnChange, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRowSpan, setSaveOnEnter, setSelectOnFocus, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOverIcons, setShowPickerIcon, setShowValueIconOnly, setStopOnError, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTextBoxStyle, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueField, setValueFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setWidth, setWidth, setWrapTitle, shouldFetchMissingValue, shouldSaveOnEnter, show, showIcon, showPicker, stopHover, updateState, validate
 
Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute
 
Methods inherited from class com.smartgwt.client.core.JsObject
setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

ButtonItem

public ButtonItem()

ButtonItem

public ButtonItem(JavaScriptObject jsObj)

ButtonItem

public ButtonItem(String name)

ButtonItem

public ButtonItem(String name,
                  String title)
Method Detail

getOrCreateRef

public static ButtonItem getOrCreateRef(JavaScriptObject jsObj)

setJavaScriptObject

public void setJavaScriptObject(JavaScriptObject jsObj)
Overrides:
setJavaScriptObject in class CanvasItem

setAutoFit

public void setAutoFit(Boolean autoFit)
Should the button auto fit to its title. Maps to autoFit attribute. Note that if an explicit width or height is specified for this item, it will be respected, disabling autoFit behavior

Parameters:
autoFit - autoFit Default value is true

getAutoFit

public Boolean getAutoFit()
Should the button auto fit to its title. Maps to autoFit attribute. Note that if an explicit width or height is specified for this item, it will be respected, disabling autoFit behavior

Returns:
Boolean

setBaseStyle

public void setBaseStyle(String baseStyle)
Optional baseStyle will be applied to the button.

Parameters:
baseStyle - . See CSSStyleName. Default value is null
See Also:
Appearance overview and related methods

getBaseStyle

public String getBaseStyle()
Optional baseStyle will be applied to the button.

Returns:
. See CSSStyleName
See Also:
Appearance overview and related methods

setEndRow

public void setEndRow(Boolean endRow)
These items are in a row by themselves by default

Overrides:
setEndRow in class FormItem
Parameters:
endRow - endRow Default value is true
See Also:
FormLayout overview and related methods

getEndRow

public Boolean getEndRow()
These items are in a row by themselves by default

Overrides:
getEndRow in class FormItem
Returns:
Boolean
See Also:
FormLayout overview and related methods

setIcon

public void setIcon(String icon)
Optional icon image to display on the button for this item. See icon.

Parameters:
icon - . See SCImgURL. Default value is null
See Also:
Appearance overview and related methods

getIcon

public String getIcon()
Optional icon image to display on the button for this item. See icon.

Returns:
. See SCImgURL
See Also:
Appearance overview and related methods

setShowTitle

public void setShowTitle(Boolean showTitle)
Buttons do not show a title by default.

Overrides:
setShowTitle in class FormItem
Parameters:
showTitle - showTitle Default value is false
See Also:
Appearance overview and related methods

getShowTitle

public Boolean getShowTitle()
Buttons do not show a title by default.

Overrides:
getShowTitle in class FormItem
Returns:
Boolean
See Also:
Appearance overview and related methods

setStartRow

public void setStartRow(Boolean startRow)
These items are in a row by themselves by default

Overrides:
setStartRow in class FormItem
Parameters:
startRow - startRow Default value is true
See Also:
FormLayout overview and related methods

getStartRow

public Boolean getStartRow()
These items are in a row by themselves by default

Overrides:
getStartRow in class FormItem
Returns:
Boolean
See Also:
FormLayout overview and related methods

addClickHandler

public HandlerRegistration addClickHandler(ClickHandler handler)
Add a click handler.

Called when a ButtonItem is clicked on.

Specified by:
addClickHandler in interface HasClickHandlers
Overrides:
addClickHandler in class FormItem
Parameters:
handler - the click handler
Returns:
HandlerRegistration used to remove this handler

getCanvas

public Canvas getCanvas()
Description copied from class: CanvasItem
The canvas that will be displayed inside this item. You can pass an instance you've already created, or its global ID as a String. You can also implement CanvasItem.createCanvas to dynamically create the canvas when the FormItem is initialized.

If canvas and createCanvas() are unspecified, the canvas for this item will be auto-created using the overrideable defaults: canvasProperties and canvasConstructor

Note that canvasItem will be set on the canvas to point back to this item.

Overrides:
getCanvas in class CanvasItem
Returns:
Canvas

setButtonProperties

public void setButtonProperties(Button buttonProperties)
Custom Properties to apply to the button item.

Parameters:
buttonProperties - properties to apply to the button item.