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, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers

public class TimeItem
extends TextItem

FormItem for editing times in a text field.

timeFormatter allows you to set the display format for this field. See also String 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 String.


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
 TimeDisplayFormat 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)
           
 TimeDisplayFormat getTimeFormatter()
          What format should this item's time string be presented in? If unset the format will be derived from timeFormatter or the system-side
 Boolean getUseMask()
          If true, a data entry mask will be enabled in the field based on the timeFormatter.
 void setDisplayFormat(TimeDisplayFormat timeFormatter)
          What format should this item's time string be presented in?
 void setDisplayFormat(TimeFormatter timeFormatter)
          Deprecated. Use setDisplayFormat(TimeDisplayFormat) instead.
 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 setTimeFormatter(TimeDisplayFormat timeFormatter)
          What format should this item's time string be presented in? If unset the format will be derived from timeFormatter or the system-side
 void setUseMask(Boolean useMask)
          If true, a data entry mask will be enabled in the field based on the timeFormatter.
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.TextItem
deselectValue, deselectValue, getChangeOnKeypress, getCharacterCasing, getEnteredValue, getFormatOnFocusChange, getHeight, getHint, getKeyPressFilter, getLength, getMaskPadChar, getMaskPromptChar, getPrintFullText, getSelectionRange, getSelectOnFocus, getShowHintInField, getTextBoxStyle, getValueAsString, getWidth, selectValue, setChangeOnKeypress, setCharacterCasing, setFormatOnFocusChange, setHeight, setKeyPressFilter, setLength, setMaskPadChar, setMaskPromptChar, setPrintFullText, 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, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, blurItem, canEditCriterion, clearValue, disable, enable, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getBrowserSpellCheck, getCanFocus, getCellHeight, getCellStyle, getConfig, getContainerWidget, getCriteriaField, getCriterion, getCriterion, getDataPath, getDateFormatter, getDefaultIconSrc, getDisabled, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getFetchMissingValues, getFieldName, getFilterLocally, getForm, getFullDataPath, getGlobalTabIndex, 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, getPickerIconSrc, getPickerIconWidth, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getRect, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRowSpan, getSelectedRecord, getShouldSaveValue, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOverIcons, getShowPickerIcon, getShowTitle, getShowValueIconOnly, getStartRow, getStopOnError, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getValidateOnChange, getValidateOnExit, getValidOperators, getValue, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleWidth, getWrapTitle, hasAdvancedCriteria, hide, invalidateDisplayValueCache, isCreated, isDisabled, isDrawn, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBrowserSpellCheck, setCanFocus, setCellHeight, setCellStyle, setColSpan, setColSpan, setCriteriaField, setCriterion, setDataPath, setDateFormatter, setDefaultIconSrc, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisplayField, setDisplayFormat, 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, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setLeft, setLocateItemBy, setMultipleValueSeparator, setName, setOperator, setOptionCriteria, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setPickerIconHeight, setPickerIconName, setPickerIconSrc, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRowSpan, setShouldSaveValue, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOverIcons, setShowPickerIcon, setShowTitle, setShowValueIconOnly, setStartRow, setStopOnError, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTitle, setTitleAlign, setTitleColSpan, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueField, setValueFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setWidth, setWrapTitle, shouldFetchMissingValue, show, 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, 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)

setMask

public void setMask(String mask)
Internal-use only for a TimeItem.

If this method is called after the component has been drawn/initialized: 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
See Also:
setUseMask(java.lang.Boolean)

getMask

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

Overrides:
getMask in class TextItem
Returns:
String
See Also:
getUseMask()

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
See Also:
setUseMask(java.lang.Boolean)

getMaskOverwriteMode

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

Overrides:
getMaskOverwriteMode in class TextItem
Returns:
Boolean
See Also:
getUseMask()

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
See Also:
setUseMask(java.lang.Boolean)

getMaskSaveLiterals

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

Overrides:
getMaskSaveLiterals in class TextItem
Returns:
Boolean
See Also:
getUseMask()

setTimeFormatter

public void setTimeFormatter(TimeDisplayFormat timeFormatter)
What format should this item's time string be presented in? If unset the format will be derived from timeFormatter or the system-side

Overrides:
setTimeFormatter in class FormItem
Parameters:
timeFormatter - timeFormatter Default value is "toShort24HourTime"
See Also:
Appearance overview and related methods

getTimeFormatter

public TimeDisplayFormat getTimeFormatter()
What format should this item's time string be presented in? If unset the format will be derived from timeFormatter or the system-side

Overrides:
getTimeFormatter in class FormItem
Returns:
TimeDisplayFormat
See Also:
Appearance overview and related methods

setUseMask

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

Note that if a non-padded timeFormatter 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 timeFormatter.

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

Returns:
Boolean

setDisplayFormat

public void setDisplayFormat(TimeFormatter timeFormatter)
Deprecated. Use setDisplayFormat(TimeDisplayFormat) instead.

What format should this item's time string be presented in?

Overrides:
setDisplayFormat in class FormItem
Parameters:
timeFormatter - displayFormat Default value is "toShort24HourTime"
See Also:
FormItem.setInputFormat(java.lang.String), FormItem.setDateFormatter(com.smartgwt.client.types.DateDisplayFormat), FormItem.setTimeFormatter(com.smartgwt.client.types.TimeDisplayFormat)

setDisplayFormat

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

Parameters:
TimeDisplayFormat - displayFormat Default value is "toShort24HourTime"

getDisplayFormat

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

Returns:
TimeDisplayFormat