Class AbstractTextBasedEditorRenderer<T>
- java.lang.Object
-
- com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer<T>
-
- com.hybris.cockpitng.editors.impl.AbstractTextBasedEditorRenderer<T>
-
- All Implemented Interfaces:
CockpitEditorRenderer<T>
- Direct Known Subclasses:
AbstractDateTimeEditor,AbstractDecimalEditor,AbstractIntegralEditor,AbstractTextEditor,DefaultBigDecimalEditor,DefaultBigIntegerEditor
public abstract class AbstractTextBasedEditorRenderer<T> extends AbstractCockpitEditorRenderer<T>
Abstract text based Editor that all "single input" fields should extend.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSETTING_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 AbstractTextBasedEditorRenderer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidclearInvalidInputAndNotify(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView)protected abstract TcoerceFromString(org.zkoss.zul.impl.InputElement editorView, java.lang.String text)Converts string value to a real value.protected abstract TgetRawValue(org.zkoss.zul.impl.InputElement editorView)Extracts value of the given editor component.protected voidhandleChangeEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView)protected voidhandleChangeEvent(EditorListener<T> listener, T value)protected voidhandleChangingEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView, java.lang.String stringValue)protected voidhandleReadOnly(EditorContext<T> context, org.zkoss.zul.impl.InputElement editorView)Utility method that assures proper handling ofreadonly/disabledattributes across different browsers.protected booleanhasInvalidInput(org.zkoss.zul.impl.InputElement editorView)protected voidinitViewComponent(org.zkoss.zul.impl.InputElement editorView, EditorContext<T> context, EditorListener<T> listener)Adds event listeners to this editor component, parses the parameter for initial value etc.booleanisPrimitive()protected voidonCancelEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView, T initialValue)Method called when the user cancelled his input.protected voidonChangeEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView)Method called when the editor value is changed and the editor is not focused anymore.protected voidonChangingEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView, org.zkoss.zk.ui.event.InputEvent event)Method called when something changed in the editor, for example every 1 sec while typing somethingprotected voidonFocusEvent(org.zkoss.zul.impl.InputElement editorView, java.lang.String initialEditText)Method called when the user focuses the Editor.protected voidonOkEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView)Method called when the editor value is setprotected abstract voidsetRawValue(org.zkoss.zul.impl.InputElement editorView, T rawValue)Sets the value to the given editor component.-
Methods inherited from class com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer
extractEmbeddedEditor, extractEmbeddedType, findAncestorEditor, findEmbeddedEditors, getInitialEditString, getL10nDecorator
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hybris.cockpitng.editors.CockpitEditorRenderer
render
-
-
-
-
Field Detail
-
SETTING_INPUT_INSTANT
public static final java.lang.String SETTING_INPUT_INSTANT
- See Also:
- Constant Field Values
-
-
Method Detail
-
initViewComponent
protected void initViewComponent(org.zkoss.zul.impl.InputElement editorView, EditorContext<T> context, EditorListener<T> listener)Adds event listeners to this editor component, parses the parameter for initial value etc.- 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
-
onChangingEvent
protected void onChangingEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView, org.zkoss.zk.ui.event.InputEvent event)
Method called when something changed in the editor, for example every 1 sec while typing something- Parameters:
editorView- the Editorevent-
-
onChangeEvent
protected void onChangeEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView)
Method called when the editor value is changed and the editor is not focused anymore.- Parameters:
listener-editorView- the Editor
-
onOkEvent
protected void onOkEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView)
Method called when the editor value is set- Parameters:
listener-editorView- the Editor
-
onCancelEvent
protected void onCancelEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView, T initialValue)
Method called when the user cancelled his input.- Parameters:
listener-editorView- the Editor
-
onFocusEvent
protected void onFocusEvent(org.zkoss.zul.impl.InputElement editorView, java.lang.String initialEditText)Method called when the user focuses the Editor.- Parameters:
editorView- the EditorinitialEditText-
-
handleChangeEvent
protected void handleChangeEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView)
-
handleChangeEvent
protected void handleChangeEvent(EditorListener<T> listener, T value)
-
handleChangingEvent
protected void handleChangingEvent(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView, java.lang.String stringValue)
-
clearInvalidInputAndNotify
protected void clearInvalidInputAndNotify(EditorListener<T> listener, org.zkoss.zul.impl.InputElement editorView)
-
hasInvalidInput
protected boolean hasInvalidInput(org.zkoss.zul.impl.InputElement editorView)
-
handleReadOnly
protected void handleReadOnly(EditorContext<T> context, org.zkoss.zul.impl.InputElement editorView)
Utility method that assures proper handling ofreadonly/disabledattributes across different browsers.- Parameters:
context- editor contexteditorView- the view of the editor
-
setRawValue
protected abstract void setRawValue(org.zkoss.zul.impl.InputElement editorView, T rawValue)Sets the value to the given editor component.- Parameters:
editorView- the underlying editor componentrawValue- the value
-
getRawValue
protected abstract T getRawValue(org.zkoss.zul.impl.InputElement editorView)
Extracts value of the given editor component.- Parameters:
editorView- the underlying editor component- Returns:
- the value
-
coerceFromString
protected abstract T coerceFromString(org.zkoss.zul.impl.InputElement editorView, java.lang.String text)
Converts string value to a real value.- Parameters:
editorView- the underlying editor componenttext- the string vale- Returns:
- the value
-
isPrimitive
public boolean isPrimitive()
- Returns:
- true if editor has been created for primitive type like int/boolean/decimal/byte/short/long/char. Otherwise it returns false.
-
-