JDIC API V2006 Release 0308

org.jdesktop.jdic.browser
Class MozillaEngine

java.lang.Object
  extended by org.jdesktop.jdic.browser.MozillaEngine
All Implemented Interfaces:
IBrowserEngine

public class MozillaEngine
extends java.lang.Object
implements IBrowserEngine

Handles the communication with Mozilla's Gecko Runtime Engine (GRE).


Constructor Summary
MozillaEngine()
           
 
Method Summary
 java.lang.String getBrowserName()
          Returns the standardadized name of the embedded browser engine.
 java.lang.String getCharsetName()
           
 java.lang.String getEmbeddedBinaryName()
           
 java.lang.String getFileProtocolURLPrefix()
          Mozilla will not omit this prefix
 void initialize()
          Set according path items and grant executable permission to bin file.
 boolean isDefaultBrowser(java.lang.String browserPath)
          Checks whether mozilla is default Browser on the current system.
 boolean isEngineAvailable()
          Checks whether the associated Engine is available on the current system.
 boolean isInitialized()
          check if the browser engine has been intialized.
protected  void preapareEnvVariables()
          get and set env variables For xpcom under win,it maybe under mozilla path or under gre path.
 void setEnginePath(java.lang.String fullPath)
          Set browser's full path(folder and exe name).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MozillaEngine

public MozillaEngine()
Method Detail

initialize

public void initialize()
                throws JdicInitException
Set according path items and grant executable permission to bin file.

Specified by:
initialize in interface IBrowserEngine
Throws:
JdicInitException

getBrowserName

public java.lang.String getBrowserName()
Description copied from interface: IBrowserEngine
Returns the standardadized name of the embedded browser engine. The name identifies the browser type but not the browser version. This name should be the same for all browser engines that embed the same browser, independent of platform. Names should be such that they can be presented in an English user dialog for choosing their favorite embedded engine. They may have spaces but they may not be internationalized. Examples for the standardized names are: Internet Explorer, Mozilla.

Specified by:
getBrowserName in interface IBrowserEngine
Returns:
The standardized name of the embedded browser engine. May not be null or empty.

isEngineAvailable

public boolean isEngineAvailable()
Checks whether the associated Engine is available on the current system. This is a prerequisite for creating Browser instances on the current system.

Specified by:
isEngineAvailable in interface IBrowserEngine
Returns:
true if an engine is available, false if no engine is available, the engine is not found or can not be accessed.

isDefaultBrowser

public boolean isDefaultBrowser(java.lang.String browserPath)
Checks whether mozilla is default Browser on the current system.

Specified by:
isDefaultBrowser in interface IBrowserEngine
Parameters:
browserPath - taken from the OS or whereever
Returns:
if default browser return ture else return false

preapareEnvVariables

protected void preapareEnvVariables()
                             throws JdicInitException
get and set env variables For xpcom under win,it maybe under mozilla path or under gre path. It can be set by: 1. setEnginePath() 2.MOZILLA_FIVE_PATH 3.

Throws:
JdicInitException

getEmbeddedBinaryName

public java.lang.String getEmbeddedBinaryName()
Specified by:
getEmbeddedBinaryName in interface IBrowserEngine
Returns:
embeded name of current browser.

setEnginePath

public void setEnginePath(java.lang.String fullPath)
Description copied from interface: IBrowserEngine
Set browser's full path(folder and exe name). When active brower isn't set as the default browser, will have to use this method to specify the path of it. It's often used after BrowserEngineManger's setActiveEngine() method.

Specified by:
setEnginePath in interface IBrowserEngine

getCharsetName

public java.lang.String getCharsetName()
Specified by:
getCharsetName in interface IBrowserEngine
Returns:
browser's default charset used to de/encode messages.

getFileProtocolURLPrefix

public java.lang.String getFileProtocolURLPrefix()
Mozilla will not omit this prefix

Specified by:
getFileProtocolURLPrefix in interface IBrowserEngine
Returns:
browser's file protocol prefix (eg. "file:/")

isInitialized

public boolean isInitialized()
Description copied from interface: IBrowserEngine
check if the browser engine has been intialized. It needs only be initialized once.

Specified by:
isInitialized in interface IBrowserEngine
Returns:
if initialized return true else return false

JDIC API V2006 Release 0308

For more information and documentation on JDIC, see JDIC website.

That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, working code examples, license terms and bug report information.

Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.