Extension SDK

oracle.jdeveloper.library
Class JLibraryManager

java.lang.Object
  extended byoracle.jdeveloper.library.JLibraryManager
All Implemented Interfaces:
Addin, DependableRecognizer, Subject

public final class JLibraryManager
extends java.lang.Object
implements Addin, Subject, DependableRecognizer


Field Summary
static int JDK_ADDED
           
static int JDK_REMOVED
           
static java.lang.String LEGACY_LIBRARY_FILE
           
static int LIBRARY_ADDED
           
static java.lang.String LIBRARY_LIST_FILE
           
static int LIBRARY_REMOVED
           
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Constructor Summary
JLibraryManager()
           
 
Method Summary
 void attach(Observer observer)
          Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes.
 boolean canShutdown()
          This method is called by the IDE to confirm that the ide can shutdown.
 Dependable create(Element source, Folder sourceOwner)
          Creates a Dependable that encapsulates the source object.
static JDK createJDK(java.lang.String name, java.net.URL javaExe, LibraryList list)
           
static JLibrary createLibrary(java.lang.String libName, LibraryList list)
           
static JDK createSystemJDK(java.lang.String name, java.net.URL javaExe)
           
static JLibrary createSystemLibrary(java.lang.String libName)
           
 void detach(Observer observer)
          Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject interface changes.
static JDK findJDK(java.lang.String jdkName)
           
static JDK findJDK(VersionNumber num, JDK[] jdks)
           
static JDK findJDKMatch(java.lang.String jdkName, VersionNumber jdkVer)
           
static JLibrary findLibrary(java.lang.String libName)
           
static JLibrary findSystemLibrary(java.lang.String libName)
           
static java.lang.String findUniqueJDKName()
           
static java.lang.String findUniqueLibraryName()
           
static LibraryList getAddinLibraries()
           
static LibraryList[] getAllLibraryLists()
           
static JDK getDefaultJDK()
           
static JLibraryManager getInstance()
          Retrieves the single JLibraryManager instance.
static java.util.List getJDKs()
           
static java.util.List getLibraries()
           
static LibraryList getLibraryList(java.net.URL url)
          Gets the LibraryList for a specific URL.
static JLibraryList getSystemLibraries()
           
static JLibraryList getUserLibraries()
           
 float ideVersion()
          This method is called to determine the ide version number for which this Addin was implemented.
 void initialize()
          Invoked by the AddinManager after the instance of the Addin is instantiated.
 void notifyObservers(java.lang.Object subject, UpdateMessage change)
          Notifies all observers that the state of the subject has changed.
 boolean recognize(Element source)
          Returns true if this dependable factory recognizes the specified source object.
static void registerDerivedLibrary(java.lang.Class key, java.lang.Class cls)
          Call this method to register a DerivedLibrary class.
static void removeJDK(JDK jdk, LibraryList list)
           
static void removeLibrary(JLibrary lib, LibraryList list)
           
static void removeSystemJDK(JDK jdk)
           
static void removeSystemLibrary(JLibrary lib)
           
static java.lang.String resolveAlias(java.lang.String libName)
           
 void shutdown()
          This method is invoked by the AddinManager when the IDE terminates.
static void unregisterDerivedLibrary(java.lang.Class key)
           
 float version()
          This method is called to determine the Addin version number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIBRARY_ADDED

public static final int LIBRARY_ADDED

LIBRARY_REMOVED

public static final int LIBRARY_REMOVED

JDK_ADDED

public static final int JDK_ADDED

JDK_REMOVED

public static final int JDK_REMOVED

LIBRARY_LIST_FILE

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

LEGACY_LIBRARY_FILE

public static final java.lang.String LEGACY_LIBRARY_FILE
See Also:
Constant Field Values
Constructor Detail

JLibraryManager

public JLibraryManager()
                throws SingletonClassException
Method Detail

getInstance

public static JLibraryManager getInstance()
Retrieves the single JLibraryManager instance.

Returns:
the single JLibraryManager instance.

getAllLibraryLists

public static LibraryList[] getAllLibraryLists()

getLibraries

public static java.util.List getLibraries()

getJDKs

public static java.util.List getJDKs()

getDefaultJDK

public static JDK getDefaultJDK()

createLibrary

public static JLibrary createLibrary(java.lang.String libName,
                                     LibraryList list)

findLibrary

public static JLibrary findLibrary(java.lang.String libName)

removeLibrary

public static void removeLibrary(JLibrary lib,
                                 LibraryList list)

createJDK

public static JDK createJDK(java.lang.String name,
                            java.net.URL javaExe,
                            LibraryList list)

findJDK

public static JDK findJDK(java.lang.String jdkName)

findJDK

public static JDK findJDK(VersionNumber num,
                          JDK[] jdks)

findJDKMatch

public static JDK findJDKMatch(java.lang.String jdkName,
                               VersionNumber jdkVer)

removeJDK

public static void removeJDK(JDK jdk,
                             LibraryList list)

resolveAlias

public static java.lang.String resolveAlias(java.lang.String libName)

getLibraryList

public static LibraryList getLibraryList(java.net.URL url)
Gets the LibraryList for a specific URL.

Parameters:
url - the URL representing the JLibraryList
Returns:
the LibraryList, or null if the list cannot be loaded.

createSystemLibrary

public static JLibrary createSystemLibrary(java.lang.String libName)

findUniqueLibraryName

public static java.lang.String findUniqueLibraryName()

findUniqueJDKName

public static java.lang.String findUniqueJDKName()

findSystemLibrary

public static JLibrary findSystemLibrary(java.lang.String libName)

removeSystemLibrary

public static void removeSystemLibrary(JLibrary lib)

createSystemJDK

public static JDK createSystemJDK(java.lang.String name,
                                  java.net.URL javaExe)

removeSystemJDK

public static void removeSystemJDK(JDK jdk)

getSystemLibraries

public static JLibraryList getSystemLibraries()

getUserLibraries

public static JLibraryList getUserLibraries()

getAddinLibraries

public static LibraryList getAddinLibraries()

create

public Dependable create(Element source,
                         Folder sourceOwner)
                  throws java.lang.IllegalAccessException,
                         java.lang.InstantiationException
Description copied from interface: DependableRecognizer
Creates a Dependable that encapsulates the source object. The owner is the folder containing the source.

Specified by:
create in interface DependableRecognizer
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

recognize

public boolean recognize(Element source)
Description copied from interface: DependableRecognizer
Returns true if this dependable factory recognizes the specified source object.

Specified by:
recognize in interface DependableRecognizer

registerDerivedLibrary

public static void registerDerivedLibrary(java.lang.Class key,
                                          java.lang.Class cls)
Call this method to register a DerivedLibrary class. The key should be the source node class. Registered Dependable classes will be recognized by this DependableRecognizer.


unregisterDerivedLibrary

public static void unregisterDerivedLibrary(java.lang.Class key)

ideVersion

public float ideVersion()
Description copied from interface: Addin
This method is called to determine the ide version number for which this Addin was implemented.

Specified by:
ideVersion in interface Addin
Returns:
the ide version number.

version

public float version()
Description copied from interface: Addin
This method is called to determine the Addin version number.

Specified by:
version in interface Addin
Returns:
the version number.

shutdown

public void shutdown()
Description copied from interface: Addin
This method is invoked by the AddinManager when the IDE terminates. Any non java resources (file handles, database connections, etc) which are still being held by this Addin should be released by this method immediately. This method is not guaranteed to be called, but on normal terminations of the IDE, this method will be invoked.

Specified by:
shutdown in interface Addin

canShutdown

public boolean canShutdown()
This method is called by the IDE to confirm that the ide can shutdown.

Specified by:
canShutdown in interface Addin

initialize

public void initialize()
Description copied from interface: Addin
Invoked by the AddinManager after the instance of the Addin is instantiated. When invoked, The Addin should register and menu items, and actions required for use during this classes lifecycle. Addin authors should take care to ensure that any extraneous initialization is not preformed on this method, and any startup code that can be delayed until a later time is delayed, as the Addin's are synchronously initialized during the startup of the IDE, and each Addin has the potential to negatively impact the startup time of the product.

Specified by:
initialize in interface Addin
See Also:
AddinManager

attach

public void attach(Observer observer)
Description copied from interface: Subject
Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes. Implementors should do nothing when the same observer is added more than once.

Specified by:
attach in interface Subject
Parameters:
observer - the Observer interested in change notification messages.

detach

public void detach(Observer observer)
Description copied from interface: Subject
Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject interface changes. Implementors should do nothing when the same observer is removed more than once.

Specified by:
detach in interface Subject
Parameters:
observer - the Observer disinterested in change notification messages.

notifyObservers

public void notifyObservers(java.lang.Object subject,
                            UpdateMessage change)
Description copied from interface: Subject
Notifies all observers that the state of the subject has changed.

Specified by:
notifyObservers in interface Subject
Parameters:
subject - the subject whose state has changed.
change - what changed.

Extension SDK

 

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