org.lobobrowser.ua
Interface NavigatorFrame


public interface NavigatorFrame

Represents a navigator frame. In many ways this interface parallels the JavaScript "Window" object.


Method Summary
 void alert(java.lang.String message)
          Opens an alert dialog.
 boolean back()
           
 boolean canBack()
           
 boolean canForward()
           
 void closeWindow()
          Closes the current window, if allowed.
 boolean confirm(java.lang.String message)
          Opens a Yes/No confirmation dialog.
 NavigatorFrame createFrame()
           
 NetworkRequest createNetworkRequest()
          Creates a NetworkRequest object that can be used to load data over HTTP and other network protocols.
 boolean forward()
           
 java.awt.Component getComponent()
          Gets a component for the current frame which could be serve as the parent of pop-up dialogs.
 ComponentContent getComponentContent()
          Gets the component content currently set in the frame.
 NavigationEntry getCurrentNavigationEntry()
          Gets an object that represents the current navigation entry in the frame's history.
 java.lang.String getDefaultStatus()
           
 int getHistoryLength()
          Gets the length for the frame's history.
 NavigationEntry getNextNavigationEntry()
           
 NavigatorFrame getOpenerFrame()
           
 NavigatorFrame getParentFrame()
          Gets the frame that contains the current one, if any.
 NavigationEntry getPreviousNavigationEntry()
           
 NavigatorProgressEvent getProgressEvent()
          Gets the most recent progress event.
 java.lang.String getSourceCode()
          Gets source code for content currently showing, if any.
 java.lang.String getStatus()
           
 NavigatorFrame getTopFrame()
          Gets the top-most frame in the window.
 java.lang.String getWindowId()
           
 void invokeLater(java.lang.Runnable runnable)
          Executes a task later in the event dispatch thread.
 boolean isWindowClosed()
           
 void linkClicked(java.net.URL url, TargetType targetType, java.lang.Object linkObject)
          Similar to navigate(java.net.URL, String, ParameterInfo, TargetType, RequestType), except this method should be called when navigation is triggered by a user click.
 void moveInHistory(int offset)
          Switches to a new navigation entry in the frame's history, according to the given offset.
 void navigate(java.lang.String urlOrPath)
          Navigates to a URL in the current frame.
 void navigate(java.lang.String urlOrPath, RequestType requestType)
          Navigates to a URL in the current frame.
 void navigate(java.net.URL url)
          Navigates to a URL in the current frame.
 void navigate(java.net.URL url, RequestType requestType)
          Navigates to a URL in the current frame.
 void navigate(java.net.URL url, java.lang.String method, ParameterInfo paramInfo, TargetType targetType, RequestType requestType)
          Navigates to a URL in the current frame.
 void navigate(java.net.URL url, java.lang.String method, ParameterInfo paramInfo, TargetType targetType, RequestType requestType, NavigatorFrame originatingFrame)
          Navigates to a URL in the current frame.
 void navigateInHistory(java.lang.String absoluteURL)
          Navigates to a URL that exists in the frame's history.
 NavigatorFrame open(java.lang.String urlOrPath)
          Opens a URL in a separate window.
 NavigatorFrame open(java.net.URL url)
          Opens a URL in a separate window.
 NavigatorFrame open(java.net.URL url, java.util.Properties windowProperties)
          Opens a URL in a separate window using the properties provided.
 NavigatorFrame open(java.net.URL url, java.lang.String method, ParameterInfo pinfo)
          Opens a URL in a separate window.
 NavigatorFrame open(java.net.URL url, java.lang.String method, ParameterInfo pinfo, java.lang.String windowId, java.util.Properties windowProperties)
          Opens a URL in a separate window.
 java.lang.String prompt(java.lang.String message, java.lang.String inputDefault)
          Opens a prompt dialog.
 void reload()
           
 void replaceContent(ClientletResponse response, ComponentContent component)
          Replaces the content of the frame.
 void replaceContent(java.awt.Component component)
          A simple alternative to replaceContent(org.lobobrowser.clientlet.ClientletResponse, org.lobobrowser.clientlet.ComponentContent) provided for convenience.
 void resizeWindowBy(int byWidth, int byHeight)
          Resizes the browser window.
 void resizeWindowTo(int width, int height)
          Resizes the browser window.
 void setDefaultStatus(java.lang.String value)
           
 void setProgressEvent(NavigatorProgressEvent event)
          Requests the frame to update its progress state.
 void setProperty(java.lang.String name, java.lang.Object value)
          Sets an implementation-dependent property of the underlying component currently rendered.
 void setStatus(java.lang.String status)
           
 void windowToBack()
          Sends the window of this clientlet context to the back and may cause it to lose focus.
 void windowToFront()
          Sends the window of this clientlet context to the front and may cause it to request focus.
 

Method Detail

open

NavigatorFrame open(java.lang.String urlOrPath)
                    throws java.net.MalformedURLException
Opens a URL in a separate window.

Parameters:
urlOrPath - The absolute URL or file path to open.
Throws:
java.net.MalformedURLException

open

NavigatorFrame open(java.net.URL url)
Opens a URL in a separate window.

Parameters:
url - The URL to open.

open

NavigatorFrame open(java.net.URL url,
                    java.util.Properties windowProperties)
                    throws java.net.MalformedURLException
Opens a URL in a separate window using the properties provided.

Parameters:
url - The URL to open.
windowProperties - Window properties, following Javascript Window.open() conventions.
Throws:
java.net.MalformedURLException

open

NavigatorFrame open(java.net.URL url,
                    java.lang.String method,
                    ParameterInfo pinfo,
                    java.lang.String windowId,
                    java.util.Properties windowProperties)
Opens a URL in a separate window.

Parameters:
windowProperties - Window properties, following Javascript Window.open() conventions.
url - The URL to open.
method - The request method, e.g. GET.
pinfo - The URL parameter information.

open

NavigatorFrame open(java.net.URL url,
                    java.lang.String method,
                    ParameterInfo pinfo)
Opens a URL in a separate window.

Parameters:
url - The URL to open.
method - The request method, e.g. GET.
pinfo - The URL parameter information.

navigate

void navigate(java.lang.String urlOrPath)
              throws java.net.MalformedURLException
Navigates to a URL in the current frame.

Parameters:
urlOrPath - An absolute URL or file path.
Throws:
java.net.MalformedURLException

navigate

void navigate(java.lang.String urlOrPath,
              RequestType requestType)
              throws java.net.MalformedURLException
Navigates to a URL in the current frame.

Parameters:
urlOrPath - An absolute URL or file path.
requestType - The request type.
Throws:
java.net.MalformedURLException

navigate

void navigate(java.net.URL url)
Navigates to a URL in the current frame.

Parameters:
url - An absolute URL.

navigate

void navigate(java.net.URL url,
              RequestType requestType)
Navigates to a URL in the current frame.

Parameters:
url - An absolute URL.
requestType - The request type.

navigate

void navigate(java.net.URL url,
              java.lang.String method,
              ParameterInfo paramInfo,
              TargetType targetType,
              RequestType requestType)
Navigates to a URL in the current frame.

Parameters:
url - An absolute or relative URL.
method - The request method.
paramInfo - The request parameters.
targetType - The frame target type.
requestType - The request type.

navigate

void navigate(java.net.URL url,
              java.lang.String method,
              ParameterInfo paramInfo,
              TargetType targetType,
              RequestType requestType,
              NavigatorFrame originatingFrame)
Navigates to a URL in the current frame. This method should be used when the originating frame of the request differs from the target frame.

Parameters:
url - An absolute or relative URL.
method - The request method.
paramInfo - The request parameters.
targetType - The frame target type.
requestType - The request type.
originatingFrame - The frame where the request originated.

linkClicked

void linkClicked(java.net.URL url,
                 TargetType targetType,
                 java.lang.Object linkObject)
Similar to navigate(java.net.URL, String, ParameterInfo, TargetType, RequestType), except this method should be called when navigation is triggered by a user click.

Parameters:
url - An absolute or relative URL.
targetType - The frame target type.
linkObject - An implementation-dependent object representing what was clicked. For example, in HTML documents the linkObject might be of type org.w3c.dom.html2.HTMLElement.

closeWindow

void closeWindow()
Closes the current window, if allowed.

Throws:
java.lang.SecurityException - If closing the window is now allowed in the current context.

invokeLater

void invokeLater(java.lang.Runnable runnable)
Executes a task later in the event dispatch thread.


windowToBack

void windowToBack()
Sends the window of this clientlet context to the back and may cause it to lose focus.


windowToFront

void windowToFront()
Sends the window of this clientlet context to the front and may cause it to request focus.


confirm

boolean confirm(java.lang.String message)
Opens a Yes/No confirmation dialog.

Parameters:
message - The question text.
Returns:
True only if Yes is selected.

prompt

java.lang.String prompt(java.lang.String message,
                        java.lang.String inputDefault)
Opens a prompt dialog.

Parameters:
message - The question text.
inputDefault - The default prompt value.
Returns:
The text entered by the user.

getComponent

java.awt.Component getComponent()
Gets a component for the current frame which could be serve as the parent of pop-up dialogs. This is not the rendered component.

See Also:
getComponentContent()

alert

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

Parameters:
message - The message shown in the alert dialog.

setProgressEvent

void setProgressEvent(NavigatorProgressEvent event)
Requests the frame to update its progress state.

Parameters:
event - The progress event object.
See Also:
getProgressEvent()

getProgressEvent

NavigatorProgressEvent getProgressEvent()
Gets the most recent progress event.

See Also:
setProgressEvent(NavigatorProgressEvent)t

getParentFrame

NavigatorFrame getParentFrame()
Gets the frame that contains the current one, if any. Returns null for the top frame.


getTopFrame

NavigatorFrame getTopFrame()
Gets the top-most frame in the window. Returns the current frame if its parent is null.


back

boolean back()

forward

boolean forward()

canForward

boolean canForward()

canBack

boolean canBack()

createFrame

NavigatorFrame createFrame()

getDefaultStatus

java.lang.String getDefaultStatus()

setDefaultStatus

void setDefaultStatus(java.lang.String value)

getWindowId

java.lang.String getWindowId()

getOpenerFrame

NavigatorFrame getOpenerFrame()

getStatus

java.lang.String getStatus()

isWindowClosed

boolean isWindowClosed()

setStatus

void setStatus(java.lang.String status)

reload

void reload()

replaceContent

void replaceContent(ClientletResponse response,
                    ComponentContent component)
Replaces the content of the frame.

Throws:
java.security.SecurityException - Thrown when the caller does not have permission to replace the content of the frame.
See Also:
ClientletContext.setResultingContent(Component)

replaceContent

void replaceContent(java.awt.Component component)
A simple alternative to replaceContent(org.lobobrowser.clientlet.ClientletResponse, org.lobobrowser.clientlet.ComponentContent) provided for convenience.

Parameters:
component - A AWT or Swing component.

getSourceCode

java.lang.String getSourceCode()
Gets source code for content currently showing, if any.

Throws:
java.security.SecurityException - Thrown when the caller does not have permission to get the source code.

createNetworkRequest

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


getComponentContent

ComponentContent getComponentContent()
Gets the component content currently set in the frame.


resizeWindowTo

void resizeWindowTo(int width,
                    int height)
Resizes the browser window.

Parameters:
width - The new window width.
height - The new window height.

resizeWindowBy

void resizeWindowBy(int byWidth,
                    int byHeight)
Resizes the browser window.

Parameters:
byWidth - The number of pixels to expand the width by.
byHeight - The number of pixels to expand the height by.

getCurrentNavigationEntry

NavigationEntry getCurrentNavigationEntry()
Gets an object that represents the current navigation entry in the frame's history.


getPreviousNavigationEntry

NavigationEntry getPreviousNavigationEntry()

getNextNavigationEntry

NavigationEntry getNextNavigationEntry()

moveInHistory

void moveInHistory(int offset)
Switches to a new navigation entry in the frame's history, according to the given offset.

Parameters:
offset - A positive or negative number, where -1 is equivalent to back() and +1 is equivalent to forward().

navigateInHistory

void navigateInHistory(java.lang.String absoluteURL)
Navigates to a URL that exists in the frame's history.

Parameters:
absoluteURL - The target URL.

getHistoryLength

int getHistoryLength()
Gets the length for the frame's history.


setProperty

void setProperty(java.lang.String name,
                 java.lang.Object value)
Sets an implementation-dependent property of the underlying component currently rendered. For example, a Cobra-based HTML component accepts properties such as defaultMarginInsets (java.awt.Inset), defaultOverflowX and defaultOverflowY.

Parameters:
name - The name of the property.
value - The value of the property. The type of the value depends on the property and the underlying implementation.


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