Package com.hybris.cockpitng.editor.text
Class AbstractTextEditor<T>
- java.lang.Object
-
- com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer<T>
-
- com.hybris.cockpitng.editors.impl.AbstractTextBasedEditorRenderer<T>
-
- com.hybris.cockpitng.editor.text.AbstractTextEditor<T>
-
- Type Parameters:
T- supported text classes:String,Character
- All Implemented Interfaces:
CockpitEditorRenderer<T>
- Direct Known Subclasses:
DefaultCharacterEditor,DefaultTextEditor
public abstract class AbstractTextEditor<T> extends AbstractTextBasedEditorRenderer<T>
-
-
Field Summary
-
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 AbstractTextEditor(java.lang.Class<T> valueType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TcoerceFromString(org.zkoss.zul.impl.InputElement editorView, java.lang.String text)Converts string value to a real value.protected java.lang.StringconvertToString(org.zkoss.zul.impl.InputElement editorView, T initialValue)Converts component value to Stringprotected TgetRawValue(org.zkoss.zul.impl.InputElement viewComponent)Extracts value of the given editor component.protected voidinitAdditionalParameters(org.zkoss.zul.Textbox editorView, EditorContext<T> context)Additional initialization of ui component according to specified contextvoidrender(org.zkoss.zk.ui.Component parent, EditorContext<T> context, EditorListener<T> listener)Creates a new editor component and attaches it to the specifiedComponentcomponent.protected voidsetRawValue(org.zkoss.zul.impl.InputElement viewComponent, T rawValue)Sets the value to the given editor component.-
Methods inherited from class com.hybris.cockpitng.editors.impl.AbstractTextBasedEditorRenderer
clearInvalidInputAndNotify, handleChangeEvent, handleChangeEvent, handleChangingEvent, handleReadOnly, hasInvalidInput, initViewComponent, isPrimitive, onCancelEvent, onChangeEvent, onChangingEvent, onFocusEvent, onOkEvent
-
Methods inherited from class com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer
extractEmbeddedEditor, extractEmbeddedType, findAncestorEditor, findEmbeddedEditors, getInitialEditString, getL10nDecorator
-
-
-
-
Constructor Detail
-
AbstractTextEditor
public AbstractTextEditor(java.lang.Class<T> valueType)
-
-
Method Detail
-
render
public void render(org.zkoss.zk.ui.Component parent, EditorContext<T> context, EditorListener<T> listener)Description copied from interface:CockpitEditorRendererCreates a new editor component and attaches it to the specifiedComponentcomponent.- Parameters:
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 events
-
initAdditionalParameters
protected void initAdditionalParameters(org.zkoss.zul.Textbox editorView, EditorContext<T> context)Additional initialization of ui component according to specified context- Parameters:
editorView- ui componentcontext- context
-
setRawValue
protected void setRawValue(org.zkoss.zul.impl.InputElement viewComponent, T rawValue)Description copied from class:AbstractTextBasedEditorRendererSets the value to the given editor component.- Specified by:
setRawValuein classAbstractTextBasedEditorRenderer<T>- Parameters:
viewComponent- the underlying editor componentrawValue- the value
-
getRawValue
protected T getRawValue(org.zkoss.zul.impl.InputElement viewComponent)
Description copied from class:AbstractTextBasedEditorRendererExtracts value of the given editor component.- Specified by:
getRawValuein classAbstractTextBasedEditorRenderer<T>- Parameters:
viewComponent- the underlying editor component- Returns:
- the value
-
coerceFromString
protected T coerceFromString(org.zkoss.zul.impl.InputElement editorView, java.lang.String text) throws org.zkoss.zk.ui.WrongValueException
Description copied from class:AbstractTextBasedEditorRendererConverts string value to a real value.- Specified by:
coerceFromStringin classAbstractTextBasedEditorRenderer<T>- Parameters:
editorView- the underlying editor componenttext- the string vale- Returns:
- the value
- Throws:
org.zkoss.zk.ui.WrongValueException
-
convertToString
protected java.lang.String convertToString(org.zkoss.zul.impl.InputElement editorView, T initialValue)Converts component value to String- Parameters:
editorView- ui componentinitialValue- vomponent value- Returns:
- string value
-
-