Class ImageUploader

    • Field Detail

      • EMPTY_PICTURE

        public static final String EMPTY_PICTURE
        The Constant EMPTY_PICTURE.
      • DEFAULT_ACTION

        public static final String DEFAULT_ACTION
        The Constant DEFAULT_ACTION.
    • Constructor Detail

      • ImageUploader

        public ImageUploader()
        Instantiates a new image uploader.
    • Method Detail

      • isPicture

        public static boolean isPicture​(String url)
        是否是图片
        Parameters:
        url - the url
        Returns:
        boolean
      • setUploaderIconUnicode

        public void setUploaderIconUnicode​(String unicode)
      • isFileAcceptable

        protected String isFileAcceptable​(String filename)
        判断文件是否可以被接受.
        Parameters:
        filename - the filename
        Returns:
        the string
      • clearAcceptFileExtension

        public void clearAcceptFileExtension()
        清楚可接受的文件格式.
      • addAcceptFileExtension

        public void addAcceptFileExtension​(String ext)
        添加可以接受的上传文件格式.
        Parameters:
        ext - 可以接受的上传文件后缀 不需要添加 . 如 pdf png apk etc..
      • addAcceptFileExtensions

        public void addAcceptFileExtensions​(String... exts)
        添加可以接受的上传文件格式.
        Parameters:
        exts - 可以接受的上传文件后缀 不需要添加 . 如 pdf png apk etc..
      • removeHTMLTag

        public String removeHTMLTag​(String input)
      • setBasePath

        public void setBasePath​(String path)
        设置图片的相对路径前缀
        Parameters:
        path -
      • setAction

        public void setAction​(String action,
                              String relative)
        设置上传的参数.
        Parameters:
        action - 远程接受文件的URL
        relative - 服务器保存的相对路径
      • getUrl

        public String getUrl()
        Gets url.
        Returns:
        the url
      • setUrl

        public void setUrl​(String url)
        Sets the url.
        Parameters:
        url - the new url
      • setUrl

        public void setUrl​(com.google.gwt.safehtml.shared.SafeUri url)
        Sets url.
        Parameters:
        url - the url
      • getImageTitle

        public String getImageTitle()
        Gets image title.
        Returns:
        the image title
      • setImageTitle

        public void setImageTitle​(String string)
        Sets the image title.
        Parameters:
        string - the new image title
      • setExtra

        public void setExtra​(String value)
        Sets the extra.
        Parameters:
        value - the new extra
      • btnClearClick

        @UiHandler("btnClear")
        public void btnClearClick​(com.google.gwt.event.dom.client.ClickEvent event)