public abstract class AbstractDateTimeEditor<C extends org.zkoss.zul.impl.FormatInputElement> extends AbstractTextBasedEditorRenderer<Date>
Date values.
Abstraction is made to extract all methods independent from whether a component is used as input for date only (
Datebox), time only (Timebox) or both (Datebox).
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DATE_FORMAT_NONE |
static String |
SELECTED_TIME_ZONE |
SETTING_INPUT_INSTANTHEADER_LABEL_TOOLTIP, ON_ADD_EVENT, ON_DELETE_EVENTINITIAL_EDIT_STRING| Constructor and Description |
|---|
AbstractDateTimeEditor() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract C |
createEditorView()
Creates a view component.
|
protected String |
getDateFormat(C datebox,
EditorContext<Date> context)
Gets format string from configuration.
|
protected abstract String |
getDateFormat(int dateStyle)
Determines a format string for specified format style (see:
DateFormat) |
protected String |
getDateFormat(String dateFormatInput)
Determines the date format for the component.
|
protected String |
getDefaultDateFormat(C datebox)
Returns default date format.
|
protected Optional<Integer> |
getDefaultDateFormat(String formatInput) |
protected abstract String |
getFormatConfigurationParameter()
Defines a name of configuration parameter that stands for a date format.
|
protected TimeZone |
getInitialTimeZoneFromConfig(EditorContext<Date> context) |
protected Optional<String> |
getPatternDateFormat(String formatInput) |
protected Date |
getRawValue(org.zkoss.zul.impl.InputElement viewComponent)
Extracts value of the given editor component.
|
protected int |
getRequiredStyle(int style)
Checks if provided style is an actual style or points to
DATE_FORMAT_NONE. |
protected TimeZone |
getSessionTimeZoneAttribute() |
protected TimeZone |
getZKDefaultTimeZone() |
protected void |
handleReadOnly(EditorContext<Date> context,
org.zkoss.zul.impl.InputElement editorView)
In case of dateTimeEditor we have to override standard implementation of handleReadOnly.
|
void |
initTimeZone(C box,
EditorContext<Date> context) |
protected void |
initViewComponent(org.zkoss.zul.impl.InputElement editorView,
EditorContext<Date> context,
EditorListener<Date> listener)
Adds event listeners to this editor component, parses the parameter for initial value etc.
|
void |
render(org.zkoss.zk.ui.Component parent,
EditorContext<Date> context,
EditorListener<Date> listener)
Creates a new editor component and attaches it to the specified
Component component. |
protected void |
setRawValue(org.zkoss.zul.impl.InputElement viewComponent,
Date rawValue)
Sets the value to the given editor component.
|
clearInvalidInputAndNotify, coerceFromString, handleChangeEvent, handleChangeEvent, handleChangingEvent, hasInvalidInput, isPrimitive, onCancelEvent, onChangeEvent, onChangingEvent, onFocusEvent, onOkEventextractEmbeddedEditor, extractEmbeddedType, findAncestorEditor, findEmbeddedEditors, getInitialEditString, getL10nDecoratorpublic static final String SELECTED_TIME_ZONE
protected static final int DATE_FORMAT_NONE
protected abstract String getDateFormat(int dateStyle)
DateFormat)dateStyle - format styleprotected int getRequiredStyle(int style)
DATE_FORMAT_NONE.style - date style to be checkedDATE_FORMAT_NONE, otherwise a default oneprotected String getDateFormat(String dateFormatInput)
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:
dateFormatInput - the configured date formatDateFormat) for the component or null if format is
invalidprotected String getDefaultDateFormat(C datebox)
getDateFormat(String) method.datebox - protected abstract C createEditorView()
protected abstract String getFormatConfigurationParameter()
protected String getDateFormat(C datebox, EditorContext<Date> context)
Returned string should be compatible with SimpleDateFormat
datebox - component for which a format is requestedcontext - the context for the editor creationprotected void handleReadOnly(EditorContext<Date> context, org.zkoss.zul.impl.InputElement editorView)
handleReadOnly in class AbstractTextBasedEditorRenderer<Date>context - editorView - protected void initViewComponent(org.zkoss.zul.impl.InputElement editorView,
EditorContext<Date> context,
EditorListener<Date> listener)
AbstractTextBasedEditorRendererinitViewComponent in class AbstractTextBasedEditorRenderer<Date>editorView - the editor component previously created in overridden method
CockpitEditorRenderer.render(org.zkoss.zk.ui.Component, com.hybris.cockpitng.editors.EditorContext, com.hybris.cockpitng.editors.EditorListener)context - the editor contextpublic void render(org.zkoss.zk.ui.Component parent,
EditorContext<Date> context,
EditorListener<Date> listener)
CockpitEditorRendererComponent component.parent - parent component the editor should be attached tocontext - the context for the editor creationlistener - the listener to notify the rest of the world about value changes and other eventsprotected void setRawValue(org.zkoss.zul.impl.InputElement viewComponent,
Date rawValue)
AbstractTextBasedEditorRenderersetRawValue in class AbstractTextBasedEditorRenderer<Date>viewComponent - the underlying editor componentrawValue - the valueprotected Date getRawValue(org.zkoss.zul.impl.InputElement viewComponent)
AbstractTextBasedEditorRenderergetRawValue in class AbstractTextBasedEditorRenderer<Date>viewComponent - the underlying editor componentpublic void initTimeZone(C box, EditorContext<Date> context)
protected TimeZone getInitialTimeZoneFromConfig(EditorContext<Date> context)
protected TimeZone getSessionTimeZoneAttribute()
protected TimeZone getZKDefaultTimeZone()
Copyright © 2018. All rights reserved.