Class MultiDragAndDropFileUploadEditor
- java.lang.Object
-
- com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer<T>
-
- com.hybris.cockpitng.editor.dndfileupload.AbstractDragAndDropFileUploadEditor<java.util.Collection<FileUploadResult>>
-
- com.hybris.cockpitng.editor.dndfileupload.MultiDragAndDropFileUploadEditor
-
- All Implemented Interfaces:
CockpitEditorRenderer<java.util.Collection<FileUploadResult>>
public class MultiDragAndDropFileUploadEditor extends AbstractDragAndDropFileUploadEditor<java.util.Collection<FileUploadResult>>
Multi file upload editor. Accepted params:- accept - specifies the MIME types of files that the server accepts e.g "audio/|video/|image/*"
- maxsize - defines max file size, if not defined then default system value will be used (property fileUpload.maxSize)
- singleLineMode - when set to true upload content will be displayed in single line
- selectedItemsMaxSize - defines number of uploaded elements when list scroll should be shown
Listbox.setRows(int). Default value: 5.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SELECTED_ITEMS_MAX_SIZEprotected static java.lang.StringEDITOR_CONTAINER_SCLASSprotected static java.lang.StringEDITOR_PREFIXprotected static java.lang.StringLABEL_UNSUPPORTED_UPLOADprotected static java.lang.StringPARAM_SELECTED_ITEMS_MAX_SIZE-
Fields inherited from class com.hybris.cockpitng.editor.dndfileupload.AbstractDragAndDropFileUploadEditor
DEFAULT_MAX_FILE_SIZE, FILE_UPLOAD_MAX_SIZE, LABEL_DROPCONTENT, LABEL_UNSUPPORTED_FILETYPE, LABEL_UPLOAD, PARAM_ACCEPT, PARAM_MAX_SIZE, PARAM_SINGLE_LINE_MODE, UNLIMITED_FILE_SIZE
-
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 MultiDragAndDropFileUploadEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.zkoss.zul.ListboxcreateUploadedFilesList(EditorContext<java.util.Collection<FileUploadResult>> context, EditorListener<java.util.Collection<FileUploadResult>> listener)protected java.util.Optional<org.zkoss.zul.Image>getContentImageWithZoom(org.zkoss.zk.ui.Component container, FileUploadResult fileUploadResult)protected java.lang.StringgetEditorSclass()protected intgetSelectedReferencesMaxSize(EditorContext<java.util.Collection<FileUploadResult>> context)protected java.lang.StringgetUpload(EditorContext<java.util.Collection<FileUploadResult>> context)protected voidonUpload(org.zkoss.zul.Listbox uploadedList, org.zkoss.zk.ui.event.UploadEvent event, EditorContext<java.util.Collection<FileUploadResult>> context, EditorListener<java.util.Collection<FileUploadResult>> listener)voidrender(org.zkoss.zk.ui.Component parent, EditorContext<java.util.Collection<FileUploadResult>> context, EditorListener<java.util.Collection<FileUploadResult>> listener)Creates a new editor component and attaches it to the specifiedComponentcomponent.protected voidrenderUploadedFile(org.zkoss.zul.Listitem item, FileUploadResult data, int index, EditorContext<java.util.Collection<FileUploadResult>> context, java.util.function.BiConsumer<java.lang.Integer,FileUploadResult> onRemoveReference)protected voidshowUnsupportedMediaMessage(org.zkoss.zk.ui.Component messageAnchor, EditorContext<java.util.Collection<FileUploadResult>> context)-
Methods inherited from class com.hybris.cockpitng.editor.dndfileupload.AbstractDragAndDropFileUploadEditor
addImageZoomPopup, createDropUpload, createFileUpload, createUploadContainer, extractUploadedData, getCockpitProperties, getContentImage, getContentTypeImage, getMaxFileSize, getObjectPreviewService, isCorrectFileSize, isSingleLineModeEnabled, isUploadedMediaAcceptable, matchContentType, showUnsupportedMediaMessage, toFileUploadResult
-
Methods inherited from class com.hybris.cockpitng.editors.impl.AbstractCockpitEditorRenderer
extractEmbeddedEditor, extractEmbeddedType, findAncestorEditor, findEmbeddedEditors, getInitialEditString, getL10nDecorator
-
-
-
-
Field Detail
-
DEFAULT_SELECTED_ITEMS_MAX_SIZE
public static final int DEFAULT_SELECTED_ITEMS_MAX_SIZE
- See Also:
- Constant Field Values
-
EDITOR_PREFIX
protected static final java.lang.String EDITOR_PREFIX
- See Also:
- Constant Field Values
-
EDITOR_CONTAINER_SCLASS
protected static final java.lang.String EDITOR_CONTAINER_SCLASS
- See Also:
- Constant Field Values
-
PARAM_SELECTED_ITEMS_MAX_SIZE
protected static final java.lang.String PARAM_SELECTED_ITEMS_MAX_SIZE
- See Also:
- Constant Field Values
-
LABEL_UNSUPPORTED_UPLOAD
protected static final java.lang.String LABEL_UNSUPPORTED_UPLOAD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEditorSclass
protected java.lang.String getEditorSclass()
- Specified by:
getEditorSclassin classAbstractDragAndDropFileUploadEditor<java.util.Collection<FileUploadResult>>
-
render
public void render(org.zkoss.zk.ui.Component parent, EditorContext<java.util.Collection<FileUploadResult>> context, EditorListener<java.util.Collection<FileUploadResult>> 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
-
onUpload
protected void onUpload(org.zkoss.zul.Listbox uploadedList, org.zkoss.zk.ui.event.UploadEvent event, EditorContext<java.util.Collection<FileUploadResult>> context, EditorListener<java.util.Collection<FileUploadResult>> listener)
-
createUploadedFilesList
protected org.zkoss.zul.Listbox createUploadedFilesList(EditorContext<java.util.Collection<FileUploadResult>> context, EditorListener<java.util.Collection<FileUploadResult>> listener)
-
getSelectedReferencesMaxSize
protected int getSelectedReferencesMaxSize(EditorContext<java.util.Collection<FileUploadResult>> context)
-
renderUploadedFile
protected void renderUploadedFile(org.zkoss.zul.Listitem item, FileUploadResult data, int index, EditorContext<java.util.Collection<FileUploadResult>> context, java.util.function.BiConsumer<java.lang.Integer,FileUploadResult> onRemoveReference)
-
getContentImageWithZoom
protected java.util.Optional<org.zkoss.zul.Image> getContentImageWithZoom(org.zkoss.zk.ui.Component container, FileUploadResult fileUploadResult)
-
showUnsupportedMediaMessage
protected void showUnsupportedMediaMessage(org.zkoss.zk.ui.Component messageAnchor, EditorContext<java.util.Collection<FileUploadResult>> context)
-
getUpload
protected java.lang.String getUpload(EditorContext<java.util.Collection<FileUploadResult>> context)
- Overrides:
getUploadin classAbstractDragAndDropFileUploadEditor<java.util.Collection<FileUploadResult>>
-
-