|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.ide.AddinManager
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.
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 |
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 |
public static final java.lang.String ADDIN_PROPERTIES_FILE_EXT
public static final java.lang.String ADDIN_XML_FILE_EXT
public static final java.lang.String ADDIN_PRODUCT_POSTFIX
public static final java.lang.String ADDIN_USER_POSTFIX
public static final java.lang.String ADDIN_PRODUCT_XML_FILE
public static final java.lang.String ADDIN_USER_XML_FILE
public static final java.lang.String ADDIN_PROPERTIES_DIR_PROP
public static final java.lang.String ADDIN_XML_DIR_PROP
public static final java.lang.String ADDIN_PROPERTIES_PREFIX_PROP
AddinManager
builds the addins file names as
follows:
public static final java.lang.String SYSTEM_EXTENSION
public static final java.lang.String MY_EXTENSION
Method Detail |
public static AddinManager getInstance()
AddinManager
class is a singleton class. The static member
instance
holds the class single instance.
AddinManager
class single instance.public static AddinManager getAddinManager()
AddinManager
class is a singleton class. The static member
instance
holds the class single instance.
AddinManager
instance.public boolean areExtensionsLoaded()
true
extensions loaded; false
extensions not loaded.public final java.util.Properties getProductProperties()
null
empty if file has not been
loaded and parsed.public final void initProductAndUserAddins()
addins.xml
and addins-user.xml
.
public final void initProductAddins(java.lang.String prefix)
addins.xml
that are signified by the specified
key.
prefix
- The string prefix to prepend to the property names that
identify which addins to load; the prefix may not be
null
.public final void registerExtensionHandler(java.lang.String xmlTag, ExtensionTagHandler handler)
xmlTag
- xml element tag on which the handler will be calledpublic boolean registerAddin(java.lang.String clazz, boolean quietStart)
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.
clazz
- The class name of the Addin
to registerquietStart
- 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.
Addin
,
Assert.println(java.lang.String)
public java.util.List findAddins(java.lang.String name)
public boolean addinsInitialized(java.lang.String name)
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.
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Extension SDK
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 1997, 2004, Oracle. All rights reserved.