Class DefaultDateEditor
- java.lang.Object
-
- com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer<T>
-
- com.hybris.cockpitng.editors.impl.AbstractTextBasedEditorRenderer<java.util.Date>
-
- com.hybris.cockpitng.editor.defaultdate.AbstractDateTimeEditor<org.zkoss.zul.Datebox>
-
- com.hybris.cockpitng.editor.defaultdate.DefaultDateEditor
-
- All Implemented Interfaces:
CockpitEditorRenderer<java.util.Date>
public class DefaultDateEditor extends AbstractDateTimeEditor<org.zkoss.zul.Datebox>
Default Editor forDatevalues (incl. time).
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringDATE_FORMATprotected static java.lang.StringDEFAULT_TIMEZONESstatic java.lang.StringDISABLE_INLINE_EDITINGstatic java.lang.StringDISABLE_INLINE_EDITING_SCLASSstatic java.lang.StringDISPLAYED_TIME_ZONESprotected static java.lang.StringSHOW_CALENDAR_ON_FOCUSstatic java.lang.StringTIME_ZONE_READ_ONLYprotected static java.lang.StringTIMEZONES_DELIMITER-
Fields inherited from class com.hybris.cockpitng.editor.defaultdate.AbstractDateTimeEditor
DATE_FORMAT_NONE, SELECTED_TIME_ZONE
-
Fields inherited from class com.hybris.cockpitng.editors.impl.AbstractTextBasedEditorRenderer
SETTING_INPUT_INSTANT
-
Fields inherited from class com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer
HEADER_LABEL_TOOLTIP, ON_ADD_EVENT, ON_DELETE_EVENT, YW_EDITOR_AREA_LABEL_CONTAINER
-
Fields inherited from interface com.hybris.cockpitng.editors.CockpitEditorRenderer
INITIAL_EDIT_STRING
-
-
Constructor Summary
Constructors Constructor Description DefaultDateEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.util.DatecoerceFromString(org.zkoss.zul.impl.InputElement editorView, java.lang.String text)Converts string value to a real value.protected org.zkoss.zul.DateboxcreateEditorView()Creates a view component.protected java.lang.StringgetDateFormat(int dateStyle)Determines a format string for specified format style (see:DateFormat)protected java.lang.StringgetDateFormat(java.lang.String dateFormatInput)Determines the date format for the component.protected java.lang.StringgetDateTimeFormat(int dateStyle, int timeStyle)protected java.lang.StringgetDisplayedTimeZones(EditorContext<java.util.Date> context)protected java.lang.StringgetFormatConfigurationParameter()Defines a name of configuration parameter that stands for a date format.protected java.util.List<java.util.TimeZone>getTimeZones(java.lang.String timeZonesString)voidinitTimeZone(org.zkoss.zul.Datebox box, EditorContext<java.util.Date> context)protected voidinitTimezoneManagement(org.zkoss.zul.Datebox box, EditorContext<java.util.Date> context)Deprecated, for removal: This API element is subject to removal in a future version.since 6.5, please use theinitTimeZone(Datebox, EditorContext)instead.protected voidinitViewComponent(org.zkoss.zul.impl.InputElement editorView, EditorContext<java.util.Date> context, EditorListener<java.util.Date> listener)Adds event listeners to this editor component, parses the parameter for initial value etc.protected booleanisInitialTimeZoneInDisplayedTimezones(java.lang.String displayedTimeZonesString, java.util.TimeZone initialTimeZone)protected booleanisTimeZoneReadOnly(EditorContext<java.util.Date> context)protected voidsetTimeZone(org.zkoss.zul.Datebox box, java.util.TimeZone timeZone)protected booleanshouldInputBeDisabled(EditorContext<java.util.Date> context)-
Methods inherited from class com.hybris.cockpitng.editor.defaultdate.AbstractDateTimeEditor
getDateFormat, getDefaultDateFormat, getDefaultDateFormat, getInitialTimeZoneFromConfig, getPatternDateFormat, getRawValue, getRequiredStyle, getSessionTimeZoneAttribute, getZKDefaultTimeZone, handleReadOnly, render, setRawValue
-
Methods inherited from class com.hybris.cockpitng.editors.impl.AbstractTextBasedEditorRenderer
clearInvalidInputAndNotify, handleChangeEvent, handleChangeEvent, handleChangingEvent, hasInvalidInput, isPrimitive, onCancelEvent, onChangeEvent, onChangingEvent, onFocusEvent, onOkEvent
-
Methods inherited from class com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer
extractEmbeddedEditor, extractEmbeddedType, findAncestorEditor, findEmbeddedEditors, getInitialEditString, getL10nDecorator
-
-
-
-
Field Detail
-
TIME_ZONE_READ_ONLY
public static final java.lang.String TIME_ZONE_READ_ONLY
- See Also:
- Constant Field Values
-
DISPLAYED_TIME_ZONES
public static final java.lang.String DISPLAYED_TIME_ZONES
- See Also:
- Constant Field Values
-
DISABLE_INLINE_EDITING
public static final java.lang.String DISABLE_INLINE_EDITING
- See Also:
- Constant Field Values
-
DISABLE_INLINE_EDITING_SCLASS
public static final java.lang.String DISABLE_INLINE_EDITING_SCLASS
- See Also:
- Constant Field Values
-
DATE_FORMAT
protected static final java.lang.String DATE_FORMAT
- See Also:
- Constant Field Values
-
SHOW_CALENDAR_ON_FOCUS
protected static final java.lang.String SHOW_CALENDAR_ON_FOCUS
- See Also:
- Constant Field Values
-
DEFAULT_TIMEZONES
protected static final java.lang.String DEFAULT_TIMEZONES
- See Also:
- Constant Field Values
-
TIMEZONES_DELIMITER
protected static final java.lang.String TIMEZONES_DELIMITER
- See Also:
- Constant Field Values
-
-
Method Detail
-
createEditorView
protected org.zkoss.zul.Datebox createEditorView()
Description copied from class:AbstractDateTimeEditorCreates a view component.- Specified by:
createEditorViewin classAbstractDateTimeEditor<org.zkoss.zul.Datebox>- Returns:
- view component
-
getDateFormat
protected java.lang.String getDateFormat(java.lang.String dateFormatInput)
Description copied from class:AbstractDateTimeEditorDetermines the date format for the component.The given date format can be either a custom date format e. g. dd/MM/yyyy (see
SimpleDateFormat) or the following constants for getting a localized date format:- short
- medium
- long
- full
- Overrides:
getDateFormatin classAbstractDateTimeEditor<org.zkoss.zul.Datebox>- Parameters:
dateFormatInput- the configured date format- Returns:
- date format string (
DateFormat) for the component ornullif format is invalid
-
getDateFormat
protected java.lang.String getDateFormat(int dateStyle)
Description copied from class:AbstractDateTimeEditorDetermines a format string for specified format style (see:DateFormat)- Specified by:
getDateFormatin classAbstractDateTimeEditor<org.zkoss.zul.Datebox>- Parameters:
dateStyle- format style- Returns:
- format string
-
getDateTimeFormat
protected java.lang.String getDateTimeFormat(int dateStyle, int timeStyle)
-
getFormatConfigurationParameter
protected java.lang.String getFormatConfigurationParameter()
Description copied from class:AbstractDateTimeEditorDefines a name of configuration parameter that stands for a date format.- Specified by:
getFormatConfigurationParameterin classAbstractDateTimeEditor<org.zkoss.zul.Datebox>- Returns:
- name of configuration parameter
-
initViewComponent
protected void initViewComponent(org.zkoss.zul.impl.InputElement editorView, EditorContext<java.util.Date> context, EditorListener<java.util.Date> listener)Description copied from class:AbstractTextBasedEditorRendererAdds event listeners to this editor component, parses the parameter for initial value etc.- Overrides:
initViewComponentin classAbstractDateTimeEditor<org.zkoss.zul.Datebox>- Parameters:
editorView- the editor component previously created in overridden methodCockpitEditorRenderer.render(org.zkoss.zk.ui.Component, com.hybris.cockpitng.editors.EditorContext, com.hybris.cockpitng.editors.EditorListener)context- the editor context
-
shouldInputBeDisabled
protected boolean shouldInputBeDisabled(EditorContext<java.util.Date> context)
-
initTimeZone
public void initTimeZone(org.zkoss.zul.Datebox box, EditorContext<java.util.Date> context)- Overrides:
initTimeZonein classAbstractDateTimeEditor<org.zkoss.zul.Datebox>
-
initTimezoneManagement
@Deprecated(since="6.5", forRemoval=true) protected void initTimezoneManagement(org.zkoss.zul.Datebox box, EditorContext<java.util.Date> context)Deprecated, for removal: This API element is subject to removal in a future version.since 6.5, please use theinitTimeZone(Datebox, EditorContext)instead.
-
getDisplayedTimeZones
protected java.lang.String getDisplayedTimeZones(EditorContext<java.util.Date> context)
-
coerceFromString
protected java.util.Date coerceFromString(org.zkoss.zul.impl.InputElement editorView, java.lang.String text)Description copied from class:AbstractTextBasedEditorRendererConverts string value to a real value.- Specified by:
coerceFromStringin classAbstractTextBasedEditorRenderer<java.util.Date>- Parameters:
editorView- the underlying editor componenttext- the string vale- Returns:
- the value
-
setTimeZone
protected void setTimeZone(org.zkoss.zul.Datebox box, java.util.TimeZone timeZone)
-
isTimeZoneReadOnly
protected boolean isTimeZoneReadOnly(EditorContext<java.util.Date> context)
-
isInitialTimeZoneInDisplayedTimezones
protected boolean isInitialTimeZoneInDisplayedTimezones(java.lang.String displayedTimeZonesString, java.util.TimeZone initialTimeZone)
-
getTimeZones
protected java.util.List<java.util.TimeZone> getTimeZones(java.lang.String timeZonesString)
-
-