Interface IPageService

All Known Subinterfaces:
IWorkbenchWindow
All Known Implementing Classes:
SlavePageService, WorkbenchWindow

public interface IPageService
A page service tracks the page and perspective lifecycle events within a workbench window.

This service can be acquired from your service locator:

 IPageService service = (IPageService) getSite().getService(IPageService.class);
 
  • This service is not available globally, only from the workbench window level down.
See Also:
Restriction:
This interface is not intended to be implemented by clients.
  • Method Details

    • addPageListener

      void addPageListener(IPageListener listener)
      Adds the given listener for page 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.

      Parameters:
      listener - a page listener
      See Also:
    • addPerspectiveListener

      void addPerspectiveListener(IPerspectiveListener listener)
      Adds the given listener for a page's perspective 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.

      Parameters:
      listener - a perspective listener
      See Also:
    • getActivePage

      IWorkbenchPage getActivePage()
      Returns the active page.
      Returns:
      the active page, or null if no page is currently active
    • removePageListener

      void removePageListener(IPageListener listener)
      Removes the given page listener. Has no effect if an identical listener is not registered.
      Parameters:
      listener - a page listener
    • removePerspectiveListener

      void removePerspectiveListener(IPerspectiveListener listener)
      Removes the given page's perspective listener. Has no effect if an identical listener is not registered.
      Parameters:
      listener - a perspective listener