com.sun.lwuit.html
Class DefaultDocumentRequestHandler

java.lang.Object
  extended by com.sun.lwuit.html.DefaultDocumentRequestHandler
All Implemented Interfaces:
AsyncDocumentRequestHandler, DocumentRequestHandler

public class DefaultDocumentRequestHandler
extends java.lang.Object
implements AsyncDocumentRequestHandler

Default implementation of the HTML components document request handler to allow simple HTML support in LWUIT. This version includes only the basics supported by MIDP e.g. resources and jar file URL's such as jar:// and res://

Author:
Shai Almog

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sun.lwuit.html.AsyncDocumentRequestHandler
AsyncDocumentRequestHandler.IOCallback
 
Constructor Summary
DefaultDocumentRequestHandler()
           
 
Method Summary
static Resources getResFile()
          Allows URL's referring to a res:// local resource to default to this file
 java.io.InputStream 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.
 void resourceRequestedAsync(DocumentInfo docInfo, AsyncDocumentRequestHandler.IOCallback callback)
          This method is called by HTMLComponent when a resource is requested asynchronously.
static void setResFile(Resources res)
          Allows URL's referring to a local:// local resource to default to this file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDocumentRequestHandler

public DefaultDocumentRequestHandler()
Method Detail

resourceRequestedAsync

public void resourceRequestedAsync(DocumentInfo docInfo,
                                   AsyncDocumentRequestHandler.IOCallback callback)
Description copied from interface: AsyncDocumentRequestHandler
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.

Specified by:
resourceRequestedAsync in interface AsyncDocumentRequestHandler
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.

resourceRequested

public java.io.InputStream resourceRequested(DocumentInfo docInfo)
Description copied from interface: DocumentRequestHandler
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.

Specified by:
resourceRequested in interface DocumentRequestHandler
Parameters:
docInfo - A DocumentInfo object representing the requested URL and its attributes
Returns:
the document at the URL as an InputStream

getResFile

public static Resources getResFile()
Allows URL's referring to a res:// local resource to default to this file

Returns:
the resFile

setResFile

public static void setResFile(Resources res)
Allows URL's referring to a local:// local resource to default to this file

Parameters:
resFile - the res to set