Interface IDropupload
- All Superinterfaces:
IAnyGroup<IDropupload>,IComponent<IDropupload>,IHtmlBasedComponent<IDropupload>,IXulElement<IDropupload>
Dropupload component
A component can handle drag files into it, and upload files to server.
Support @Action
| Name | Action Type |
|---|---|
| onUpload | ActionData: FileData
Denotes user has uploaded a file to the component. |
| onMaxFileCountExceed | Denotes user has uploaded a file to when number of upload files exceed the maxFileCount. |
- Author:
- katherine
- See Also:
-
Dropupload
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIDropupload.static enumSpecifies the detection withwithDetection(Detection)static classBuilds an updater of typeIDropuploadforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IDropuploadConstant for default attributes of this immutable component. -
Method Summary
Modifier and TypeMethodDescriptionReturns the acceptable file types.Return the anchor of dropupload.Returns the content of component, it will be shown depend on detection setting.default StringReturn the detection area setting.default intReturns the maximum number of files user can upload at once, when number of upload files exceed the maxFileCount, nothing will be uploaded and onMaxFileCountExceed action will be triggered, developer can listen to onMaxFileCountExceed and get the number of upload files by callingEvent.getData()default intReturns the max size setting of upload file, unit is "KB".Return the suppressed errors setting.Returns the custom upload viewer class name.default StringReturns the client widget class.default booleanisBinary()Return the setting that treat the upload file as binary or not.static IDropuploadReturns the instance with the given content.static IDropuploadofDetection(String detection) Returns the instance with the given detection.static IDropuploadofDetection(IDropupload.Detection detection) Returns the instance with the given detection.static IDropuploadReturns the instance with the given id.withAccept(String accept) Returns a copy ofthisimmutable component with the specifiedaccept.withAnchorId(String anchorId) Returns a copy ofthisimmutable component with the specifiedanchorId.withBinary(boolean binary) Returns a copy ofthisimmutable component with the specifiedbinary.withContent(String content) Returns a copy ofthisimmutable component with the specifiedviewerClass.withDetection(String detection) Returns a copy ofthisimmutable component with the specifieddetection.default IDropuploadwithDetection(IDropupload.Detection detection) Returns a copy ofthisimmutable component with the specifieddetection.withMaxFileCount(int maxFileCount) Returns a copy ofthisimmutable component with the specifiedmaxFileCount.withMaxsize(int maxsize) Returns a copy ofthisimmutable component with the specifiedsuppressedErrors.withSuppressedErrors(String suppressedErrors) Returns a copy ofthisimmutable component with the specifiedsuppressedErrors.default IDropuploadwithSuppressedErrors(Collection<org.zkoss.zk.ui.ext.Uploadable.Error> suppressedErrors) Returns a copy ofthisimmutable component with the specifiedsuppressedErrors.withViewerClass(String viewerClass) Returns a copy ofthisimmutable component with the specifiedviewerClass.Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zkmax.wgt.Dropupload"- Specified by:
getWidgetClassin interfaceIComponent<IDropupload>- Returns:
-
getViewerClass
Returns the custom upload viewer class name.Default:
null -
withViewerClass
Returns a copy ofthisimmutable component with the specifiedviewerClass.Sets the custom upload viewer class name.
- Parameters:
viewerClass- The custom upload viewer class name.Default:
null- Returns:
- A modified copy of
thisobject
-
getContent
Returns the content of component, it will be shown depend on detection setting. -
withContent
Returns a copy ofthisimmutable component with the specifiedviewerClass.Sets the content of component, it will be shown depend on detection setting.
- Parameters:
content- The content of component to show.Default:
null- Returns:
- A modified copy of
thisobject
-
getAnchorId
Return the anchor of dropupload. -
withAnchorId
Returns a copy ofthisimmutable component with the specifiedanchorId.Sets the anchor of dropupload.
- Parameters:
anchorId- The id of the anchor of dropupload.Default:
null- Returns:
- A modified copy of
thisobject
-
getSuppressedErrors
Return the suppressed errors setting.Default:
null -
withSuppressedErrors
Returns a copy ofthisimmutable component with the specifiedsuppressedErrors.Sets the suppressed errors setting.
- Parameters:
suppressedErrors- The suppressed errors settingDefault:
null- Returns:
- A modified copy of
thisobject
-
withSuppressedErrors
default IDropupload withSuppressedErrors(Collection<org.zkoss.zk.ui.ext.Uploadable.Error> suppressedErrors) Returns a copy ofthisimmutable component with the specifiedsuppressedErrors.Sets the suppressed errors setting.
- Parameters:
suppressedErrors- The suppressed errors settingDefault:
null- Returns:
- A modified copy of
thisobject
-
getMaxsize
default int getMaxsize()Returns the max size setting of upload file, unit is "KB".Default:
Configuration.getMaxUploadSize() -
withMaxsize
Returns a copy ofthisimmutable component with the specifiedsuppressedErrors.Sets the max size of upload file, unit is "KB". Notice: All the files in one drag-and-drop action must smaller than max size, or nothing will upload.
- Parameters:
maxsize- Negative value is unlimited, 0 will useConfiguration.getMaxUploadSize()Default:
Configuration.getMaxUploadSize()- Returns:
- A modified copy of
thisobject
-
getDetection
Return the detection area setting. Refer towithDetection(String)for more details.Default:
"browser" -
withDetection
Returns a copy ofthisimmutable component with the specifieddetection.Set drag detection area. When mouse drag over the detection area, it will show content. There are four accept value :
"browser": whole browser, default value."none": disable detection."self": the Dropupload itself."$id": the id value of specified widget. If specified widget is not exist, will use default setting.
- Parameters:
detection- Te drag detection areaDefault:
"browser"- Returns:
- A modified copy of
thisobject
-
withDetection
Returns a copy ofthisimmutable component with the specifieddetection.Set drag detection area. When mouse drag over the detection area, it will show content. There are four accept value :
"browser": whole browser, default value."none": disable detection."self": the Dropupload itself."$id": the id value of specified widget. If specified widget is not exist, will use default setting.
- Parameters:
detection- Te drag detection areaDefault:
"browser"- Returns:
- A modified copy of
thisobject
-
isBinary
default boolean isBinary()Return the setting that treat the upload file as binary or not.Default:
false -
withBinary
Returns a copy ofthisimmutable component with the specifiedbinary.Sets the setting that treat the upload file as binary or not.
- Parameters:
binary- The setting that treat the upload file as binary or not.Default:
false- Returns:
- A modified copy of
thisobject
-
getMaxFileCount
default int getMaxFileCount()Returns the maximum number of files user can upload at once, when number of upload files exceed the maxFileCount, nothing will be uploaded and onMaxFileCountExceed action will be triggered, developer can listen to onMaxFileCountExceed and get the number of upload files by callingEvent.getData()Default:
-1 -
withMaxFileCount
Returns a copy ofthisimmutable component with the specifiedmaxFileCount.Sets the maximum number of files user can upload at once, when number of upload files exceed the maxFileCount, nothing will be uploaded and onMaxFileCountExceed action will be triggered, developer can listen to onMaxFileCountExceed and get the number of upload files by calling
Event.getData()- Parameters:
maxFileCount- The maximum number of files user can upload at once.Default:
-1- Returns:
- A modified copy of
thisobject
-
getAccept
Returns the acceptable file types. -
withAccept
Returns a copy ofthisimmutable component with the specifiedaccept.Sets the acceptable file types.
- Parameters:
accept- The MIME type format string, to set multiple rules, separate rules by `,`.- Returns:
- A modified copy of
thisobject
-
of
Returns the instance with the given content.- Parameters:
content- The content of the component to show.
-
ofDetection
Returns the instance with the given detection.- Parameters:
detection- The detection of the component
-
ofDetection
Returns the instance with the given detection.- Parameters:
detection- The detection of the component
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-