Class ExtensionTracker

    • Constructor Detail

      • ExtensionTracker

        public ExtensionTracker()
        Construct a new instance of the extension tracker.
      • ExtensionTracker

        public ExtensionTracker​(IExtensionRegistry theRegistry)
        Construct a new instance of the extension tracker using the given registry containing tracked extensions and extension points.
        Parameters:
        theRegistry - the extension registry to track
        Since:
        org.eclipse.equinox.registry 3.2
    • Method Detail

      • registerHandler

        public void registerHandler​(IExtensionChangeHandler handler,
                                    IFilter filter)
        Description copied from interface: IExtensionTracker
        Register an extension change handler with this tracker using the given filter.
        Specified by:
        registerHandler in interface IExtensionTracker
        Parameters:
        handler - the handler to be registered
        filter - the filter to use to choose interesting changes
      • getObjects

        public Object[] getObjects​(IExtension element)
        Description copied from interface: IExtensionTracker
        Return all the objects that have been associated with the given extension. All objects registered strongly will be return unless they have been unregistered. The objects registered softly or weakly may not be returned if they have been garbage collected. Return an empty array if no associations exist.
        Specified by:
        getObjects in interface IExtensionTracker
        Parameters:
        element - the extension for which the object must be returned
        Returns:
        the array of associated objects
      • close

        public void close()
        Description copied from interface: IExtensionTracker
        Close the tracker. All registered objects are freed and all handlers are being automatically removed.
        Specified by:
        close in interface IExtensionTracker
      • unregisterObject

        public void unregisterObject​(IExtension extension,
                                     Object object)
        Description copied from interface: IExtensionTracker
        Remove an association between the given extension and the given object.
        Specified by:
        unregisterObject in interface IExtensionTracker
        Parameters:
        extension - the extension under which the object has been registered
        object - the object to unregister
      • unregisterObject

        public Object[] unregisterObject​(IExtension extension)
        Description copied from interface: IExtensionTracker
        Remove all the objects associated with the given extension. Return the removed objects.
        Specified by:
        unregisterObject in interface IExtensionTracker
        Parameters:
        extension - the extension for which the objects are removed
        Returns:
        the objects that were associated with the extension
      • createExtensionPointFilter

        public static IFilter createExtensionPointFilter​(IExtensionPoint xpt)
        Return an instance of filter matching all changes for the given extension point.
        Parameters:
        xpt - the extension point
        Returns:
        a filter
      • createExtensionPointFilter

        public static IFilter createExtensionPointFilter​(IExtensionPoint[] xpts)
        Return an instance of filter matching all changes for the given extension points.
        Parameters:
        xpts - the extension points used to filter
        Returns:
        a filter
      • createNamespaceFilter

        public static IFilter createNamespaceFilter​(String id)
        Return an instance of filter matching all changes from a given plugin.
        Parameters:
        id - the plugin id
        Returns:
        a filter