org.zkoss.zkmax.zul
Class Dropupload

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zkmax.zul.Dropupload
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Component, Scope, ComponentCtrl

public class Dropupload
extends XulElement

A component can handle drag files into it, and upload files to server.

Default HtmlBasedComponent.getZclass(): z-dropupload.

known supported browser :

  • Chrome (v.19+)
  • Firefox (v.13+)
  • Safari (5.1+)
  • Opera (12.1+)
  • IE (10+)
  • known unsupported browser :

  • IE9
  • Opera (11.x)
  • Since:
    6.5.0
    See Also:
    Serialized Form

    Nested Class Summary
     
    Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
    HtmlBasedComponent.ExtraCtrl
     
    Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
    AbstractComponent.Children
     
    Field Summary
     
    Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
    _zclass
     
    Fields inherited from interface org.zkoss.zk.ui.Component
    APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
     
    Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
    CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
     
    Constructor Summary
    Dropupload()
               
     
    Method Summary
     Component getAnchor()
              Return the anchor of dropupload.
     java.lang.String getContent()
               
     java.lang.String getDetection()
              Return the detection area setting.
     int getMaxsize()
              Get the max size setting of upload file, unit is "KB".
     java.lang.String getViewerClass()
               
     boolean isNative()
              Return the setting that treat the upload file as binary or not.
    protected  void renderProperties(ContentRenderer renderer)
              Renders the content of this component, excluding the enclosing tags and children.
     void service(AuRequest request, boolean everError)
              Process an AU request.
     void setAnchor(Component anchor)
              Set the anchor of dropupload, it allows the dropupload component to anchor to another component and overlay that component when the user drag & drops files to the browser.
     void setContent(java.lang.String value)
              Set the content of component, it will be shown depend on detection setting.
     void setDetection(java.lang.String value)
              Set drag detection area.
     void setMaxsize(int value)
              Set the max size of upload file, unit is "KB".
     void setNative(boolean value)
              Set the setting that treat the upload file as binary or not.
     void setViewerClass(java.lang.String value)
              Set the custom upload viewer class name, if was not specified, will use ZK default upload viewer.
     
    Methods inherited from class org.zkoss.zul.impl.XulElement
    clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
     
    Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
    focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
     
    Methods inherited from class org.zkoss.zk.ui.AbstractComponent
    addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowRoots, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
     
    Methods inherited from class java.lang.Object
    finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    Dropupload

    public Dropupload()
    Method Detail

    setMaxsize

    public void setMaxsize(int value)
    Set 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:
    value - negative value is unlimited, 0 will use Configuration.getMaxUploadSize()

    getMaxsize

    public int getMaxsize()
    Get the max size setting of upload file, unit is "KB". Refer to setMaxsize(int) for more details.


    setDetection

    public void setDetection(java.lang.String value)
    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 do so, the user can't drop file on it.

    Parameters:
    value -

    getDetection

    public java.lang.String getDetection()
    Return the detection area setting. Refer to setDetection(String) for more details.


    setViewerClass

    public void setViewerClass(java.lang.String value)
    Set the custom upload viewer class name, if was not specified, will use ZK default upload viewer.

    Parameters:
    value - custom upload viewer class name.

    getViewerClass

    public java.lang.String getViewerClass()
    Returns:
    custom upload viewer class name.

    setContent

    public void setContent(java.lang.String value)
    Set the content of component, it will be shown depend on detection setting.

    Parameters:
    value - HTML string.
    See Also:
    setDetection(String)

    getContent

    public java.lang.String getContent()
    Returns:
    content of component.

    setNative

    public void setNative(boolean value)
    Set the setting that treat the upload file as binary or not. If true, treat file(s) as binary, i.e., not to convert it to image, audio or text files.


    isNative

    public boolean isNative()
    Return the setting that treat the upload file as binary or not.

    Returns:
    boolean

    setAnchor

    public void setAnchor(Component anchor)
    Set the anchor of dropupload, it allows the dropupload component to anchor to another component and overlay that component when the user drag & drops files to the browser.

    Parameters:
    anchor - of dropupload

    getAnchor

    public Component getAnchor()
    Return the anchor of dropupload.

    Returns:
    Component

    renderProperties

    protected void renderProperties(ContentRenderer renderer)
                             throws java.io.IOException
    Description copied from class: HtmlBasedComponent
    Renders the content of this component, excluding the enclosing tags and children.

    See also ZK Client-side Reference: Property Rendering

    Overrides:
    renderProperties in class XulElement
    Throws:
    java.io.IOException

    service

    public void service(AuRequest request,
                        boolean everError)
    Process an AU request. It will handle Events.ON_UPLOAD and post UploadEvent.

    Specified by:
    service in interface ComponentCtrl
    Overrides:
    service in class HtmlBasedComponent
    everError - whether any error ever occurred before processing this request.
    See Also:
    HtmlBasedComponent.service(org.zkoss.zk.au.AuRequest, boolean)


    Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo