org.mozilla.jrex.navigation
Class WebNavigationImpl

java.lang.Object
  |
  +--org.mozilla.jrex.navigation.WebNavigationImpl
All Implemented Interfaces:
WebNavigation

public class WebNavigationImpl
extends Object
implements WebNavigation

Class implementing WebNavigation interface.

Version:
1.0
Author:
C.N.Medappa

Constructor Summary
WebNavigationImpl()
           
 
Method Summary
 boolean canGoBack()
          Indicates if the object can go back.
 boolean canGoForward()
          Indicates if the object can go forward.
 URI getCurrentURI()
          Get the currently loaded URI or null.
 Document getDocument()
          Retrieves the current DOM document for the frame, or lazily creates a blank document if there is none.
 URI getReferringURI()
          Get the referring URI for the current open page.
 History getSessionHistory()
          Get the session history object used to store the session history for the session.
 boolean goBack()
          Tells the object to navigate to the previous session history item.
 boolean goForward()
          Tells the object to navigate to the next Forward session history item.
 boolean goToIndex(int index)
          Tells the object to navigate to the session history item at index.
 void loadStream(InputStream inStream, String uri, String contentType, String charset, int loadFlags, String referURI, Object owner, boolean inheritOwner, String target, InputStream postData, InputStream headers)
          Loads a given stream.
 void loadURI(String uri, int loadFlags, String referrer, InputStream postData, InputStream headers)
          Loads a given URI.
 void loadURI(URI uri, int loadFlags, URI referrer, InputStream postData, InputStream headers)
          Loads a given URI.
 void openWindow(short type, String uri, String referrer, String windowName, String features)
          Open a new window.
 void reload(int reloadFlags)
          Tells the Object to reload the current page.
 void setJRexPeer(int jrexPeer)
          The peer JREX Window on which to navigate
 void setSessionHistory(History his)
          Set the session history object used to store the session history for the session.
 void stop(int stopFlags)
          Stops a load of a URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebNavigationImpl

public WebNavigationImpl()
Method Detail

setJRexPeer

public void setJRexPeer(int jrexPeer)
Description copied from interface: WebNavigation
The peer JREX Window on which to navigate

Specified by:
setJRexPeer in interface WebNavigation
Parameters:
jrexPeer - jrex peer window associated with browser component

canGoBack

public boolean canGoBack()
                  throws JRexException
Description copied from interface: WebNavigation
Indicates if the object can go back. If true this indicates that there is back session history available for navigation.

Specified by:
canGoBack in interface WebNavigation
JRexException

canGoForward

public boolean canGoForward()
                     throws JRexException
Description copied from interface: WebNavigation
Indicates if the object can go forward. If true this indicates that there is forward session history available for navigation

Specified by:
canGoForward in interface WebNavigation
JRexException

goBack

public boolean goBack()
               throws JRexException
Description copied from interface: WebNavigation
Tells the object to navigate to the previous session history item. When a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as form values, scroll position) is restored.

Specified by:
goBack in interface WebNavigation
Returns:
true - Backward navigation was successful. false - This call was unexpected at this time. Most likely you can't go back right now.
JRexException

goForward

public boolean goForward()
                  throws JRexException
Description copied from interface: WebNavigation
Tells the object to navigate to the next Forward session history item. When a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as form values, scroll position) is restored.

Specified by:
goForward in interface WebNavigation
Returns:
true - Forward was successful. false - This call was unexpected at this time. Most likely you can't go forward right now.
JRexException

goToIndex

public boolean goToIndex(int index)
                  throws JRexException
Description copied from interface: WebNavigation
Tells the object to navigate to the session history item at index.

Specified by:
goToIndex in interface WebNavigation
Returns:
true - GotoIndex was successful. false - This call was unexpected at this time. Most likely you can't goto that index
JRexException

loadURI

public void loadURI(URI uri,
                    int loadFlags,
                    URI referrer,
                    InputStream postData,
                    InputStream headers)
             throws JRexException
Description copied from interface: WebNavigation
Loads a given URI. This will give priority to loading the requested URI in the object implementing this interface. If it can't be loaded here however, the URL dispatcher will go through its normal process of content loading.

Specified by:
loadURI in interface WebNavigation
Parameters:
uri - The URI string to load.
loadFlags - Flags modifying load behaviour. Generally you will pass LOAD_FLAGS_NONE for this parameter.
referrer - The referring URI. If this argument is NULL, the referring URI will be inferred internally.
postData - InputStream containing POST data for the request.
headers - InputStream containing POST headers for the request.
JRexException
See Also:
WebNavigationConstants

loadURI

public void loadURI(String uri,
                    int loadFlags,
                    String referrer,
                    InputStream postData,
                    InputStream headers)
             throws JRexException
Description copied from interface: WebNavigation
Loads a given URI. This will give priority to loading the requested URI in the object implementing this interface. If it can't be loaded here however, the URL dispatcher will go through its normal process of content loading.

Specified by:
loadURI in interface WebNavigation
Parameters:
uri - The URI string to load.
loadFlags - Flags modifying load behaviour. Generally you will pass LOAD_FLAGS_NONE for this parameter.
referrer - The referring URI. If this argument is NULL, the referring URI will be inferred internally.
postData - InputStream containing POST data for the request.
headers - InputStream containing POST headers for the request.
JRexException

loadStream

public void loadStream(InputStream inStream,
                       String uri,
                       String contentType,
                       String charset,
                       int loadFlags,
                       String referURI,
                       Object owner,
                       boolean inheritOwner,
                       String target,
                       InputStream postData,
                       InputStream headers)
                throws JRexException
Description copied from interface: WebNavigation
Loads a given stream. This will give priority to loading the requested stream in the object implementing this interface. If it can't be loaded here however, the URL dispatched will go through its normal process of content loading.

Specified by:
loadStream in interface WebNavigation
Parameters:
inStream - The input stream that provides access to the data to be loaded. This must be a blocking stream.
uri - The URI representing the stream, or null
contentType - The type (MIME) of data being loaded, null if unknown.
charset - The charset of the data being loaded, null if unknown.
loadFlags - Flags to modify load behaviour. Flags are defined in WebNavigationConstants Use loadStream() specific flags.
referURI - The referring URI for the load.
owner - Owner (security principal), for now it is just a place holder, set it to null.
inheritOwner - If true owner inherits the owner from the referring document.
target - Target for load, like _content, _blank etc.
postData - InputStream containing POST data for the request.
headers - InputStream containing POST headers for the request.
JRexException

openWindow

public void openWindow(short type,
                       String uri,
                       String referrer,
                       String windowName,
                       String features)
                throws JRexException
Description copied from interface: WebNavigation
Open a new window.

Specified by:
openWindow in interface WebNavigation
Parameters:
type - the type of window
uri - to which to open the new window. Must already be escaped if applicable. can be null.
referrer - the refence uri to be used.
windowName - window name from JS window.open. can be null.
features - window features from JS window.open. can be null. Note:- The window attached to this navigator will be parent.
JRexException
See Also:
WebNavigationConstants

reload

public void reload(int reloadFlags)
            throws JRexException
Description copied from interface: WebNavigation
Tells the Object to reload the current page.

Specified by:
reload in interface WebNavigation
Parameters:
reloadFlags - - Flags modifying reload behaviour. Generally you will pass LOAD_FLAGS_NONE for this parameter.
JRexException

stop

public void stop(int stopFlags)
          throws JRexException
Description copied from interface: WebNavigation
Stops a load of a URI.

Specified by:
stop in interface WebNavigation
Parameters:
stopFlags - - Flags indicating the stop behavior.
JRexException

getDocument

public Document getDocument()
                     throws JRexException
Description copied from interface: WebNavigation
Retrieves the current DOM document for the frame, or lazily creates a blank document if there is none. This attribute never returns null except for unexpected error situations.

Specified by:
getDocument in interface WebNavigation
JRexException

getCurrentURI

public URI getCurrentURI()
                  throws JRexException
Description copied from interface: WebNavigation
Get the currently loaded URI or null.

Specified by:
getCurrentURI in interface WebNavigation
JRexException

getReferringURI

public URI getReferringURI()
                    throws JRexException
Description copied from interface: WebNavigation
Get the referring URI for the current open page.

Specified by:
getReferringURI in interface WebNavigation
JRexException

getSessionHistory

public History getSessionHistory()
                          throws JRexException
Description copied from interface: WebNavigation
Get the session history object used to store the session history for the session.

Specified by:
getSessionHistory in interface WebNavigation
Returns:
The Session history object.
JRexException

setSessionHistory

public void setSessionHistory(History his)
                       throws JRexException
Description copied from interface: WebNavigation
Set the session history object used to store the session history for the session.

Specified by:
setSessionHistory in interface WebNavigation
Parameters:
his - - The Session history object.
JRexException


Copyright © 2004 C.N.Medappa. All Rights Reserved.