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

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.TextItem
                      extended by com.smartgwt.client.widgets.form.fields.TimeItem
All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasTitleHoverHandlers

public class TimeItem
extends TextItem

FormItem for editing times in a text field.

displayFormat allows you to set the display format for this field. See also com.smartgwt.client..Time#setNormalDisplayFormat for system-wide settings.

TimeItem automatically accepts both 12 and 24 hour time as well as partial times and a variety of possible time value separators. Examples:

  11:34:45 AM => 11:34:45
  1:3:5 AM => 01:30:50
  1:3p  =>
 13:30:00
  11 34 am => 11:34:00
  11-34  => 11:34:00
  113445  => 11:34:45
  13445  => 01:34:45
 
 1134  => 11:34:00
  134   => 01:34:00
 

Values entered by the user are stored as JavaScript Date objects in GMT/UTC time regardless of the local time zone. Note if you log, alert() or otherwise convert a Date into a String, the default behavior is to show it in local time. To see the correct time value, use the JavaScript built-in APIs dateValue.getUTCHours/Minutes/Seconds() or the com.smartgwt.client..Time#toShortTime.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
TimeItem()
           
TimeItem(JavaScriptObject jsObj)
           
TimeItem(String name)
           
TimeItem(String name, String title)
           
 
Method Summary
 TimeFormatter getDisplayFormat()
          What format should this item's time string be presented in?
 String getMask()
          Internal-use only for a TimeItem.
 Boolean getMaskOverwriteMode()
          Internal-use only for a TimeItem.
 Boolean getMaskSaveLiterals()
          Internal-use only for a TimeItem.
static TimeItem getOrCreateRef(JavaScriptObject jsObj)
           
 Boolean getUseMask()
          If true, a data entry mask will be enabled in the field based on the displayFormat.
 void setDisplayFormat(TimeFormatter timeFormatter)
          What format should this item's time string be presented in?
 void setMask(String mask)
          Internal-use only for a TimeItem.
 void setMaskOverwriteMode(Boolean maskOverwriteMode)
          Internal-use only for a TimeItem.
 void setMaskSaveLiterals(Boolean maskSaveLiterals)
          Internal-use only for a TimeItem.
 void setUseMask(Boolean useMask)
          If true, a data entry mask will be enabled in the field based on the displayFormat.
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.TextItem
deselectValue, deselectValue, getCharacterCasing, getHeight, getHint, getKeyPressFilter, getLength, getMaskPadChar, getMaskPromptChar, getSelectionRange, getSelectOnFocus, getShowHintInField, getTextBoxStyle, getWidth, selectValue, setCharacterCasing, setHeight, setKeyPressFilter, setLength, setMaskPadChar, setMaskPromptChar, setSelectionRange, setSelectOnFocus, setShowHintInField, setTextBoxStyle, setWidth
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addFocusHandler, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addTitleHoverHandler, blurItem, clearValue, disable, enable, focusInItem, getAccessKey, getAlign, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getCellStyle, getConfig, getCriteriaField, getCriterion, getDataPath, getDateFormatter, getDefaultIconSrc, getDisabled, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getFetchMissingValues, getFieldName, getFilterLocally, getForm, getGlobalTabIndex, getHintStyle, getHoverAlign, getHoverDelay, getHoverHeight, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getIconHeight, getIconPageRect, getIconPrompt, getIconRect, getIconVAlign, getIconWidth, getImageURLPrefix, getImageURLSuffix, getLeft, getName, getOperator, getOptionCriteria, getOptionFilterContext, getOptionOperationId, getPickerIconHeight, getPickerIconSrc, getPickerIconWidth, getPrompt, getRejectInvalidValueOnChange, getRequired, getRowSpan, getShouldSaveValue, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOverIcons, getShowPickerIcon, getShowTitle, getShowValueIconOnly, getStartRow, getSuppressValueIcon, getTabIndex, getTextAlign, getTimeFormatter, getTitle, getTitleAlign, getTitleOrientation, getTitleStyle, getTooltip, getTop, getType, getValidateOnChange, getValue, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getWrapTitle, hide, isCreated, isDisabled, isDrawn, redraw, setAccessKey, setAlign, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setCellStyle, setColSpan, setColSpan, setCriteriaField, setDataPath, setDateFormatter, setDefaultIconSrc, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisplayField, setEditorType, setEditorValueFormatter, setEditorValueParser, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setFetchMissingValues, setFilterLocally, setGlobalTabIndex, setHeight, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverHeight, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setIconHeight, setIconPrompt, setIcons, setIconVAlign, setIconWidth, setImageURLPrefix, setImageURLSuffix, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setLeft, setName, setOperator, setOptionCriteria, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setPickerIconHeight, setPickerIconSrc, setPickerIconWidth, setPrompt, setProperty, setProperty, setProperty, setProperty, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRowSpan, setShouldSaveValue, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOverIcons, setShowPickerIcon, setShowTitle, setShowValueIconOnly, setStartRow, setSuppressValueIcon, setTabIndex, setTextAlign, setTimeFormatter, setTitle, setTitleAlign, setTitleOrientation, setTitleStyle, setTooltip, setTop, setType, setValidateOnChange, setValidators, setValue, setValue, setValue, setValue, setValue, setValue, setValueField, setValueFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setWidth, setWrapTitle, show, stopHover, updateState
 
Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttributeAsIntArray, getAttributeAsMap, getAttributeAsObject, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, 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

TimeItem

public TimeItem()

TimeItem

public TimeItem(JavaScriptObject jsObj)

TimeItem

public TimeItem(String name)

TimeItem

public TimeItem(String name,
                String title)
Method Detail

getOrCreateRef

public static TimeItem getOrCreateRef(JavaScriptObject jsObj)

setUseMask

public void setUseMask(Boolean useMask)
If true, a data entry mask will be enabled in the field based on the displayFormat.

Note that if a non-padded displayFormat is specified, it will be changed to the corresponding padded version (ex. "toShort24HourTime" will be changed to "toShortPadded24HourTime").

Note : This is an advanced setting

Parameters:
useMask - useMask Default value is null

getUseMask

public Boolean getUseMask()
If true, a data entry mask will be enabled in the field based on the displayFormat.

Note that if a non-padded displayFormat is specified, it will be changed to the corresponding padded version (ex. "toShort24HourTime" will be changed to "toShortPadded24HourTime").

Returns:
Boolean

setMask

public void setMask(String mask)
Internal-use only for a TimeItem. A custom mask cannot be defined for a time item.

Note : This is an advanced setting

Overrides:
setMask in class TextItem
Parameters:
mask - mask Default value is null

getMask

public String getMask()
Internal-use only for a TimeItem.

Overrides:
getMask in class TextItem
Returns:
String

setMaskSaveLiterals

public void setMaskSaveLiterals(Boolean maskSaveLiterals)
Internal-use only for a TimeItem.

Note : This is an advanced setting

Overrides:
setMaskSaveLiterals in class TextItem
Parameters:
maskSaveLiterals - maskSaveLiterals Default value is null

getMaskSaveLiterals

public Boolean getMaskSaveLiterals()
Internal-use only for a TimeItem.

Overrides:
getMaskSaveLiterals in class TextItem
Returns:
Boolean

setMaskOverwriteMode

public void setMaskOverwriteMode(Boolean maskOverwriteMode)
Internal-use only for a TimeItem.

Note : This is an advanced setting

Overrides:
setMaskOverwriteMode in class TextItem
Parameters:
maskOverwriteMode - maskOverwriteMode Default value is null

getMaskOverwriteMode

public Boolean getMaskOverwriteMode()
Internal-use only for a TimeItem.

Overrides:
getMaskOverwriteMode in class TextItem
Returns:
Boolean

setDisplayFormat

public void setDisplayFormat(TimeFormatter timeFormatter)
What format should this item's time string be presented in?

Parameters:
timeFormatter - displayFormat Default value is "toShort24HourTime"

getDisplayFormat

public TimeFormatter getDisplayFormat()
What format should this item's time string be presented in?

Returns:
DateDisplayFormat