JDIC API V2006 Release 0308

org.jdesktop.jdic.browser
Class BrowserEngineManager

java.lang.Object
  extended by org.jdesktop.jdic.browser.BrowserEngineManager

public class BrowserEngineManager
extends java.lang.Object

Factory pattern used to maitain instances of IBrowserEngine.


Field Summary
static java.lang.String IE
           
static java.lang.String MOZILLA
           
 
Method Summary
protected  boolean checkEnginesWhenAdded()
          This method is called when the BrowserManager instance is created.
 IBrowserEngine getActiveEngine()
          Get the active engine.Use the engine set by setActiveEngineelse use the system default engine.
 java.util.Map getEngines()
          Used to find out which BrowserEngines have been registered AND are available on the current system.
protected  void initExitingEngines()
          Registers the engines that are available by default.
static BrowserEngineManager instance()
          Returns the singleton instance of the currently active BrowserManager.
 boolean registerBrowserEngine(java.lang.String engineName, IBrowserEngine engine)
          Adds a BrowserEngine to the list of BrowserConnectors that BrowserEngineManager uses to create new Browser instances.
 boolean removeBrowserEngine(java.lang.String engineName)
          Removes a BrowserEngine to the list of BrowserConnectors that BrowserEngineManager uses to create new Browser instances.
protected  void selectEngine()
          This code iterates over the currently registered BrowserEngines and decides which Engine will be used for instantiating Browser This method is only called once.
 boolean setActiveEngine(java.lang.String engineName)
          Set an active engine throgh enginename.TODO:if mozilla isn't the system default under win, can't set it as the active engine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOZILLA

public static java.lang.String MOZILLA

IE

public static java.lang.String IE
Method Detail

initExitingEngines

protected void initExitingEngines()
Registers the engines that are available by default.


instance

public static BrowserEngineManager instance()
Returns the singleton instance of the currently active BrowserManager. Creates a new instance if necessary. The class to be used for the new instance is determined by the System property: org.jdesktop.jdic.BrowserManager. (That class must be a subclass of BrowserManager) If that property does not exist, or an error occurs when trying to create a new instance of the class specified in the property, then the BrowserManager returned will be of class BrowserManager.

Returns:
Singleton BrowserEngineManager instance

getEngines

public java.util.Map getEngines()
Used to find out which BrowserEngines have been registered AND are available on the current system.

Returns:
Map of BrowserEngine instances representing all BrowserEngines that are available. Never returns null.

registerBrowserEngine

public boolean registerBrowserEngine(java.lang.String engineName,
                                     IBrowserEngine engine)
Adds a BrowserEngine to the list of BrowserConnectors that BrowserEngineManager uses to create new Browser instances.

Parameters:
BrowserEngine - The BrowserEngine to be registered.
Returns:
true if this engine was registered or was already registered; false if it is null or if the engine is not available

removeBrowserEngine

public boolean removeBrowserEngine(java.lang.String engineName)
Removes a BrowserEngine to the list of BrowserConnectors that BrowserEngineManager uses to create new Browser instances.

Parameters:
BrowserEngine - The BrowserEngine to be removed.
Returns:
True .False if this is the active engine

selectEngine

protected void selectEngine()
                     throws JdicInitException
This code iterates over the currently registered BrowserEngines and decides which Engine will be used for instantiating Browser This method is only called once.

Throws:
JdicInitException

checkEnginesWhenAdded

protected boolean checkEnginesWhenAdded()
This method is called when the BrowserManager instance is created. If it returns true, BrowserManger automatically checks the availability of all known engines and removes those engines that would not be able to provide a browser component. If this method returns false, no check is provided at startup. The getEngines() method then returns the full set of known engines. In that case, only when the methods getActiveBrowserEngine or getBrowser() are called the first time, will the list of engines be pruned to eliminate all engines that are not available. This method must consistently return the same value.


setActiveEngine

public boolean setActiveEngine(java.lang.String engineName)
Set an active engine throgh enginename.TODO:if mozilla isn't the system default under win, can't set it as the active engine.

Returns:
true if the activeEngine is set successfully

getActiveEngine

public IBrowserEngine getActiveEngine()
Get the active engine.Use the engine set by setActiveEngineelse use the system default engine.

Returns:
Returns the activeEngine.
Throws:
JdicInitException

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.