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

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

public class MiniDateRangeItem
extends StaticTextItem

Provides a compact interface for editing a date range, by providing a read-only display of the current selected date range with an icon to launch a DateRangeDialog to edit the range.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
MiniDateRangeItem()
           
MiniDateRangeItem(JavaScriptObject jsObj)
           
MiniDateRangeItem(String name)
           
MiniDateRangeItem(String name, String title)
           
 
Method Summary
 Boolean allowRelativeDates()
          Whether the DateRangeDialog opened when the pickerIcon is clicked should display RelativeDateItems or DateItems.
 Boolean canEditCriterion(Criterion criterion)
          Returns true if the specified criterion contains: A single "lessOrEqual" or "greaterOrEqual" criterion on this field An "and" type criterion containing a "lessOrEqual" and a "greaterOrEqual" criterion on this field A single "equals" criterion.
 Boolean getCanFocus()
          Mini DateRangeItems are marked as canFocus:true, and set up with properties such that focus will always go to the icon to launch the dateRange dialog.
 Criterion getCriterion()
          Returns the Criterion entered in the fields shown in the rangeDialog.
 DateDisplayFormat getDateDisplayFormat()
          Format for displaying dates in to the user.
 Date getFromDate()
          Initial value for the "from" date.
static MiniDateRangeItem getOrCreateRef(JavaScriptObject jsObj)
           
 FormItemIcon getPickerIcon()
          Icon that launches a DateChooser for choosing an absolute date.
 String getPickerIconPrompt()
          The prompt to show when the mouse is hovered over the pickerIcon.
 Boolean getShouldSaveValue()
          Allow miniDateRangeItems' values to show up in the form's values array, or if DynamicForm.getValuesAsCriteria is called, for the criterion to be included in the returned AdvancedCriteria object
 String getTextBoxStyle()
          Base CSS class name for a form item's text box element.
 Date getToDate()
          Initial value for the "to" date.
 DateRange getValue()
          Retrieves the current value of this dateRangeItem.
 Boolean hasAdvancedCriteria()
          Overridden to return true: dateRangeItems always generate AdvancedCriteria.
 void setCanFocus(Boolean canFocus)
          Mini DateRangeItems are marked as canFocus:true, and set up with properties such that focus will always go to the icon to launch the dateRange dialog.
 void setCriterion(Criterion criterion)
          Applies the specified criterion to this item for editing.
 void setDateDisplayFormat(DateDisplayFormat dateDisplayFormat)
          Format for displaying dates in to the user.
 void setFromDate(Date fromDate)
          Initial value for the "from" date.
 void setPickerIcon(FormItemIcon pickerIcon)
          Icon that launches a DateChooser for choosing an absolute date.
 void setPickerIconPrompt(String pickerIconPrompt)
          The prompt to show when the mouse is hovered over the pickerIcon.
 void setShouldSaveValue(Boolean shouldSaveValue)
          Allow miniDateRangeItems' values to show up in the form's values array, or if DynamicForm.getValuesAsCriteria is called, for the criterion to be included in the returned AdvancedCriteria object
 void setTextBoxStyle(String textBoxStyle)
          Base CSS class name for a form item's text box element.
 void setToDate(Date toDate)
          Initial value for the "to" date.
 void setValue(DateRange value)
          Sets the value for this dateRangeItem.
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.StaticTextItem
getClipValue, getDateFormatter, getEscapeHTML, getWrap, setClipValue, setDateFormatter, setEscapeHTML, setWrap
 
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, clearValue, disable, enable, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getBrowserSpellCheck, getCanEdit, getCellHeight, getCellStyle, getConfig, getContainerWidget, getCriteriaField, getCriterion, getDataPath, getDefaultIconSrc, getDisabled, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, 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, getPickerIconSrc, getPickerIconWidth, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getRect, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRowSpan, getSelectedRecord, getSelectOnFocus, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOverIcons, getShowPickerIcon, getShowTitle, getShowValueIconOnly, getStartRow, getStopOnError, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleWidth, getWidth, getWrapTitle, hide, invalidateDisplayValueCache, isCreated, isDisabled, isDrawn, isVisible, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBrowserSpellCheck, setCanEdit, setCellHeight, setCellStyle, setColSpan, setColSpan, setCriteriaField, setDataPath, setDefaultIconSrc, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisplayField, setDisplayFormat, setDisplayFormat, setEditorType, setEditorValueFormatter, setEditorValueParser, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, 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, setPickerIconSrc, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRowSpan, setSelectOnFocus, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOverIcons, setShowPickerIcon, setShowTitle, setShowValueIconOnly, setStartRow, setStopOnError, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, 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, 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

MiniDateRangeItem

public MiniDateRangeItem()

MiniDateRangeItem

public MiniDateRangeItem(JavaScriptObject jsObj)

MiniDateRangeItem

public MiniDateRangeItem(String name)

MiniDateRangeItem

public MiniDateRangeItem(String name,
                         String title)
Method Detail

getOrCreateRef

public static MiniDateRangeItem getOrCreateRef(JavaScriptObject jsObj)

setCanFocus

public void setCanFocus(Boolean canFocus)
Mini DateRangeItems are marked as canFocus:true, and set up with properties such that focus will always go to the icon to launch the dateRange dialog. Set canFocus to false to suppress this behavior.

Overrides:
setCanFocus in class FormItem
Parameters:
canFocus - canFocus Default value is true
See Also:
Focus overview and related methods

getCanFocus

public Boolean getCanFocus()
Mini DateRangeItems are marked as canFocus:true, and set up with properties such that focus will always go to the icon to launch the dateRange dialog. Set canFocus to false to suppress this behavior.

Overrides:
getCanFocus in class FormItem
Returns:
Boolean
See Also:
Focus overview and related methods

setDateDisplayFormat

public void setDateDisplayFormat(DateDisplayFormat dateDisplayFormat)
Format for displaying dates in to the user.

If this attribute is unset, the display value is formatted intelligently according to the dates involved. For example, if both dates appear in the same month, the value will be formatted as Month date1 - date2, Year and, if in different months of the same year, Month1 date1 - Month2 date2, Year.

Parameters:
dateDisplayFormat - dateDisplayFormat Default value is null

getDateDisplayFormat

public DateDisplayFormat getDateDisplayFormat()
Format for displaying dates in to the user.

If this attribute is unset, the display value is formatted intelligently according to the dates involved. For example, if both dates appear in the same month, the value will be formatted as Month date1 - date2, Year and, if in different months of the same year, Month1 date1 - Month2 date2, Year.

Returns:
DateDisplayFormat

setPickerIcon

public void setPickerIcon(FormItemIcon pickerIcon)
Icon that launches a DateChooser for choosing an absolute date.

Parameters:
pickerIcon - pickerIcon Default value is null

getPickerIcon

public FormItemIcon getPickerIcon()
Icon that launches a DateChooser for choosing an absolute date.

Returns:
FormItemIcon

setPickerIconPrompt

public void setPickerIconPrompt(String pickerIconPrompt)
The prompt to show when the mouse is hovered over the pickerIcon.

Parameters:
pickerIconPrompt - pickerIconPrompt Default value is "Show Date Chooser"

getPickerIconPrompt

public String getPickerIconPrompt()
The prompt to show when the mouse is hovered over the pickerIcon.

Returns:
String

setShouldSaveValue

public void setShouldSaveValue(Boolean shouldSaveValue)
Allow miniDateRangeItems' values to show up in the form's values array, or if DynamicForm.getValuesAsCriteria is called, for the criterion to be included in the returned AdvancedCriteria object

Overrides:
setShouldSaveValue in class FormItem
Parameters:
shouldSaveValue - shouldSaveValue Default value is true

getShouldSaveValue

public Boolean getShouldSaveValue()
Allow miniDateRangeItems' values to show up in the form's values array, or if DynamicForm.getValuesAsCriteria is called, for the criterion to be included in the returned AdvancedCriteria object

Overrides:
getShouldSaveValue in class FormItem
Returns:
Boolean

setTextBoxStyle

public void setTextBoxStyle(String textBoxStyle)
Base CSS class name for a form item's text box element.

NOTE: See the CompoundFormItem_skinning discussion for special skinning considerations.

Overrides:
setTextBoxStyle in class StaticTextItem
Parameters:
textBoxStyle - textBoxStyle Default value is "textItem"
See Also:
FormItem.setCellStyle(java.lang.String), Appearance overview and related methods

getTextBoxStyle

public String getTextBoxStyle()
Base CSS class name for a form item's text box element.

NOTE: See the CompoundFormItem_skinning discussion for special skinning considerations.

Overrides:
getTextBoxStyle in class StaticTextItem
Returns:
String
See Also:
FormItem.getCellStyle(), Appearance overview and related methods

allowRelativeDates

public Boolean allowRelativeDates()
Whether the DateRangeDialog opened when the pickerIcon is clicked should display RelativeDateItems or DateItems.

Returns:
true

canEditCriterion

public Boolean canEditCriterion(Criterion criterion)
Returns true if the specified criterion contains:

Overrides:
canEditCriterion in class FormItem
Parameters:
criterion - criterion to test
Returns:
returns true if this criterion can be edited by this item
See Also:
CriteriaEditing overview and related methods

getCriterion

public Criterion getCriterion()
Returns the Criterion entered in the fields shown in the rangeDialog.

If both dates are entered, a Criterion with an "and" operator will be returned with both a "greaterOrEqual" and "lessOrEqual" sub-criteria. If either date is omitted, only the "greaterOrEqual" (from date) or "lessOrEqual" (to date) Criterion is returned.

Overrides:
getCriterion in class FormItem
Returns:
See Also:
CriteriaEditing overview and related methods

hasAdvancedCriteria

public Boolean hasAdvancedCriteria()
Overridden to return true: dateRangeItems always generate AdvancedCriteria.

Overrides:
hasAdvancedCriteria in class FormItem
Returns:
true
See Also:
CriteriaEditing overview and related methods

setCriterion

public void setCriterion(Criterion criterion)
Applies the specified criterion to this item for editing. Applies any specified "greaterOrEqual" operator criterion or sub-criterion to our fromField and any specified "lessOrEqual" operator criterion or sub-criterion to our toField.

Note that a single "equals" criterion can also be passed. See canEditCriterion() for more detail.

Overrides:
setCriterion in class FormItem
Parameters:
criterion - criterion to edit

setFromDate

public void setFromDate(Date fromDate)
Initial value for the "from" date. Sets the fromDate for this DateRangeItem.

Parameters:
fromDate - the date from which this item should start it's range. Default value is today

getFromDate

public Date getFromDate()
Initial value for the "from" date.

Returns:
java.util.Date

setToDate

public void setToDate(Date toDate)
Initial value for the "to" date. Sets the toDate for this DateRangeItem.

Parameters:
toDate - the date at which this item should end it's range. Default value is today

getToDate

public Date getToDate()
Initial value for the "to" date.

Returns:
java.util.Date

getValue

public DateRange getValue()
Retrieves the current value of this dateRangeItem. The return value is a DateRange object that excludes start and end values if they aren't set.

Overrides:
getValue in class FormItem
Returns:
the current value of this item

setValue

public void setValue(DateRange value)
Sets the value for this dateRangeItem. The value parameter is a DateRange object that optionally includes both start and end values.

Parameters:
value - the new value for this item