Class SlavePartService

java.lang.Object
org.eclipse.ui.internal.SlavePartService
All Implemented Interfaces:
IPartService, IDisposable

public class SlavePartService extends Object implements IPartService, IDisposable
A part service which delegates all responsibility to the parent service. The slave service is only responsible for disposing any locally activated listeners when it is disposed.

This class is not intended for use outside of the org.eclipse.ui.workbench plug-in.

Since:
3.4
  • Constructor Details

    • SlavePartService

      public SlavePartService(IPartService parentPartService)
      Constructs a new instance.
      Parameters:
      parentPartService - The parent part service for this slave. Never null.
  • Method Details

    • addPartListener

      public void addPartListener(IPartListener listener)
      Description copied from interface: IPartService
      Adds the given listener for part lifecycle events. Has no effect if an identical listener is already registered.

      Note: listeners should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.

      Specified by:
      addPartListener in interface IPartService
      Parameters:
      listener - a part listener
      See Also:
    • addPartListener

      public void addPartListener(IPartListener2 listener)
      Description copied from interface: IPartService
      Adds the given listener for part lifecycle events. Has no effect if an identical listener is already registered.

      As of 3.5, the IPartListener2 can also implement IPageChangedListener to be notified about any parts that implement IPageChangeProvider and post PageChangedEvents.

      Note: listeners should be removed when no longer necessary. If not, they will be removed when the IServiceLocator used to acquire this service is disposed.

      Specified by:
      addPartListener in interface IPartService
      Parameters:
      listener - a part listener
      See Also:
    • getActivePart

      public IWorkbenchPart getActivePart()
      Description copied from interface: IPartService
      Returns the active part.
      Specified by:
      getActivePart in interface IPartService
      Returns:
      the active part, or null if no part is currently active
    • getActivePartReference

      public IWorkbenchPartReference getActivePartReference()
      Description copied from interface: IPartService
      Returns the active part reference.
      Specified by:
      getActivePartReference in interface IPartService
      Returns:
      the active part reference, or null if no part is currently active
    • removePartListener

      public void removePartListener(IPartListener listener)
      Description copied from interface: IPartService
      Removes the given part listener. Has no effect if an identical listener is not registered.
      Specified by:
      removePartListener in interface IPartService
      Parameters:
      listener - a part listener
    • removePartListener

      public void removePartListener(IPartListener2 listener)
      Description copied from interface: IPartService
      Removes the given part listener. Has no effect if an identical listener is not registered.
      Specified by:
      removePartListener in interface IPartService
      Parameters:
      listener - a part listener
    • dispose

      public void dispose()
      Description copied from interface: IDisposable
      Disposes of this service. All resources must be freed. All listeners must be detached. Dispose will only be called once during the life cycle of a service.
      Specified by:
      dispose in interface IDisposable