org.lobobrowser.clientlet
Interface ClientletContext


public interface ClientletContext

The context in which a clientlet processes a web or file response.

See Also:
ClientletAccess.getCurrentClientletContext()

Method Summary
 void alert(java.lang.String message)
          Opens an alert message dialog.
 ContentBuffer createContentBuffer(java.lang.String contentType, byte[] content)
          Undocumented.
 ContentBuffer createContentBuffer(java.lang.String contentType, java.lang.String content, java.lang.String encoding)
          Undocumented.
 NavigatorFrame createNavigatorFrame()
          Creates a lose navigator frame that may be added to GUI components.
 NetworkRequest createNetworkRequest()
          Creates a NetworkRequest object that can be used to load data over HTTP and other network protocols.
 java.lang.Object getItem(java.lang.String name)
          Gets a data item.
 ManagedStore getManagedStore()
          Gets a managed store instance (a small file system restricted by a quota) corresponding to the host of the clientlet response of this context.
 ManagedStore getManagedStore(java.lang.String hostName)
          Gets a managed store instance (a small file system restricted by a quota) for the host name provided.
 NavigatorFrame getNavigatorFrame()
          Gets the frame interface associated with this context.
 java.util.Properties getOverriddingWindowProperties()
          Gets window properties previously set with overrideWindowProperties(java.util.Properties).
 NavigatorProgressEvent getProgressEvent()
          Gets the progress event most recently set.
 ClientletRequest getRequest()
          Gets the clientlet request.
 ClientletResponse getResponse()
          Gets the clientlet response.
 ComponentContent getResultingContent()
          Gets content previously set with setResultingContent(Component).
 UserAgent getUserAgent()
          Gets a UserAgent instance with information about the current user agent.
 boolean isResultingContentSet()
          Returns true if resulting content has already been set with setResultingContent(ComponentContent).
 void navigate(java.lang.String uri)
          Navigates to the URI provided, which may be absolute or relative to the response URL.
 void overrideWindowProperties(java.util.Properties properties)
          For documents requested in order to open a new window, this method may be invoked to override window properties.
 void setItem(java.lang.String name, java.lang.Object value)
          Sets a data item for later retrieval.
 void setProgressEvent(NavigatorProgressEvent event)
          Sets the current progress state.
 void setProgressEvent(ProgressType progressType, int value, int max)
          Requests the frame to update its progress bar if any.
 void setProgressEvent(ProgressType progressType, int value, int max, java.net.URL url)
          Requests the frame to update its progress bar if any.
 void setResultingContent(java.awt.Component content)
          A simple alternative to setResultingContent(ComponentContent) provided for convenience.
 void setResultingContent(ComponentContent content)
          After processing a response a clientlet should invoke this method to set displayable frame content.
 

Method Detail

setItem

void setItem(java.lang.String name,
             java.lang.Object value)
Sets a data item for later retrieval.

Parameters:
name - The item name.
value - The item value.

getItem

java.lang.Object getItem(java.lang.String name)
Gets a data item.

Parameters:
name - The item name.
Returns:
The item value.

getRequest

ClientletRequest getRequest()
Gets the clientlet request.


getResponse

ClientletResponse getResponse()
Gets the clientlet response.


getUserAgent

UserAgent getUserAgent()
Gets a UserAgent instance with information about the current user agent.


createContentBuffer

ContentBuffer createContentBuffer(java.lang.String contentType,
                                  byte[] content)
Undocumented.


createContentBuffer

ContentBuffer createContentBuffer(java.lang.String contentType,
                                  java.lang.String content,
                                  java.lang.String encoding)
                                  throws java.io.UnsupportedEncodingException
Undocumented.

Throws:
java.io.UnsupportedEncodingException

getManagedStore

ManagedStore getManagedStore()
                             throws java.io.IOException
Gets a managed store instance (a small file system restricted by a quota) corresponding to the host of the clientlet response of this context.

Throws:
java.io.IOException
See Also:
getManagedStore(String)

getManagedStore

ManagedStore getManagedStore(java.lang.String hostName)
                             throws java.io.IOException
Gets a managed store instance (a small file system restricted by a quota) for the host name provided.

Parameters:
hostName - A host whose cookies the caller is allowed to access. For example, if the response host name is test.acme.com, then the hostName parameter can be acme.com but not com.
Throws:
java.security.SecurityException - If the caller doesn't have access to the managed store for the host given.
java.io.IOException

getNavigatorFrame

NavigatorFrame getNavigatorFrame()
Gets the frame interface associated with this context.


setResultingContent

void setResultingContent(ComponentContent content)
After processing a response a clientlet should invoke this method to set displayable frame content.


setResultingContent

void setResultingContent(java.awt.Component content)
A simple alternative to setResultingContent(ComponentContent) provided for convenience. It does not set any properties such as title or source code.


getResultingContent

ComponentContent getResultingContent()
Gets content previously set with setResultingContent(Component). The return value may be null.


navigate

void navigate(java.lang.String uri)
              throws java.net.MalformedURLException
Navigates to the URI provided, which may be absolute or relative to the response URL.

Parameters:
uri - The target URI.
Throws:
java.net.MalformedURLException
See Also:
NavigatorFrame.navigate(String)

overrideWindowProperties

void overrideWindowProperties(java.util.Properties properties)
For documents requested in order to open a new window, this method may be invoked to override window properties. To take effect, this method should be invoked before content is set.

Parameters:
properties - A properties object following JavaScript Window.open() conventions.

getOverriddingWindowProperties

java.util.Properties getOverriddingWindowProperties()
Gets window properties previously set with overrideWindowProperties(java.util.Properties).


isResultingContentSet

boolean isResultingContentSet()
Returns true if resulting content has already been set with setResultingContent(ComponentContent).


setProgressEvent

void setProgressEvent(ProgressType progressType,
                      int value,
                      int max)
Requests the frame to update its progress bar if any.

Parameters:
progressType - The type of progress action.
value - The current progress value.
max - The maximum progress value, which may be -1 to indicate it is unknown.
See Also:
NavigatorFrame.setProgressEvent(NavigatorProgressEvent)

setProgressEvent

void setProgressEvent(ProgressType progressType,
                      int value,
                      int max,
                      java.net.URL url)
Requests the frame to update its progress bar if any.

Parameters:
progressType - The type of progress action.
value - The current progress value.
max - The maximum progress value, which may be -1 to indicate it is unknown.
url - The URL to be shown in progress messages.
See Also:
NavigatorFrame.setProgressEvent(NavigatorProgressEvent)

setProgressEvent

void setProgressEvent(NavigatorProgressEvent event)
Sets the current progress state.

Parameters:
event - The progress event.
See Also:
NavigatorFrame.setProgressEvent(NavigatorProgressEvent), getProgressEvent()

getProgressEvent

NavigatorProgressEvent getProgressEvent()
Gets the progress event most recently set.

See Also:
setProgressEvent(ProgressType, int, int), NavigatorFrame.setProgressEvent(NavigatorProgressEvent)

createNetworkRequest

NetworkRequest createNetworkRequest()
Creates a NetworkRequest object that can be used to load data over HTTP and other network protocols.


alert

void alert(java.lang.String message)
Opens an alert message dialog.

Parameters:
message - An alert message.

createNavigatorFrame

NavigatorFrame createNavigatorFrame()
Creates a lose navigator frame that may be added to GUI components.

See Also:
NavigatorFrame.getComponent(), NavigatorFrame.navigate(String)


SourceForge.net LogoCopyright © 2005, 2006, 2007 The Lobo Project. All Rights Reserved.
[Lobo Home]