public class ExtensionTracker extends Object implements IExtensionTracker, IRegistryChangeListener
This class can be used without OSGi running.
IExtensionTrackerREF_SOFT, REF_STRONG, REF_WEAK| Constructor and Description |
|---|
ExtensionTracker()
Construct a new instance of the extension tracker.
|
ExtensionTracker(IExtensionRegistry theRegistry)
Construct a new instance of the extension tracker using the given registry
containing tracked extensions and extension points.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyAdd(IExtensionChangeHandler handler,
IExtension extension) |
protected void |
applyRemove(IExtensionChangeHandler handler,
IExtension removedExtension,
Object[] removedObjects) |
void |
close()
Close the tracker.
|
static IFilter |
createExtensionPointFilter(IExtensionPoint xpt)
Return an instance of filter matching all changes for the given extension point.
|
static IFilter |
createExtensionPointFilter(IExtensionPoint[] xpts)
Return an instance of filter matching all changes for the given extension points.
|
static IFilter |
createNamespaceFilter(String id)
Return an instance of filter matching all changes from a given plugin.
|
Object[] |
getObjects(IExtension element)
Return all the objects that have been associated with the given extension.
|
void |
registerHandler(IExtensionChangeHandler handler,
IFilter filter)
Register an extension change handler with this tracker using the given filter.
|
void |
registerObject(IExtension element,
Object object,
int referenceType)
Create an association between the given extension and the given object.
|
void |
registryChanged(IRegistryChangeEvent event)
Implementation of IRegistryChangeListener interface.
|
void |
unregisterHandler(IExtensionChangeHandler handler)
Unregister the given extension change handler previously registered with this tracker.
|
Object[] |
unregisterObject(IExtension extension)
Remove all the objects associated with the given extension.
|
void |
unregisterObject(IExtension extension,
Object object)
Remove an association between the given extension and the given object.
|
public ExtensionTracker()
public ExtensionTracker(IExtensionRegistry theRegistry)
theRegistry - the extension registry to trackpublic void registerHandler(IExtensionChangeHandler handler, IFilter filter)
IExtensionTrackerregisterHandler in interface IExtensionTrackerhandler - the handler to be registeredfilter - the filter to use to choose interesting changespublic void unregisterHandler(IExtensionChangeHandler handler)
IExtensionTrackerunregisterHandler in interface IExtensionTrackerhandler - the handler to be unregisteredpublic void registerObject(IExtension element, Object object, int referenceType)
IExtensionTrackerIExtensionTracker.REF_STRONG, IExtensionTracker.REF_SOFT, IExtensionTracker.REF_WEAK.registerObject in interface IExtensionTrackerelement - the extensionobject - the object to associate with the extensionreferenceType - one of REF_STRONG, REF_SOFT, REF_WEAKIExtensionTracker.REF_STRONG,
IExtensionTracker.REF_SOFT,
IExtensionTracker.REF_WEAKpublic void registryChanged(IRegistryChangeEvent event)
This method must not be called by clients.
registryChanged in interface IRegistryChangeListenerevent - the registry change eventIRegistryChangeEventprotected void applyAdd(IExtensionChangeHandler handler, IExtension extension)
protected void applyRemove(IExtensionChangeHandler handler, IExtension removedExtension, Object[] removedObjects)
public Object[] getObjects(IExtension element)
IExtensionTrackergetObjects in interface IExtensionTrackerelement - the extension for which the object must be returnedpublic void close()
IExtensionTrackerclose in interface IExtensionTrackerpublic void unregisterObject(IExtension extension, Object object)
IExtensionTrackerunregisterObject in interface IExtensionTrackerextension - the extension under which the object has been registeredobject - the object to unregisterpublic Object[] unregisterObject(IExtension extension)
IExtensionTrackerunregisterObject in interface IExtensionTrackerextension - the extension for which the objects are removedpublic static IFilter createExtensionPointFilter(IExtensionPoint xpt)
xpt - the extension pointpublic static IFilter createExtensionPointFilter(IExtensionPoint[] xpts)
xpts - the extension points used to filterGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.