com.pepper.guiutils.mozilla
Class MozillaBrowserView

java.lang.Object
  extended by com.pepper.guiutils.mozilla.MozillaBrowserView
All Implemented Interfaces:
WebBrowserView

public class MozillaBrowserView
extends Object
implements WebBrowserView

This class represents a browser view surrounding Mozilla


Field Summary
 
Fields inherited from interface com.pepper.guiutils.browser.WebBrowserView
WINDOW_CURRENT, WINDOW_NEW, WINDOW_NEW_TAB
 
Constructor Summary
protected MozillaBrowserView(String packageId, int peerId)
          Construct the view objec with the peerId representing the JRex native window
 
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
 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 findConfig)
          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 the element manager
 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.
 SystemTrayObject getPopupBlockedTrayObject()
           
 int getSelectedHistoryIndex()
           
 Component getUIComponent()
          Get the UI Component that represents 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 index)
          Go to specified history index
 boolean isVisible()
          Returns true if this view is currently visible
 void loadPage(InputStream inputStream, String uri)
          Describe loadPage method here.
 void loadPage(String theContent)
          Loads the string content
 void loadPage(URL pageURL)
          Loads the url
 void loadURI(String uri)
          Loads the uri specified by the string
 void loadURI(String uri, int loadFlags)
          Load a uri using 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 referer, 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 focus for the browser component
 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 setPopupBlockedTrayObject(SystemTrayObject trayObject)
           
 void setSelectedHistoryIndex(int index)
           
 void stopLoading()
          Stop loading the current document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MozillaBrowserView

protected MozillaBrowserView(String packageId,
                             int peerId)
Construct the view objec with the peerId representing the JRex native window

Parameters:
peerId - an int value
Method Detail

getViewId

public String getViewId()
Get the unique identifier of this view

Specified by:
getViewId in interface WebBrowserView
Returns:
a String value

setPopupBlockedTrayObject

public void setPopupBlockedTrayObject(SystemTrayObject trayObject)

getPopupBlockedTrayObject

public SystemTrayObject getPopupBlockedTrayObject()

requestFocus

public void requestFocus()
Request focus for the browser component

Specified by:
requestFocus in interface WebBrowserView

getJSObject

public netscape.javascript.JSObject getJSObject()
Description copied from interface: WebBrowserView
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");.

Specified by:
getJSObject in interface WebBrowserView
Returns:
a JSObject value
See Also:
WebBrowserView

getUIComponent

public Component getUIComponent()
Get the UI Component that represents this view

Specified by:
getUIComponent in interface WebBrowserView
Returns:
a Component

isVisible

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

Specified by:
isVisible in interface WebBrowserView
Returns:
a boolean value

loadPage

public void loadPage(URL pageURL)
Loads the url

Specified by:
loadPage in interface WebBrowserView
Parameters:
pageURL - the page to load.

loadURI

public void loadURI(String uri)
Loads the uri specified by the string

Specified by:
loadURI in interface WebBrowserView
Parameters:
uri - a String value

loadURI

public void loadURI(String uri,
                    int loadFlags)
Load a uri using the specified load flags

Specified by:
loadURI in interface WebBrowserView
Parameters:
uri - a String value
loadFlags - an int value
See Also:
WebNavigationConstants

loadURI

public 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.

Specified by:
loadURI in interface WebBrowserView
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

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

Specified by:
openWindow in interface WebBrowserView
Parameters:
type - the type of window
uri - uri to open in the new window
referer - 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

loadPage

public void loadPage(String theContent)
Loads the string content

Specified by:
loadPage in interface WebBrowserView
Parameters:
theContent - a String value

loadPage

public void loadPage(InputStream inputStream,
                     String uri)
Describe loadPage method here.

Specified by:
loadPage in interface WebBrowserView
Parameters:
inputStream - an InputStream value
uri - a String value

canGoBack

public boolean canGoBack()
Describe canGoBack method here.

Specified by:
canGoBack in interface WebBrowserView
Returns:
a boolean value

print

public void print(boolean showPrintDialog)
Description copied from interface: WebBrowserView
Print the current page in the browser.

Specified by:
print in interface WebBrowserView
Parameters:
showPrintDialog - True to show the print setup dialog
See Also:
WebBrowserView

find

public boolean find(FindConfig findConfig)
Description copied from interface: WebBrowserView
invoked to find text on the current page

Specified by:
find in interface WebBrowserView
Parameters:
findConfig - a FindConfig object that enapsulates find parameters
Returns:
true if text is found
See Also:
WebBrowserView

findAgain

public boolean findAgain()
Description copied from interface: WebBrowserView
Invoked to repeat previous find

Specified by:
findAgain in interface WebBrowserView
Returns:
true if text is found
See Also:
WebBrowserView

getFindConfig

public FindConfig getFindConfig()
Description copied from interface: WebBrowserView
Get current findConfig object used for find methods

Specified by:
getFindConfig in interface WebBrowserView
Returns:
a FindConfig value
See Also:
WebBrowserView

canGoForward

public boolean canGoForward()
Description copied from interface: WebBrowserView
Describe canGoForward method here.

Specified by:
canGoForward in interface WebBrowserView
Returns:
a boolean value
See Also:
WebBrowserView

goBack

public void goBack()
Description copied from interface: WebBrowserView
Describe goBack method here.

Specified by:
goBack in interface WebBrowserView
See Also:
WebBrowserView

goForward

public void goForward()
Description copied from interface: WebBrowserView
Describe goForward method here.

Specified by:
goForward in interface WebBrowserView
See Also:
WebBrowserView

goToIndex

public void goToIndex(int index)
Go to specified history index

Specified by:
goToIndex in interface WebBrowserView
Parameters:
index - an int value

reload

public void reload()
Reload the current document

Specified by:
reload in interface WebBrowserView

canCopy

public boolean canCopy()
Description copied from interface: WebBrowserView
Returns true if something is selected in the browser and it can be copied to the system clipboard

Specified by:
canCopy in interface WebBrowserView
Returns:
a boolean value
See Also:
WebBrowserView

copy

public void copy()
Description copied from interface: WebBrowserView
Copy the selected text in the browser to the clipboard

Specified by:
copy in interface WebBrowserView
See Also:
WebBrowserView

canPaste

public boolean canPaste()
Description copied from interface: WebBrowserView
Returns true if browser can paste

Specified by:
canPaste in interface WebBrowserView
Returns:
a boolean value
See Also:
WebBrowserView

paste

public void paste()
Description copied from interface: WebBrowserView
paste from clipboard

Specified by:
paste in interface WebBrowserView
See Also:
WebBrowserView

canCut

public boolean canCut()
Description copied from interface: WebBrowserView
Returns true if browser can cut

Specified by:
canCut in interface WebBrowserView
Returns:
a boolean value
See Also:
WebBrowserView

cut

public void cut()
Description copied from interface: WebBrowserView
Cut to clipboard

Specified by:
cut in interface WebBrowserView
See Also:
WebBrowserView

selectAll

public void selectAll()
Description copied from interface: WebBrowserView
Select everything on the current page

Specified by:
selectAll in interface WebBrowserView
See Also:
WebBrowserView

selectNone

public void selectNone()
Description copied from interface: WebBrowserView
De-select everything on the current page

Specified by:
selectNone in interface WebBrowserView
See Also:
WebBrowserView

refresh

public void refresh()
Description copied from interface: WebBrowserView
Refresh the current view

Specified by:
refresh in interface WebBrowserView
See Also:
WebBrowserView

stopLoading

public void stopLoading()
Stop loading the current document

Specified by:
stopLoading in interface WebBrowserView

destroy

public void destroy()
Description copied from interface: WebBrowserView
Describe destroy method here.

Specified by:
destroy in interface WebBrowserView
See Also:
WebBrowserView

getDOM

public Document getDOM()
Get the DOM for the current page

Specified by:
getDOM in interface WebBrowserView
Returns:
a Document value

getElementManager

public FormElementManager getElementManager()
Get the element manager

Specified by:
getElementManager in interface WebBrowserView
Returns:
a FormElementManager value

getCurrentURL

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

Specified by:
getCurrentURL in interface WebBrowserView
Returns:
a String value

getNewlyCreated

public 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

Specified by:
getNewlyCreated in interface WebBrowserView
Returns:
a boolean value

setNewlyCreated

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

Specified by:
setNewlyCreated in interface WebBrowserView
Parameters:
state - a boolean value

getHistory

public WebHistory getHistory()
Describe getHistory method here.

Specified by:
getHistory in interface WebBrowserView
Returns:
a WebHistory value

clearHistory

public void clearHistory()
Clear the session history

Specified by:
clearHistory in interface WebBrowserView

getSelectedHistoryIndex

public int getSelectedHistoryIndex()
Specified by:
getSelectedHistoryIndex in interface WebBrowserView

setSelectedHistoryIndex

public void setSelectedHistoryIndex(int index)
Specified by:
setSelectedHistoryIndex in interface WebBrowserView

addHistoryListener

public void addHistoryListener(PepperHistoryListener listener)
Description copied from interface: WebBrowserView
Add a HistoryListener

Specified by:
addHistoryListener in interface WebBrowserView
Parameters:
listener - PepperHistoryListener
See Also:
WebBrowserView

removeHistoryListener

public void removeHistoryListener(PepperHistoryListener listener)
Description copied from interface: WebBrowserView
Remove HistoryListener

Specified by:
removeHistoryListener in interface WebBrowserView
Parameters:
listener - PepperHistoryListener
See Also:
WebBrowserView

addProgressListener

public void addProgressListener(PepperProgressListener listener)
Description copied from interface: WebBrowserView
Add a ProgressListener for page loading status

Specified by:
addProgressListener in interface WebBrowserView
Parameters:
listener - PepperProgressListener
See Also:
WebBrowserView

removeProgressListener

public void removeProgressListener(PepperProgressListener listener)
Description copied from interface: WebBrowserView
Remove ProgressListener

Specified by:
removeProgressListener in interface WebBrowserView
Parameters:
listener - PepperProgressListener
See Also:
WebBrowserView

addURIContentListener

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

Specified by:
addURIContentListener in interface WebBrowserView
Parameters:
listener - PepperURIContentListener
See Also:
WebBrowserView

removeURIContentListener

public void removeURIContentListener(PepperURIContentListener listener)
Description copied from interface: WebBrowserView
Remove URIContentListener

Specified by:
removeURIContentListener in interface WebBrowserView
Parameters:
listener - an URIContentListener value
See Also:
WebBrowserView

addContextMenuListener

public void addContextMenuListener(PepperContextMenuListener listener)
Description copied from interface: WebBrowserView
Add listener to handle context menus (ie right mouse);

Specified by:
addContextMenuListener in interface WebBrowserView
Parameters:
listener - a PepperContextMenuListener value
See Also:
WebBrowserView

removeContextMenuListener

public void removeContextMenuListener(PepperContextMenuListener listener)
Description copied from interface: WebBrowserView
Remove content listener

Specified by:
removeContextMenuListener in interface WebBrowserView
Parameters:
listener - a PepperContextMenuListener value
See Also:
WebBrowserView


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