com.pepper.guiutils.browser
Interface WebBrowserView

All Known Implementing Classes:
JavaView, MozillaBrowserView

public interface WebBrowserView

This interface encapsulates the operations that can be performed on the WebBrowser, such as loading a page, navigating through history, and adding listeners. There will be an instance of this object per web tab or web window.


Field Summary
static int WINDOW_CURRENT
          Window Option - Current Window
static int WINDOW_NEW
          Window Option - New Window
static int WINDOW_NEW_TAB
          Window Option - New Tab
 
Method Summary
 void addContextMenuListener(PepperContextMenuListener listener)
          Add listener to handle context menus (ie right mouse);
 void addHistoryListener(PepperHistoryListener listener)
          Add a HistoryListener
 void addProgressListener(PepperProgressListener listener)
          Add a ProgressListener for page loading status
 void addURIContentListener(PepperURIContentListener listener)
          Add a URIContentListener to listen for specific content types, such as audio, so we can intercept and handle in Pepper UI
 boolean canCopy()
          Returns true if something is selected in the browser and it can be copied to the system clipboard
 boolean canCut()
          Returns true if browser can cut
 boolean canGoBack()
          Describe canGoBack method here.
 boolean canGoForward()
          Describe canGoForward method here.
 boolean canPaste()
          Returns true if browser can paste
 void clearHistory()
          Clear the session history for this view
 void copy()
          Copy the selected text in the browser to the clipboard
 void cut()
          Cut to clipboard
 void destroy()
          Describe destroy method here.
 boolean find(FindConfig args)
          invoked to find text on the current page
 boolean findAgain()
          Invoked to repeat previous find
 String getCurrentURL()
          Return the URL of the currently displayed page
 Document getDOM()
          Get the DOM for the current page
 FormElementManager getElementManager()
          Get class responsible for managing html form elements on the current page
 FindConfig getFindConfig()
          Get current findConfig object used for find methods
 WebHistory getHistory()
          Describe getHistory method here.
 netscape.javascript.JSObject getJSObject()
          All JavaScript objects appear within Java as instances of JSObject.
 boolean getNewlyCreated()
          Returns true when the view is newly created and no pages have been loaded in it yet.
 int getSelectedHistoryIndex()
           
 Component getUIComponent()
          Return the UI component associated with this view
 String getViewId()
          Get the unique identifier of this view
 void goBack()
          Describe goBack method here.
 void goForward()
          Describe goForward method here.
 void goToIndex(int historyIndex)
          Go to specified index in the History
 boolean isVisible()
          Returns true if this view is currently visible
 void loadPage(InputStream stream, String url)
           
 void loadPage(String theContent)
          Loads the string content
 void loadPage(URL pageURL)
          Loads the url
 void loadURI(String uri)
          Loads the URI
 void loadURI(String uri, int loadFlags)
          Load the uri with the specified load flags
 void loadURI(String uri, int loadFlags, String referURI, InputStream postData, InputStream headers)
          Load a uri using the specified load flags and with the specified referrer URL and POST data.
 void openWindow(short type, String uri, String referrer, String windowName, String features, boolean animate)
          Load the specified uri in a new window
 void paste()
          paste from clipboard
 void print(boolean showPrintDialog)
          Print the current page in the browser.
 void refresh()
          Refresh the current view
 void reload()
          Reload the current document
 void removeContextMenuListener(PepperContextMenuListener listener)
          Remove content listener
 void removeHistoryListener(PepperHistoryListener listener)
          Remove HistoryListener
 void removeProgressListener(PepperProgressListener listener)
          Remove ProgressListener
 void removeURIContentListener(PepperURIContentListener listener)
          Remove URIContentListener
 void requestFocus()
          request the focus
 void selectAll()
          Select everything on the current page
 void selectNone()
          De-select everything on the current page
 void setNewlyCreated(boolean state)
          Set whether this view is considered newly created or not
 void setSelectedHistoryIndex(int index)
           
 void stopLoading()
          Stop loading the current document
 

Field Detail

WINDOW_CURRENT

static final int WINDOW_CURRENT
Window Option - Current Window

See Also:
Constant Field Values

WINDOW_NEW

static final int WINDOW_NEW
Window Option - New Window

See Also:
Constant Field Values

WINDOW_NEW_TAB

static final int WINDOW_NEW_TAB
Window Option - New Tab

See Also:
Constant Field Values
Method Detail

getViewId

String getViewId()
Get the unique identifier of this view

Returns:
a String value

getUIComponent

Component getUIComponent()
Return the UI component associated with this view

Returns:
a Component value

isVisible

boolean isVisible()
Returns true if this view is currently visible

Returns:
a boolean value

loadPage

void loadPage(URL pageURL)
Loads the url

Parameters:
pageURL - the page to load.

loadPage

void loadPage(String theContent)
Loads the string content

Parameters:
theContent - a String value

loadPage

void loadPage(InputStream stream,
              String url)

loadURI

void loadURI(String uri)
Loads the URI

Parameters:
uri - a String value

loadURI

void loadURI(String uri,
             int loadFlags)
Load the uri with the specified load flags

Parameters:
uri - a String value
loadFlags - an int value
See Also:
WebNavigationConstants

loadURI

void loadURI(String uri,
             int loadFlags,
             String referURI,
             InputStream postData,
             InputStream headers)
Load a uri using the specified load flags and with the specified referrer URL and POST data.

Parameters:
uri - a String value
loadFlags - an int value
referURI - 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.
See Also:
WebNavigationConstants

openWindow

void openWindow(short type,
                String uri,
                String referrer,
                String windowName,
                String features,
                boolean animate)
                throws Exception
Load the specified uri in a new window

Parameters:
type - the type of window
uri - uri to open in the new window
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. Example would be "centerscreen,chrome,modal=yes,dialog=yes"
animate - if true animate the progress bar and the spinny
Throws:
Exception

canCopy

boolean canCopy()
Returns true if something is selected in the browser and it can be copied to the system clipboard

Returns:
a boolean value

copy

void copy()
Copy the selected text in the browser to the clipboard


canPaste

boolean canPaste()
Returns true if browser can paste

Returns:
a boolean value

paste

void paste()
paste from clipboard


canCut

boolean canCut()
Returns true if browser can cut

Returns:
a boolean value

cut

void cut()
Cut to clipboard


selectAll

void selectAll()
Select everything on the current page


selectNone

void selectNone()
De-select everything on the current page


canGoBack

boolean canGoBack()
Describe canGoBack method here.

Returns:
a boolean value

print

void print(boolean showPrintDialog)
Print the current page in the browser.

Parameters:
showPrintDialog - True to show the print setup dialog

find

boolean find(FindConfig args)
invoked to find text on the current page

Parameters:
args - a FindConfig object that enapsulates find parameters
Returns:
true if text is found

findAgain

boolean findAgain()
Invoked to repeat previous find

Returns:
true if text is found

getFindConfig

FindConfig getFindConfig()
Get current findConfig object used for find methods

Returns:
a FindConfig value

canGoForward

boolean canGoForward()
Describe canGoForward method here.

Returns:
a boolean value

goBack

void goBack()
Describe goBack method here.


goForward

void goForward()
Describe goForward method here.


goToIndex

void goToIndex(int historyIndex)
Go to specified index in the History

Parameters:
historyIndex - an int value

reload

void reload()
Reload the current document


refresh

void refresh()
Refresh the current view


stopLoading

void stopLoading()
Stop loading the current document


destroy

void destroy()
Describe destroy method here.


getDOM

Document getDOM()
Get the DOM for the current page

Returns:
a Document value

getCurrentURL

String getCurrentURL()
Return the URL of the currently displayed page

Returns:
a String value

getHistory

WebHistory getHistory()
Describe getHistory method here.

Returns:
a WebHistory value

clearHistory

void clearHistory()
Clear the session history for this view


getSelectedHistoryIndex

int getSelectedHistoryIndex()

setSelectedHistoryIndex

void setSelectedHistoryIndex(int index)

addHistoryListener

void addHistoryListener(PepperHistoryListener listener)
Add a HistoryListener

Parameters:
listener - PepperHistoryListener

removeHistoryListener

void removeHistoryListener(PepperHistoryListener listener)
Remove HistoryListener

Parameters:
listener - PepperHistoryListener

addProgressListener

void addProgressListener(PepperProgressListener listener)
Add a ProgressListener for page loading status

Parameters:
listener - PepperProgressListener

removeProgressListener

void removeProgressListener(PepperProgressListener listener)
Remove ProgressListener

Parameters:
listener - PepperProgressListener

addURIContentListener

void addURIContentListener(PepperURIContentListener listener)
Add a URIContentListener to listen for specific content types, such as audio, so we can intercept and handle in Pepper UI

Parameters:
listener - PepperURIContentListener

removeURIContentListener

void removeURIContentListener(PepperURIContentListener listener)
Remove URIContentListener

Parameters:
listener - an URIContentListener value

addContextMenuListener

void addContextMenuListener(PepperContextMenuListener listener)
Add listener to handle context menus (ie right mouse);

Parameters:
listener - a PepperContextMenuListener value

removeContextMenuListener

void removeContextMenuListener(PepperContextMenuListener listener)
Remove content listener

Parameters:
listener - a PepperContextMenuListener value

getElementManager

FormElementManager getElementManager()
Get class responsible for managing html form elements on the current page

Returns:
a FormElementManager value

getJSObject

netscape.javascript.JSObject getJSObject()
All JavaScript objects appear within Java as instances of JSObject. JSObject provides the following methods:

Values passed from Java to JavaScript are converted as follows:

Values passed from JavaScript to Java are converted as follows: This means that all JavaScript values show up as some kind of java.lang.Object in Java. In order to make much use of them, you will have to cast them to the appropriate subclass of Object, e.g. (String) window.getMember("name"); or (JSObject) window.getMember("document");.


requestFocus

void requestFocus()
request the focus


getNewlyCreated

boolean getNewlyCreated()
Returns true when the view is newly created and no pages have been loaded in it yet. Will be false after first page has been loaded in this view

Returns:
a boolean value

setNewlyCreated

void setNewlyCreated(boolean state)
Set whether this view is considered newly created or not

Parameters:
state - a boolean value


Copyright © 2006-2007 Pepper Computer, Inc. All Rights Reserved.