Class AbstractCockpitEditorRenderer<T>
- java.lang.Object
-
- com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer<T>
-
- All Implemented Interfaces:
CockpitEditorRenderer<T>
- Direct Known Subclasses:
AbstractBooleanEditorRenderer,AbstractDragAndDropFileUploadEditor,AbstractEditorRendererWrapper,AbstractLocalizedEditor,AbstractPaginableEditorRenderer,AbstractTextBasedEditorRenderer,CollectionLabelRenderer,CompareViewLabelRendererWrapper,DefaultClassEditor,DefaultEnumEditor,DefaultFileUploadEditor,DefaultPasswordEditor,DefaultRangeEditor,DefaultZulCockpitEditorRenderer,ItemPreviewLabelRenderer,WysiwygEditor
public abstract class AbstractCockpitEditorRenderer<T> extends java.lang.Object implements CockpitEditorRenderer<T>
Abstract implementation ofCockpitEditorRendererinterface. Implements the common mechanisms for the editors.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHEADER_LABEL_TOOLTIPprotected static java.lang.StringON_ADD_EVENTprotected static java.lang.StringON_DELETE_EVENTprotected static java.lang.StringYW_EDITOR_AREA_LABEL_CONTAINER-
Fields inherited from interface com.hybris.cockpitng.editors.CockpitEditorRenderer
INITIAL_EDIT_STRING
-
-
Constructor Summary
Constructors Constructor Description AbstractCockpitEditorRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringextractEmbeddedEditor(java.lang.String editor)protected java.lang.StringextractEmbeddedType(EditorContext<T> context)Utility method providing a way for editors with editorType like Range(java.lang.Integer) to retrieve the embedded type Integer.protected EditorfindAncestorEditor(org.zkoss.zk.ui.Component component)Find first component in hierarchy which is an Editorprotected java.util.List<Editor>findEmbeddedEditors(org.zkoss.zk.ui.Component component)Finds embedded editors for given component.protected java.lang.StringgetInitialEditString(EditorContext<T> context)Retrieves theCockpitEditorRenderer.INITIAL_EDIT_STRINGfield from the editor parameters.protected java.lang.StringgetL10nDecorator(EditorContext<T> context, java.lang.String parameterKey, java.lang.String defaultFallbackL10nKey)Retrieves the value for this Editor's label in the order: As L10n value, provided raw value, default L10n value if nothing is specified.-
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
-
YW_EDITOR_AREA_LABEL_CONTAINER
protected static final java.lang.String YW_EDITOR_AREA_LABEL_CONTAINER
- See Also:
- Constant Field Values
-
HEADER_LABEL_TOOLTIP
public static final java.lang.String HEADER_LABEL_TOOLTIP
- See Also:
- Constant Field Values
-
ON_DELETE_EVENT
protected static final java.lang.String ON_DELETE_EVENT
- See Also:
- Constant Field Values
-
ON_ADD_EVENT
protected static final java.lang.String ON_ADD_EVENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInitialEditString
protected java.lang.String getInitialEditString(EditorContext<T> context)
Retrieves theCockpitEditorRenderer.INITIAL_EDIT_STRINGfield from the editor parameters.- Parameters:
context- contains various parameters
-
extractEmbeddedType
protected java.lang.String extractEmbeddedType(EditorContext<T> context)
Utility method providing a way for editors with editorType like Range(java.lang.Integer) to retrieve the embedded type Integer.- Parameters:
context- to extract the editor type from- Returns:
- The editor embedded editorType or null if no embedded type is referenced in editorType.
-
extractEmbeddedEditor
protected java.lang.String extractEmbeddedEditor(java.lang.String editor)
-
getL10nDecorator
protected java.lang.String getL10nDecorator(EditorContext<T> context, java.lang.String parameterKey, java.lang.String defaultFallbackL10nKey)
Retrieves the value for this Editor's label in the order: As L10n value, provided raw value, default L10n value if nothing is specified. Might return null if both parameterKey and defaultFallbackL10nKey are invalid.- Parameters:
context- Contains various parametersparameterKey- A parameter name to which an L10n key is assigned.defaultFallbackL10nKey- An L10n key's value to display when no key is provided as a custom attribute.- Returns:
- label value which must not be necessarily a L10n value.
-
findAncestorEditor
protected Editor findAncestorEditor(org.zkoss.zk.ui.Component component)
Find first component in hierarchy which is an Editor- Parameters:
component- to lookup first nested editor- Returns:
- first found instance of editor or null
-
findEmbeddedEditors
protected java.util.List<Editor> findEmbeddedEditors(org.zkoss.zk.ui.Component component)
Finds embedded editors for given component. If the component is not instance of anEditorthen method will seek embedded editors in ancestor editorfindAncestorEditor(Component)of the component.- Parameters:
component- to look up embedded editors.- Returns:
- list of embedded editors;
-
-