Package org.eclipse.ui
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 Summary
Modifier and TypeMethodDescriptionvoid
addPageListener
(IPageListener listener) Adds the given listener for page lifecycle events.void
addPerspectiveListener
(IPerspectiveListener listener) Adds the given listener for a page's perspective lifecycle events.Returns the active page.void
removePageListener
(IPageListener listener) Removes the given page listener.void
Removes the given page's perspective listener.
-
Method Details
-
addPageListener
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
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
Removes the given page listener. Has no effect if an identical listener is not registered.- Parameters:
listener
- a page listener
-
removePerspectiveListener
Removes the given page's perspective listener. Has no effect if an identical listener is not registered.- Parameters:
listener
- a perspective listener
-