com.webrenderer
Interface IMozillaBrowserCanvas

All Superinterfaces:
IBrowserCanvas

public interface IMozillaBrowserCanvas
extends IBrowserCanvas

IMozillaBrowserCanvas provides Mozilla specific extensions to the standard IBrowserCanvas interface. This functionality can be accessed by casting a standard IBrowserCanvas interface, but only if Mozilla is the currently used browser. For example:


 if ( browser.getBrowserType().equals("MOZILLA") ) {
     ((IMozillaBrowserCanvas) browser).saveToFile( "filename.html" );
 }
 


Field Summary
static int COOKIE_ACCEPT_ALL
          This flag inidicates to setCookieMode that all cookies will be accepted by Mozilla.
static int COOKIE_ACCEPT_FROM_ORIGINATING_SERVER
          This flag inidicates to setCookieMode that only cookies that have requested by the originating server will be accepted.
static int COOKIE_ACCEPT_NONE
          This flag inidicates to setCookieMode that all cookies will be discarded by Mozilla.
 
Fields inherited from interface com.webrenderer.IBrowserCanvas
KEY_CODE_BACKSPACE, KEY_CODE_DELETE, KEY_CODE_TAB, KEY_MODIFIER_CTRL_DOWN, KEY_MODIFIER_SHIFT_DOWN, PRINT_DEFAULT_ACTION, PRINT_ORIENTATION_LANDSCAPE, PRINT_ORIENTATION_PORTRAIT, PRINT_SHOW_DIALOG_BOX, PRINT_SILENT, PRINT_SILENT_SHOW_HELP, RELOAD_BYPASS_CACHE, RELOAD_BYPASS_PROXY, RELOAD_BYPASS_PROXY_AND_CACHE, RELOAD_NORMAL
 
Method Summary
 void addDragListener(DragListener listener)
          Adds a DragListener.
 void deleteCertificate(java.security.cert.X509Certificate cert)
          Deletes the specified certificate from the browsers certificate database.
 boolean findInPage(java.lang.String toFind, boolean matchCase, boolean wrap, boolean backwards)
          The given string will be found and highlighted in the document if it exists Set matchCase if it is a case sensitive search Set wrap if you want the search to continue searching from top when it hits the bottom Set bacwards if you want the search to go backwards throught the page
 boolean findInPage(java.lang.String toFind, boolean matchCase, boolean wrap, boolean backwards, boolean wholeWord)
          The given string will be found and highlighted in the document if it exists Set matchCase if it is a case sensitive search Set wrap if you want the search to continue searching from top when it hits the bottom Set bacwards if you want the search to go backwards throught the page Set wholeWord if you want the search to find whole words only
 java.security.cert.X509Certificate getCertificateByName(java.lang.String name)
          Returns the specified certificate from the browsers certificate database.
 java.lang.String[] getCertificateNameList()
          Gets a list of the common names of all the certificates in the browsers certificate database.
 java.security.cert.X509Certificate[] getCertificates()
          Returns all the certificates in the browsers certificate database.
 int getCookieMode()
          Get the current cookie accept mode.
 java.lang.String getMozillaVersion()
          Returns the current version of mozilla from corecomponents
 void importCertificate(java.security.cert.X509Certificate cert, boolean trusted)
          Imports a certificate into the browsers certificate database.
 void removeDragListener(DragListener listener)
          Removes the specified Drag listener so that it no longer receives browser events from this component.
 void saveToFile(java.lang.String filename)
          Save the current HTML page to a local file.
 void setCertificateTrust(java.security.cert.X509Certificate cert, boolean trusted)
          Sets whether or not the certificate is to be trusted.
 void setCookieMode(int mode)
          Set the mode for accepting cookies.
 void setProxyAuthentication(java.lang.String username, java.lang.String password)
          Set Proxy Authentication.
 
Methods inherited from interface com.webrenderer.IBrowserCanvas
addBlockedURL, addBrowserListener, addDOMListener, addJavascriptListener, addKeyListener, addMouseListener, addNetworkListener, addPrintListener, addPromptListener, addWindowListener, allowPopups, autoconfigureProxy, cancelSave, canGoBack, canGoForward, copy, cut, decreaseTextZoom, deleteCookies, destroy, disableCache, disableClipping, disableCookies, disableHTTPSDialog, disableJInternalFrame, disableProxy, enableCache, enableCookies, enableDefaultContextMenu, enableImageLoading, enableJInternalFrame, enableProxy, EventsFireStatus, executeScript, executeScriptWithReturn, getAllowPopups, getBoolPrefProperty, getBrowserType, getCanvas, getCompanyName, getCookie, getCookie, getDefaultContextMenuStatus, getdisableHTTPSDialog, getDocument, getElementAtCaretPosition, getHistory, getHomeDirectory, getHTMLEditingMode, getHTTPSDialog, getIntPrefProperty, getJavascriptEnabled, getPageSize, getPopupParentWindow, getPreferredSize, getPrinterNames, getProductName, getProxyBypasses, getProxyProtocol, getScrollBarInfo, getSelectedText, getStatusBar, getStringPrefProperty, getTitle, getURL, getVersion, getWebRendererVersion, goBack, goForward, grabFocus, highlightSelectedText, httpPOST, httpPOST, httpPOST, increaseTextZoom, insertHTML, isCacheDisabled, isCookiesEnabled, isDisableClipping, isPopup, isProxyEnabled, isScrollBarsVisible, loadHTML, loadHTML, loadHTML, loadURL, loadURL, loadURL, makeImageUrl, openFileWithApp, paste, print, print, printPreview, registerProtocol, reload, removeBlockedURL, removeBrowserListener, removeDOMListener, removeImage, removeJavascriptListener, removeKeyListener, removeMouseListener, removeNetworkListener, removePrintListener, removePromptListener, removeWindowListener, savePageToBitmapImage, saveToBufferedImage, saveToBufferedImage, scrollToX, scrollToY, selectAll, sendKeyPressToElement, setCookie, setCookie, setHomeDirectory, setHTMLEditingMode, setJavascriptEnabled, setPopupParentWindow, setPreferredSize, setPrefProperty, setPrefProperty, setPrefProperty, setPrintPageOrientation, setProxyBypasses, setProxyProtocol, showAboutBox, showScrollBars, stopLoad, useDefaultProfile
 

Field Detail

COOKIE_ACCEPT_ALL

public static final int COOKIE_ACCEPT_ALL
This flag inidicates to setCookieMode that all cookies will be accepted by Mozilla. setCookieMode(COOKIE_ACCEPT_ALL) is the same as using IBrowserCanvas.enableCookies().

See Also:
setCookieMode(int), Constant Field Values

COOKIE_ACCEPT_FROM_ORIGINATING_SERVER

public static final int COOKIE_ACCEPT_FROM_ORIGINATING_SERVER
This flag inidicates to setCookieMode that only cookies that have requested by the originating server will be accepted. The functionality provided by this is currently only found in Mozilla.

See Also:
setCookieMode(int), Constant Field Values

COOKIE_ACCEPT_NONE

public static final int COOKIE_ACCEPT_NONE
This flag inidicates to setCookieMode that all cookies will be discarded by Mozilla. setCookieMode(COOKIE_ACCEPT_NONE) is the same as using IBrowserCanvas.disableCookies().

See Also:
setCookieMode(int), Constant Field Values
Method Detail

saveToFile

public void saveToFile(java.lang.String filename)
Save the current HTML page to a local file.

Specified by:
saveToFile in interface IBrowserCanvas
Parameters:
filename - Filename to save HTML to.

getMozillaVersion

public java.lang.String getMozillaVersion()
Returns the current version of mozilla from corecomponents


setCookieMode

public void setCookieMode(int mode)
Set the mode for accepting cookies. Mozilla provides extra functionality with cookies, namingly the concept of discarding cookies unless they come from the originating server. The modes are defined using static COOKIE_* members in this class. Using COOKIE_ACCEPT_ALL or COOKIE_ACCEPT_NONE modes are equivalent to the IBrowserCanvas methods enableCookies and disableCookies respectively.

Parameters:
mode - The cookie accept mode defined by COOKIE_*.

getCookieMode

public int getCookieMode()
Get the current cookie accept mode. Mozilla provides extra functionality with cookies, namingly the concept of discarding cookies unless they come from the originating server. The modes are defined using static COOKIE_* members in this class. Using COOKIE_ACCEPT_ALL or COOKIE_ACCEPT_NONE modes are equivalent to the IBrowserCanvas methods

Returns:
int Cookie accept mode defined by COOKIE_*.

findInPage

public boolean findInPage(java.lang.String toFind,
                          boolean matchCase,
                          boolean wrap,
                          boolean backwards)
The given string will be found and highlighted in the document if it exists Set matchCase if it is a case sensitive search Set wrap if you want the search to continue searching from top when it hits the bottom Set bacwards if you want the search to go backwards throught the page


findInPage

public boolean findInPage(java.lang.String toFind,
                          boolean matchCase,
                          boolean wrap,
                          boolean backwards,
                          boolean wholeWord)
The given string will be found and highlighted in the document if it exists Set matchCase if it is a case sensitive search Set wrap if you want the search to continue searching from top when it hits the bottom Set bacwards if you want the search to go backwards throught the page Set wholeWord if you want the search to find whole words only


setProxyAuthentication

public void setProxyAuthentication(java.lang.String username,
                                   java.lang.String password)
Set Proxy Authentication.


importCertificate

public void importCertificate(java.security.cert.X509Certificate cert,
                              boolean trusted)
Imports a certificate into the browsers certificate database.

Parameters:
cert - The certificate to import
trusted - whether this certificate is trusted or not

getCertificateNameList

public java.lang.String[] getCertificateNameList()
Gets a list of the common names of all the certificates in the browsers certificate database.

Returns:
An array of certificate names

getCertificateByName

public java.security.cert.X509Certificate getCertificateByName(java.lang.String name)
Returns the specified certificate from the browsers certificate database.

Parameters:
name - The name of the certificate to return
Returns:
the certificate

getCertificates

public java.security.cert.X509Certificate[] getCertificates()
Returns all the certificates in the browsers certificate database.

Returns:
An array of certificates

setCertificateTrust

public void setCertificateTrust(java.security.cert.X509Certificate cert,
                                boolean trusted)
Sets whether or not the certificate is to be trusted.

Parameters:
cert - The certificate to have its trust value set
trusted - True if the certificate is to be trusted

deleteCertificate

public void deleteCertificate(java.security.cert.X509Certificate cert)
Deletes the specified certificate from the browsers certificate database.

Parameters:
cert - The certificate to be deleted

addDragListener

public void addDragListener(DragListener listener)
Adds a DragListener. This will receive event when drag and drop operations are ocurring. Currently only available on Windows.

Parameters:
listener - the DragListener to add
See Also:
removeDragListener(com.webrenderer.event.DragListener)

removeDragListener

public void removeDragListener(DragListener listener)
Removes the specified Drag listener so that it no longer receives browser events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If either listener is null, or listener has not been previously added as a listener, no exception is thrown and no action is performed. Currently only available on Windows.

Parameters:
listener - The Drag listener to remove.
See Also:
addDragListener(DragListener)