Package org.eclipse.ui.internal
Class SlavePartService
java.lang.Object
org.eclipse.ui.internal.SlavePartService
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPartListener
(IPartListener listener) Adds the given listener for part lifecycle events.void
addPartListener
(IPartListener2 listener) Adds the given listener for part lifecycle events.void
dispose()
Disposes of this service.Returns the active part.Returns the active part reference.void
removePartListener
(IPartListener listener) Removes the given part listener.void
removePartListener
(IPartListener2 listener) Removes the given part listener.
-
Constructor Details
-
SlavePartService
Constructs a new instance.- Parameters:
parentPartService
- The parent part service for this slave. Nevernull
.
-
-
Method Details
-
addPartListener
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 interfaceIPartService
- Parameters:
listener
- a part listener- See Also:
-
addPartListener
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 interfaceIPartService
- Parameters:
listener
- a part listener- See Also:
-
getActivePart
Description copied from interface:IPartService
Returns the active part.- Specified by:
getActivePart
in interfaceIPartService
- Returns:
- the active part, or
null
if no part is currently active
-
getActivePartReference
Description copied from interface:IPartService
Returns the active part reference.- Specified by:
getActivePartReference
in interfaceIPartService
- Returns:
- the active part reference, or
null
if no part is currently active
-
removePartListener
Description copied from interface:IPartService
Removes the given part listener. Has no effect if an identical listener is not registered.- Specified by:
removePartListener
in interfaceIPartService
- Parameters:
listener
- a part listener
-
removePartListener
Description copied from interface:IPartService
Removes the given part listener. Has no effect if an identical listener is not registered.- Specified by:
removePartListener
in interfaceIPartService
- 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 interfaceIDisposable
-