Class CmsSingleFileUploadDialog

  • All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.EventPreview, com.google.gwt.user.client.ui.AcceptsOneWidget, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.HasOneWidget, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, com.google.gwt.user.client.ui.SourcesPopupEvents, java.lang.Iterable<com.google.gwt.user.client.ui.Widget>, I_CmsAutoHider, I_CmsUploadDialog

    public class CmsSingleFileUploadDialog
    extends CmsPopup
    implements I_CmsUploadDialog
    The single file upload dialog.

    • Method Detail

      • addCloseHandler

        public com.google.gwt.event.shared.HandlerRegistration addCloseHandler​(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler)
        Specified by:
        addCloseHandler in interface com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
        Overrides:
        addCloseHandler in class com.google.gwt.user.client.ui.PopupPanel
        See Also:
        PopupPanel.addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler)
      • getFinishAction

        public java.lang.Runnable getFinishAction()
        Returns the action which should be executed when the upload dialog is finished.

        Returns:
        an action to run when the upload dialog is finished
      • parseResponse

        public void parseResponse​(java.lang.String results)
        Parses the upload response of the server and decides what to do.

        Specified by:
        parseResponse in interface I_CmsUploadDialog
        Parameters:
        results - a JSON Object
      • setFinishAction

        public void setFinishAction​(java.lang.Runnable action)
        Sets an action that should be executed if the upload dialog is finished.

        Parameters:
        action - the action to execute when finished
      • showErrorReport

        public void showErrorReport​(java.lang.String message,
                                    java.lang.String stacktrace)
        Shows the error report.

        Specified by:
        showErrorReport in interface I_CmsUploadDialog
        Parameters:
        message - the message to show
        stacktrace - the stacktrace to show
      • cancelReplace

        protected void cancelReplace()
        Cancels the replace process.

      • getResourceType

        protected java.lang.String getResourceType​(CmsFileInfo file)
        Returns the resource type name for a given filename.

        Parameters:
        file - the file info
        Returns:
        the resource type name
      • getUploadService

        protected org.opencms.gwt.shared.rpc.I_CmsUploadServiceAsync getUploadService()
        Returns the upload service instance.

        Returns:
        the upload service instance
      • getUploadUri

        protected java.lang.String getUploadUri()
        Returns the upload JSP uri.

        Returns:
        the upload JSP uri
      • setFileInput

        protected void setFileInput​(CmsFileInput fileInput)
        Sets the file input.

        Parameters:
        fileInput - the file input
      • updateProgress

        protected void updateProgress()
        Retrieves the progress information from the server.

      • updateProgressBar

        protected void updateProgressBar​(org.opencms.gwt.shared.CmsUploadProgessInfo info)
        Updates the progress bar.

        Parameters:
        info - the progress info
      • uploadFile

        protected void uploadFile()
        Uploads the selected file.