Extension SDK 10.1.2

oracle.ide
Class AddinManager

java.lang.Object
  extended byoracle.ide.AddinManager

public final class AddinManager
extends java.lang.Object

The AddinManager class is responsible for loading extensions (Addins) to the IDE. The most common use of the AddinManager for Addin developers is to obtain an instance of an Addin.

Example:

 AddinManager am = AddinManager.getInstance();
 Addin myAddin = am.getAddin("oracle.jdeveloper.cm.dt.ConnectionAddin");
 try
 {
   ConnectionAddin ca = (ConnectionAddin) myAddin;
   ca.someMethodOnMyAddin();
 }
 catch (ClassCastException ex)
 {
   handleError(ex);
 }
 

The AddinManager uses the data files core-addins.xml and addins.xml located in the ${JDEV_HOME}/bin directory to obtain the list of addins to load. An additional data file, user-addins.xml, located in the ${JDEV_HOME}/system directory and containing user specific addins is loaded last.

See Also:
Addin

Field Summary
static java.lang.String ADDIN_PRODUCT_POSTFIX
          Postfix used to build the addins.properties file.
static java.lang.String ADDIN_PRODUCT_XML_FILE
          Constant: product addins properties file.
static java.lang.String ADDIN_PROPERTIES_DIR_PROP
          Constant: System property indicating location of addin properties
static java.lang.String ADDIN_PROPERTIES_FILE_EXT
          Addins properties file extension.
static java.lang.String ADDIN_PROPERTIES_PREFIX_PROP
          System property indicating a prefix used in naming the the addins files.
static java.lang.String ADDIN_USER_POSTFIX
          Postfix used to build the addins-user.properties file.
static java.lang.String ADDIN_USER_XML_FILE
          Constant: user-addins properties file.
static java.lang.String ADDIN_XML_DIR_PROP
          Constant: System property indicating location of addin properties
static java.lang.String ADDIN_XML_FILE_EXT
          Addins xml file extension.
static java.lang.String MY_EXTENSION
           
static java.lang.String SYSTEM_EXTENSION
           
 
Method Summary
 void addAddin(Addin addin)
          Allow a addin which as already been initialized to be added to the AddinManager.
 boolean addinsInitialized(java.lang.String name)
          Are the addins for dependency name initialized.
 boolean areExtensionsLoaded()
          Have all extenions that are marked for loading been been load
 boolean canShutdown()
          Called before the IDE is shutting down.
 java.util.List findAddins(java.lang.String name)
          Find initialized and non-intialized addins for which is a dependency of
 Addin getAddin(java.lang.Class clazz)
          Returns the Addin instance for the given class name.
 Addin getAddin(java.lang.String className)
          Returns the first addin whos class is assignable from the given class name
static AddinManager getAddinManager()
          The AddinManager class is a singleton class.
 java.lang.String getCommand(int commandID, java.lang.String defaultCommand)
           
 java.lang.String getCommand(java.lang.String commandName, java.lang.String defaultCommand)
           
 java.util.List getGroup(java.lang.String name)
          Get the extension group(s).
static AddinManager getInstance()
          The AddinManager class is a singleton class.
 java.util.Properties getProductProperties()
          Load the addins.properties file.
 WebUpdateManager getWebUpdateManager()
          Get the web update manager.
 void initProductAddins(java.lang.String prefix)
          Creates and initializes the addins recorded in addins.xml that are signified by the specified key.
 void initProductAndUserAddins()
          Creates and initializes the addins recorded in the file addins.xml and addins-user.xml.
 boolean registerAddin(java.lang.String clazz, boolean quietStart)
          Registers an Addin with the AddinManager.
 void registerExtensionHandler(java.lang.String xmlTag, ExtensionTagHandler handler)
          Register xml extension tag handler.
 void setWebUpdateManager(WebUpdateManager wum)
          Set the web update manager.
 void shutdown()
          Called when the IDE is shutting down.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADDIN_PROPERTIES_FILE_EXT

public static final java.lang.String ADDIN_PROPERTIES_FILE_EXT
Addins properties file extension.

See Also:
Constant Field Values

ADDIN_XML_FILE_EXT

public static final java.lang.String ADDIN_XML_FILE_EXT
Addins xml file extension.

See Also:
Constant Field Values

ADDIN_PRODUCT_POSTFIX

public static final java.lang.String ADDIN_PRODUCT_POSTFIX
Postfix used to build the addins.properties file.


ADDIN_USER_POSTFIX

public static final java.lang.String ADDIN_USER_POSTFIX
Postfix used to build the addins-user.properties file.

See Also:
Constant Field Values

ADDIN_PRODUCT_XML_FILE

public static final java.lang.String ADDIN_PRODUCT_XML_FILE
Constant: product addins properties file. Lists addins for a specific product.

See Also:
Constant Field Values

ADDIN_USER_XML_FILE

public static final java.lang.String ADDIN_USER_XML_FILE
Constant: user-addins properties file. Lists addins a user may have downloaded or may be currently developing.

See Also:
Constant Field Values

ADDIN_PROPERTIES_DIR_PROP

public static final java.lang.String ADDIN_PROPERTIES_DIR_PROP
Constant: System property indicating location of addin properties

See Also:
Constant Field Values

ADDIN_XML_DIR_PROP

public static final java.lang.String ADDIN_XML_DIR_PROP
Constant: System property indicating location of addin properties

See Also:
Constant Field Values

ADDIN_PROPERTIES_PREFIX_PROP

public static final java.lang.String ADDIN_PROPERTIES_PREFIX_PROP
System property indicating a prefix used in naming the the addins files. The AddinManager builds the addins file names as follows: -core.xml .xml -user.xml Default prefix is "addins".

See Also:
Constant Field Values

SYSTEM_EXTENSION

public static final java.lang.String SYSTEM_EXTENSION
See Also:
Constant Field Values

MY_EXTENSION

public static final java.lang.String MY_EXTENSION
See Also:
Constant Field Values
Method Detail

getInstance

public static AddinManager getInstance()
The AddinManager class is a singleton class. The static member instance holds the class single instance.

Returns:
the AddinManager class single instance.

getAddinManager

public static AddinManager getAddinManager()
The AddinManager class is a singleton class. The static member instance holds the class single instance.

Returns:
the AddinManager instance.

areExtensionsLoaded

public boolean areExtensionsLoaded()
Have all extenions that are marked for loading been been load

Returns:
trueextensions loaded; false extensions not loaded.

getProductProperties

public final java.util.Properties getProductProperties()
Load the addins.properties file. To obtain addin property information

Returns:
the properties file. null empty if file has not been loaded and parsed.

initProductAndUserAddins

public final void initProductAndUserAddins()
Creates and initializes the addins recorded in the file addins.xml and addins-user.xml.


initProductAddins

public final void initProductAddins(java.lang.String prefix)
Creates and initializes the addins recorded in addins.xml that are signified by the specified key.

Parameters:
prefix - The string prefix to prepend to the property names that identify which addins to load; the prefix may not be null.

registerExtensionHandler

public final void registerExtensionHandler(java.lang.String xmlTag,
                                           ExtensionTagHandler handler)
Register xml extension tag handler. When the Addin Manger is processing the addins.xml or jdev-ext.xml file if it comes across a xml tag which it does not recognise the xml element is farmed off to the corresponding extension tag handler

Parameters:
xmlTag - xml element tag on which the handler will be called

registerAddin

public boolean registerAddin(java.lang.String clazz,
                             boolean quietStart)
Registers an Addin with the AddinManager. The addin class clazz will be loaded, and then the Addin method initialize will be invoked on the newly created addin. An Addin or other class can use this method to register addins after the IDE has already started up. The AddinManager will be responsible for the shutdown notification to the newly registered Addin when the IDE is exiting.

Parameters:
clazz - The class name of the Addin to register
quietStart - if true then a diagnostic message using the Assert class will be displayed with the class name of the Addin, as well as the startup time.

See Also:
Addin, Assert.println(java.lang.String)

findAddins

public java.util.List findAddins(java.lang.String name)
Find initialized and non-intialized addins for which is a dependency of


addinsInitialized

public boolean addinsInitialized(java.lang.String name)
Are the addins for dependency name initialized. If name is not a dependency for any addin then true is returned. If name is a dependency for more than one addin and only some addins are initialized then true is returned.


getCommand

public final java.lang.String getCommand(java.lang.String commandName,
                                         java.lang.String defaultCommand)

getCommand

public final java.lang.String getCommand(int commandID,
                                         java.lang.String defaultCommand)

shutdown

public final void shutdown()
Called when the IDE is shutting down.


canShutdown

public final boolean canShutdown()
Called before the IDE is shutting down. Addins can cancel the shutdown process by returning false from the Addin.canShutdown method.


getAddin

public Addin getAddin(java.lang.Class clazz)
Returns the Addin instance for the given class name. The class may be either an interface or an addin implementation, but no match will be found if it is a superclass of an implementation.

Parameters:
clazz - The class name of the Addin to return.

Returns:
The instance of the requested Addin if it exists, otherwise null

getAddin

public Addin getAddin(java.lang.String className)
Returns the first addin whos class is assignable from the given class name


addAddin

public void addAddin(Addin addin)
Allow a addin which as already been initialized to be added to the AddinManager. If the addin has not been initialized use the method registerAddin


setWebUpdateManager

public void setWebUpdateManager(WebUpdateManager wum)
Set the web update manager. The web update manager is responsible for installing extensions from the web. .

Parameters:
wum -

getWebUpdateManager

public WebUpdateManager getWebUpdateManager()
Get the web update manager.

Returns:
the web update manager. This method may return null if no web update manager has been installed into the IDE.

getGroup

public java.util.List getGroup(java.lang.String name)
Get the extension group(s).

Returns:
a list of groups which match the group "name". Groups are held in a tree structure so it is possible to have different groups named the same but in different parts of the tree.

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.