Class CollectionUIEditor
- java.lang.Object
-
- de.hybris.platform.cockpit.model.editor.impl.AbstractUIEditor
-
- de.hybris.platform.cockpit.model.referenceeditor.impl.AbstractReferenceUIEditor
-
- de.hybris.platform.cockpit.model.referenceeditor.collection.CollectionUIEditor
-
- All Implemented Interfaces:
ReferenceUIEditor,UIEditor
- Direct Known Subclasses:
CollectionUIEditorMedia
public class CollectionUIEditor extends AbstractReferenceUIEditor
Simplistic Reference Collection Editor. Note:
User now is able to select some values directly from auto completed list using both mouse and keyboard - this caused that this component is more intuitive an user-friendly.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.cockpit.model.editor.impl.AbstractUIEditor
AbstractUIEditor.CancelButtonContainer, AbstractUIEditor.CancelListener, AbstractUIEditor.ErrorDiv
-
-
Field Summary
Fields Modifier and Type Field Description protected CollectionUIEditorControllercollectionControllerprotected CollectionEditorcollectionEditorprotected DefaultCollectionEditorModelmodel-
Fields inherited from class de.hybris.platform.cockpit.model.editor.impl.AbstractUIEditor
ATTRIBUTE_QUALIFIER_PARAM, CANCEL_BTN, EVENT_SOURCE, inEditMode, initialEditValue, initialInputString, PROPERTY_DESCRIPTOR_PARAM, SEARCH_MODE_PARAM
-
Fields inherited from interface de.hybris.platform.cockpit.model.editor.ReferenceUIEditor
ALLOW_CREATE_PARAM_KEY
-
Fields inherited from interface de.hybris.platform.cockpit.model.editor.UIEditor
INITIAL_EDIT_STRING
-
-
Constructor Summary
Constructors Constructor Description CollectionUIEditor()CollectionUIEditor(ObjectType rootType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassignedPassedValue(java.lang.Object initialValue)Assigns aninitialValueas a editor value.CollectionEditorcreateCollectionEditor(EditorListener listener, AdditionalReferenceEditorListener additionalListener)org.zkoss.zk.ui.HtmlBasedComponentcreateViewComponent(java.lang.Object initialValue, java.util.Map<java.lang.String,? extends java.lang.Object> parameters, EditorListener listener)Creates a new editor component and attaches it to the specifiedPagepage.protected DefaultCollectionEditorModelgetModel()ObjectTypegetRootSearchType()Returns the type for which this reference collection editor should search for.ObjectTypegetRootType()Returns the root type of this reference collection editor i.e.java.lang.ObjectgetValue()Returns the value held by this editor.booleanisInline()Returns whether this editor is an inline editor or not.protected voidregisterEventListeners(AbstractUIEditor.CancelButtonContainer cancelButtonContainer)Registers all necessary event listeners in order to correct serve selectors events.voidsetRootSearchType(ObjectType rootSearchType)Sets the type for which this reference selector should search for.voidsetRootType(ObjectType rootType)Sets the root type of this reference editor i.e.voidsetValue(java.lang.Object value)Sets the value of this editor tovalue.-
Methods inherited from class de.hybris.platform.cockpit.model.referenceeditor.impl.AbstractReferenceUIEditor
findMaxAutocompleteSearchResults, getBooleanParameter, getEditorType, isAllowCreate, setAllowCreate
-
Methods inherited from class de.hybris.platform.cockpit.model.editor.impl.AbstractUIEditor
applyReferenceRelatedAttributes, createEditor, createEditor, createEditor, createEditor, filterValues, fireValueChanged, getRootSearchType, getUIEditor, isEditable, isEditable, isOptional, isSearchMode, parseInitialInputString, parseTemplateCodes, persistValues, persistValues, setEditable, setFocus, setOptional
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.cockpit.model.editor.UIEditor
isEditable, isOptional, setEditable, setFocus, setOptional
-
-
-
-
Field Detail
-
model
protected DefaultCollectionEditorModel model
-
collectionEditor
protected CollectionEditor collectionEditor
-
collectionController
protected CollectionUIEditorController collectionController
-
-
Constructor Detail
-
CollectionUIEditor
public CollectionUIEditor()
-
CollectionUIEditor
public CollectionUIEditor(ObjectType rootType)
-
-
Method Detail
-
setRootType
public void setRootType(ObjectType rootType)
Description copied from interface:ReferenceUIEditorSets the root type of this reference editor i.e. the root type of the references which this editor holds.- Parameters:
rootType- the root type
-
setRootSearchType
public void setRootSearchType(ObjectType rootSearchType)
Description copied from interface:ReferenceUIEditorSets the type for which this reference selector should search for. Note: Generally, ifrootSearchTypeisnull, the set root type will be used.
-
createViewComponent
public org.zkoss.zk.ui.HtmlBasedComponent createViewComponent(java.lang.Object initialValue, java.util.Map<java.lang.String,? extends java.lang.Object> parameters, EditorListener listener)Description copied from interface:UIEditorCreates a new editor component and attaches it to the specifiedPagepage.- Parameters:
initialValue- editor's initial valueparameters- parameters passed via configuration for particular editorlistener- theEditorListenerthat will receive events when the editor's value is changed- Returns:
- the editor component
-
registerEventListeners
protected void registerEventListeners(AbstractUIEditor.CancelButtonContainer cancelButtonContainer)
Registers all necessary event listeners in order to correct serve selectors events.- Parameters:
cancelButtonContainer- wrapped editor
-
getValue
public java.lang.Object getValue()
Description copied from interface:UIEditorReturns the value held by this editor.- Specified by:
getValuein interfaceUIEditor- Overrides:
getValuein classAbstractUIEditor- Returns:
- this editor's value
-
isInline
public boolean isInline()
Description copied from interface:UIEditorReturns whether this editor is an inline editor or not.- Returns:
- true, if inline
-
setValue
public void setValue(java.lang.Object value)
Description copied from interface:UIEditorSets the value of this editor tovalue. Note: Does not have anything to do with value persistence, it is only for setting the value to be displayed. However, depending on the view component implementation and the specifiedEditorListenerthe underlying view component might generate an event which causes theEditorListener.valueChanged(Object)method to be called.- Specified by:
setValuein interfaceUIEditor- Overrides:
setValuein classAbstractUIEditor- Parameters:
value- the value to set
-
getRootSearchType
public ObjectType getRootSearchType()
Description copied from interface:ReferenceUIEditorReturns the type for which this reference collection editor should search for. Generally, if no root search type has been explicitly set, this method returns the same type asReferenceUIEditor.getRootType(). Note: The root search type is actually the type of the items held by this editor, whereas root type is the type which should be used for persisting values.- Returns:
- the type for which this reference collection editor should search for
- See Also:
ReferenceUIEditor.getRootType()
-
getRootType
public ObjectType getRootType()
Description copied from interface:ReferenceUIEditorReturns the root type of this reference collection editor i.e. the type of the items which this editor should hold references to. Note: If the root search type differs from the root type, this editor will actually hold items of the type returned byReferenceUIEditor.getRootSearchType(). In this case information about the root type is generally needed for value handling.- Returns:
- the root type of this editor
- See Also:
ReferenceUIEditor.getRootSearchType()
-
getModel
protected DefaultCollectionEditorModel getModel()
-
assignedPassedValue
protected void assignedPassedValue(java.lang.Object initialValue)
Assigns aninitialValueas a editor value.- Parameters:
initialValue- editor's current initial value
-
createCollectionEditor
public CollectionEditor createCollectionEditor(EditorListener listener, AdditionalReferenceEditorListener additionalListener)
-
-