Package org.zkoss.stateless.sul

## Interface IDropupload

- All Superinterfaces:
    `IAnyGroup<IDropupload>`, `IComponent<IDropupload>`, `IHtmlBasedComponent<IDropupload>`, `IXulElement<IDropupload>`

      public interface IDropupload
      extends IXulElement<IDropupload>, IAnyGroup<IDropupload>

  Immutable `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 Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IDropupload.Builder` | Builds instances of type `IDropupload`.
    `static class` | `IDropupload.Detection` | Specifies the detection with `withDetection(Detection)`
    `static class` | `IDropupload.Updater` | Builds an updater of type `IDropupload` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IDropupload` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getAccept()` | Returns the acceptable file types.
    `java.lang.String` | `getAnchorId()` | Return the anchor of dropupload.
    `java.lang.String` | `getContent()` | Returns the content of component, it will be shown depend on detection setting.
    `default java.lang.String` | `getDetection()` | Return the detection area setting.
    `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 calling `Event.getData()`
    `default int` | `getMaxsize()` | Returns the max size setting of upload file, unit is "KB".
    `java.lang.String` | `getSuppressedErrors()` | Return the suppressed errors setting.
    `java.lang.String` | `getViewerClass()` | Returns the custom upload viewer class name.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isBinary()` | Return the setting that treat the upload file as binary or not.
    `static IDropupload` | `of​(java.lang.String content)` | Returns the instance with the given content.
    `static IDropupload` | `ofDetection​(java.lang.String detection)` | Returns the instance with the given detection.
    `static IDropupload` | `ofDetection​(IDropupload.Detection detection)` | Returns the instance with the given detection.
    `static IDropupload` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `IDropupload` | `withAccept​(java.lang.String accept)` | Returns a copy of `this` immutable component with the specified `accept`.
    `IDropupload` | `withAnchorId​(java.lang.String anchorId)` | Returns a copy of `this` immutable component with the specified `anchorId`.
    `IDropupload` | `withBinary​(boolean binary)` | Returns a copy of `this` immutable component with the specified `binary`.
    `IDropupload` | `withContent​(java.lang.String content)` | Returns a copy of `this` immutable component with the specified `viewerClass`.
    `IDropupload` | `withDetection​(java.lang.String detection)` | Returns a copy of `this` immutable component with the specified `detection`.
    `default IDropupload` | `withDetection​(IDropupload.Detection detection)` | Returns a copy of `this` immutable component with the specified `detection`.
    `IDropupload` | `withMaxFileCount​(int maxFileCount)` | Returns a copy of `this` immutable component with the specified `maxFileCount`.
    `IDropupload` | `withMaxsize​(int maxsize)` | Returns a copy of `this` immutable component with the specified `suppressedErrors`.
    `IDropupload` | `withSuppressedErrors​(java.lang.String suppressedErrors)` | Returns a copy of `this` immutable component with the specified `suppressedErrors`.
    `default IDropupload` | `withSuppressedErrors​(java.util.Collection<Uploadable.Error> suppressedErrors)` | Returns a copy of `this` immutable component with the specified `suppressedErrors`.
    `IDropupload` | `withViewerClass​(java.lang.String viewerClass)` | Returns a copy of `this` immutable component with the specified `viewerClass`.

    - ### 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, withWidgetOverrides`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IXulElement

      `getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip`

- - ### Field Detail

    - #### DEFAULT

          static final IDropupload DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zkmax.wgt.Dropupload"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IDropupload>`
      Returns:

    - #### getViewerClass

          @Nullable
          java.lang.String getViewerClass()

      Returns the custom upload viewer class name.

      Default: `null`

    - #### withViewerClass

          IDropupload withViewerClass​(@Nullable
                                      java.lang.String viewerClass)

      Returns a copy of `this` immutable component with the specified `viewerClass`.

      Sets the custom upload viewer class name.

      Parameters:
        `viewerClass` - The custom upload viewer class name.

        Default: `null`

      Returns:
        A modified copy of `this` object

    - #### getContent

          @Nullable
          java.lang.String getContent()

      Returns the content of component, it will be shown depend on detection setting.

    - #### withContent

          IDropupload withContent​(@Nullable
                                  java.lang.String content)

      Returns a copy of `this` immutable component with the specified `viewerClass`.

      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 `this` object

    - #### getAnchorId

          @Nullable
          java.lang.String getAnchorId()

      Return the anchor of dropupload.

    - #### withAnchorId

          IDropupload withAnchorId​(java.lang.String anchorId)

      Returns a copy of `this` immutable component with the specified `anchorId`.

      Sets the anchor of dropupload.

      Parameters:
        `anchorId` - The id of the anchor of dropupload.

        Default: `null`

      Returns:
        A modified copy of `this` object

    - #### getSuppressedErrors

          @Nullable
          java.lang.String getSuppressedErrors()

      Return the suppressed errors setting.

      Default: `null`

    - #### withSuppressedErrors

          IDropupload withSuppressedErrors​(@Nullable
                                           java.lang.String suppressedErrors)

      Returns a copy of `this` immutable component with the specified `suppressedErrors`.

      Sets the suppressed errors setting.

      Parameters:
        `suppressedErrors` - The suppressed errors setting

        Default: `null`

      Returns:
        A modified copy of `this` object

    - #### withSuppressedErrors

          default IDropupload withSuppressedErrors​(java.util.Collection<Uploadable.Error> suppressedErrors)

      Returns a copy of `this` immutable component with the specified `suppressedErrors`.

      Sets the suppressed errors setting.

      Parameters:
        `suppressedErrors` - The suppressed errors setting

        Default: `null`

      Returns:
        A modified copy of `this` object

    - #### getMaxsize

          default int getMaxsize()

      Returns the max size setting of upload file, unit is "KB".

      Default: `Configuration.getMaxUploadSize()`

    - #### withMaxsize

          IDropupload withMaxsize​(int maxsize)

      Returns a copy of `this` immutable component with the specified `suppressedErrors`.

      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 use `Configuration.getMaxUploadSize()`

        Default: `Configuration.getMaxUploadSize()`

      Returns:
        A modified copy of `this` object

    - #### getDetection

          default java.lang.String getDetection()

      Return the detection area setting. Refer to `withDetection(String)` for more details.

      Default: `"browser"`

    - #### withDetection

          IDropupload withDetection​(java.lang.String detection)

      Returns a copy of `this` immutable component with the specified `detection`.

      Set drag detection area. When mouse drag over the detection area, it will show content. There are four accept value :

      1. `"browser"` : whole browser, default value.
      2. `"none"` : disable detection.
      3. `"self"` : the Dropupload itself.
      4. `"$id"` : the id value of specified widget. If specified widget is not exist, will use default setting.
      Notice : The Dropupload with detection="browser" setting can't put together with other Dropupload that detection is not browser. If so, the user can't drop file on it.
      Parameters:
        `detection` - Te drag detection area

        Default: `"browser"`

      Returns:
        A modified copy of `this` object

    - #### withDetection

          default IDropupload withDetection​(IDropupload.Detection detection)

      Returns a copy of `this` immutable component with the specified `detection`.

      Set drag detection area. When mouse drag over the detection area, it will show content. There are four accept value :

      1. `"browser"` : whole browser, default value.
      2. `"none"` : disable detection.
      3. `"self"` : the Dropupload itself.
      4. `"$id"` : the id value of specified widget. If specified widget is not exist, will use default setting.
      Notice : The Dropupload with detection="browser" setting can't put together with other Dropupload that detection is not browser. If so, the user can't drop file on it.
      Parameters:
        `detection` - Te drag detection area

        Default: `"browser"`

      Returns:
        A modified copy of `this` object

    - #### isBinary

          default boolean isBinary()

      Return the setting that treat the upload file as binary or not.

      Default: `false`

    - #### withBinary

          IDropupload withBinary​(boolean binary)

      Returns a copy of `this` immutable component with the specified `binary`.

      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 `this` object

    - #### 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 calling `Event.getData()`

      Default: `-1`

    - #### withMaxFileCount

          IDropupload withMaxFileCount​(int maxFileCount)

      Returns a copy of `this` immutable component with the specified `maxFileCount`.

      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 `this` object

    - #### getAccept

          @Nullable
          java.lang.String getAccept()

      Returns the acceptable file types.

    - #### withAccept

          IDropupload withAccept​(@Nullable
                                 java.lang.String accept)

      Returns a copy of `this` immutable component with the specified `accept`.

      Sets the acceptable file types.

      Parameters:
        `accept` - The MIME type format string, to set multiple rules, separate rules by `,`.
      Returns:
        A modified copy of `this` object

    - #### of

          static IDropupload of​(java.lang.String content)

      Returns the instance with the given content.
      Parameters:
        `content` - The content of the component to show.

    - #### ofDetection

          static IDropupload ofDetection​(IDropupload.Detection detection)

      Returns the instance with the given detection.
      Parameters:
        `detection` - The detection of the component

    - #### ofDetection

          static IDropupload ofDetection​(java.lang.String detection)

      Returns the instance with the given detection.
      Parameters:
        `detection` - The detection of the component

    - #### ofId

          static IDropupload ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component