Class AsyncDocumentRequestHandlerImpl
java.lang.Object
com.codename1.ui.html.DefaultDocumentRequestHandler
com.codename1.ui.html.AsyncDocumentRequestHandlerImpl
- All Implemented Interfaces:
AsyncDocumentRequestHandler, DocumentRequestHandler
Implementation of the HTML components document request handler to allow simple
HTML support in CodenameOne.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConnectionRequestcreateConnectionRequest(DocumentInfo docInfo, IOCallback callback, Object[] response) resourceRequested(DocumentInfo docInfo) Implementations should return the document in the requested url as an InputStream This is triggered only for the main document requested and not for its resources.voidresourceRequestedAsync(DocumentInfo docInfo, IOCallback callback) This method is called by HTMLComponent when a resource is requested asynchronously.Methods inherited from class DefaultDocumentRequestHandler
getResFile, isTrackVisitedURLs, setResFile, setTrackVisitedURLs, visitingURL, wasURLVisitedModifier and TypeMethodDescriptionstatic ResourcesAllows URL's referring to a res:// local resource to default to this filebooleanAllows tracking whether a URL was visited or notstatic voidsetResFile(Resources res) Allows URL's referring to a local:// local resource to default to this filevoidsetTrackVisitedURLs(boolean trackVisitedURLs) Allows tracking whether a URL was visited or notprotected voidvisitingURL(String url) This method can be invoked to indicate a URL was visited fro trackingbooleanwasURLVisited(String url) Returns true if the URL was visited, requires trackVisitedURLs to be trueMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Field Details
-
LOCK
-
-
Constructor Details
-
AsyncDocumentRequestHandlerImpl
public AsyncDocumentRequestHandlerImpl()
-
-
Method Details
-
resourceRequestedAsync
This method is called by HTMLComponent when a resource is requested asynchronously. This method should return immediately and start a process of fetching the requested resource on another thread. When the resource was fetched, the HTMLComponent.streamReady should be called.
Parameters
-
docInfo: A DocumentInfo object representing the requested URL and its attributes -
callback: The HTMLComponent that should be called back when the stream was fetched.
- Specified by:
resourceRequestedAsyncin interfaceAsyncDocumentRequestHandler- Overrides:
resourceRequestedAsyncin classDefaultDocumentRequestHandler
-
-
resourceRequested
Implementations should return the document in the requested url as an InputStream This is triggered only for the main document requested and not for its resources.
Parameters
docInfo: A DocumentInfo object representing the requested URL and its attributes
Returns
the document at the URL as an InputStream
- Specified by:
resourceRequestedin interfaceDocumentRequestHandler- Overrides:
resourceRequestedin classDefaultDocumentRequestHandler
-
createConnectionRequest
protected ConnectionRequest createConnectionRequest(DocumentInfo docInfo, IOCallback callback, Object[] response)
-