Class PlatformFileUploadPanel

    • Field Detail

      • DESTINATION_URI_PROPERTY

        public static final java.lang.String DESTINATION_URI_PROPERTY
        The bound property of the destination URI.
      • DESTINATION_BOOKMARK_PROPERTY

        public static final java.lang.String DESTINATION_BOOKMARK_PROPERTY
        The bound property of the destination bookmark.
    • Constructor Detail

      • PlatformFileUploadPanel

        public PlatformFileUploadPanel​(java.net.URI destinationURI)
        Destination URI constructor.
        Parameters:
        destinationURI - The collection URI representing the base destination of the platform files, either absolute or relative to the application.
        Throws:
        java.lang.NullPointerException - if the given list of platform files and/or destination URI is null.
        java.lang.IllegalArgumentException - if the provided URI is not a collection URI.
        java.lang.IllegalArgumentException - if the provided URI specifies a query and/or fragment.
      • PlatformFileUploadPanel

        public PlatformFileUploadPanel​(java.net.URI destinationURI,
                                       Bookmark destinationBookmark)
        Destination URI and destination bookmark constructor.
        Parameters:
        destinationURI - The collection URI representing the base destination of the platform files, either absolute or relative to the application.
        destinationBookmark - The bookmark to be used in sending resources to the destination URI, or null if there is no bookmark specified.
        Throws:
        java.lang.NullPointerException - if the given list of platform files and/or destination URI is null.
        java.lang.IllegalArgumentException - if the provided URI is not a collection URI.
        java.lang.IllegalArgumentException - if the provided URI specifies a query and/or fragment.
      • PlatformFileUploadPanel

        public PlatformFileUploadPanel()
        Default constructor with a default vertical flow layout.
    • Method Detail

      • getControlPanel

        public Panel getControlPanel()
        Returns:
        The panel containing controls such as buttons.
      • getDestinationURI

        public java.net.URI getDestinationURI()
        Returns:
        The collection URI representing the base destination of the platform files, either absolute or relative to the application, or null if the destination URI has not yet been set.
      • setDestinationURI

        public void setDestinationURI​(java.net.URI newDestinationURI)
        Sets the destination base URI of the upload. This is a bound property.
        Parameters:
        newDestinationURI - The collection URI representing the base destination of the platform files, either absolute or relative to the application.
        Throws:
        java.lang.NullPointerException - if the given URI is null.
        java.lang.IllegalArgumentException - if the provided URI is not a collection URI.
        java.lang.IllegalArgumentException - if the provided URI specifies a query and/or fragment.
        See Also:
        DESTINATION_URI_PROPERTY
      • getDestinationBookmark

        public Bookmark getDestinationBookmark()
        Returns:
        The bookmark to be used in sending resources to the destination URI, or null if there is no bookmark specified.
      • setDestinationBookmark

        public void setDestinationBookmark​(Bookmark newDestinationBookmark)
        Sets the destination bookmark of the upload. This is a bound property.
        Parameters:
        newDestinationBookmark - The bookmark to be used in sending resources to the destination URI, or null if there is no bookmark specified.
        See Also:
        DESTINATION_BOOKMARK_PROPERTY
      • getBrowseActionPrototype

        public ActionPrototype getBrowseActionPrototype()
        Returns:
        The action prototype for browsing the platforom file system.
      • getUploadActionPrototype

        public ActionPrototype getUploadActionPrototype()
        Returns:
        The action prototype for uploading.
      • getCancelActionPrototype

        public ActionPrototype getCancelActionPrototype()
        Returns:
        The action prototype for canceling.
      • updateComponents

        protected void updateComponents()
        Updates the state of components.
      • updatePlatformFileStatusLabel

        protected void updatePlatformFileStatusLabel​(PlatformFile platformFile,
                                                     com.globalmentor.model.TaskState state,
                                                     java.lang.Long progress,
                                                     java.lang.Long completion)
        Updates the status label for an individual platform file.
        Parameters:
        platformFile - The current platform file.
        state - The new transfer state, or null if there is no state.
        progress - The current number of bytes transferred, or null if the bytes transferred is not known.
        completion - The total number of bytes to transfer, or null if the total is not known.
        Throws:
        java.lang.NullPointerException - if the given platform file is null.
      • updateOverallStatusLabel

        protected void updateOverallStatusLabel​(com.globalmentor.model.TaskState state,
                                                java.lang.Long progress,
                                                java.lang.Long completion)
        Updates the status label for the overall progress.
        Parameters:
        state - The new transfer state, or null if there is no state.
        progress - The current number of bytes transferred, or null if the bytes transferred is not known.
        completion - The total number of bytes to transfer, or null if the total is not known.
      • fireProgressed

        protected void fireProgressed​(ProgressEvent<java.lang.Long> progressEvent)
        Fires a given progress event to all registered progress listeners.
        Parameters:
        progressEvent - The progress event to fire.