Class LoadingEvent


  • public final class LoadingEvent
    extends JadiceEvent<LoadingEvent.Handler>
    An Event fired to indicate that something (tiles/document) is currently loading or the loading has finished.
    • Constructor Detail

      • LoadingEvent

        public LoadingEvent​(com.google.gwt.event.shared.HasHandlers source,
                            LoadingEvent.LoadingState loadingState,
                            Object loadingObject,
                            String errorMessage)
        Create a new LoadingEvent
        Parameters:
        source - the source of the event
        loadingState - the LoadingEvent.LoadingState
        loadingObject - the object which is/was loading for example a Tile or a Document
        errorMessage - the error message when the loading failed due to an error
    • Method Detail

      • fire

        public static <T> void fire​(com.google.gwt.event.shared.HasHandlers source,
                                    LoadingEvent.LoadingState loadingState,
                                    Object loadingObject,
                                    String errorMessage)
        Fires a new LoadingEvent
        Parameters:
        source - the source of the event
        loadingState - the LoadingEvent.LoadingState
        loadingObject - the object which is/was loading for example a Tile or a Document
        errorMessage - the error message when the loading failed due to an error
      • getLoadingObject

        public Object getLoadingObject()
      • getErrorMessage

        public String getErrorMessage()
        If the loading failed due to an error this will return an error message or an HTTP status code.

        In some cases the message can differ from the reason why the loading failed. This happens when loading an image via an image tag. We don't get information about the failure form the error event of the onerror-function of the image tag so we return the most likely reason by returning the fetch response.

        Returns:
        an error message
      • getAssociatedType

        public com.google.gwt.event.shared.GwtEvent.Type<LoadingEvent.Handler> getAssociatedType()
        Specified by:
        getAssociatedType in class com.google.gwt.event.shared.GwtEvent<LoadingEvent.Handler>