public interface IPartService
This service can be acquired from your service locator:
IPartService service = (IPartService) getSite().getService(IPartService.class);
IWorkbenchPage
,
IServiceLocator.getService(Class)
Modifier and Type | Method and Description |
---|---|
void |
addPartListener(IPartListener listener)
Adds the given listener for part lifecycle events.
|
void |
addPartListener(IPartListener2 listener)
Adds the given listener for part lifecycle events.
|
IWorkbenchPart |
getActivePart()
Returns the active part.
|
IWorkbenchPartReference |
getActivePartReference()
Returns the active part reference.
|
void |
removePartListener(IPartListener listener)
Removes the given part listener.
|
void |
removePartListener(IPartListener2 listener)
Removes the given part listener.
|
void addPartListener(IPartListener listener)
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.
listener
- a part listenerremovePartListener(IPartListener)
void addPartListener(IPartListener2 listener)
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.
listener
- a part listenerremovePartListener(IPartListener2)
,
IPageChangeProvider
,
IPageChangedListener
IWorkbenchPart getActivePart()
null
if no part is currently activeIWorkbenchPartReference getActivePartReference()
null
if no part
is currently activevoid removePartListener(IPartListener listener)
listener
- a part listenervoid removePartListener(IPartListener2 listener)
listener
- a part listener
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.