Class PartService
- All Implemented Interfaces:
IPageChangedListener
,IPartListener
,IPartListener2
,IPartService
-
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.Returns the active part.Returns the active part reference.void
pageChanged
(PageChangedEvent event) Notifies that the selected page has changed.void
partActivated
(IWorkbenchPart part) Notifies this listener that the given part has been activated.void
partActivated
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been activated.void
Notifies this listener that the given part has been brought to the top.void
partBroughtToTop
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been brought to the top.void
partClosed
(IWorkbenchPart part) Notifies this listener that the given part has been closed.void
partClosed
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been closed.void
Notifies this listener that the given part has been deactivated.void
partDeactivated
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been deactivated.void
partHidden
(IWorkbenchPartReference partRef) Notifies this listener that the given part is hidden or obscured by another part.void
partInputChanged
(IWorkbenchPartReference partRef) Notifies this listener that the given part's input was changed.void
partOpened
(IWorkbenchPart part) Notifies this listener that the given part has been opened.void
partOpened
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been opened.void
partVisible
(IWorkbenchPartReference partRef) Notifies this listener that the given part is visible.void
removePartListener
(IPartListener listener) Removes the given part listener.void
removePartListener
(IPartListener2 listener) Removes the given part listener.
-
Constructor Details
-
PartService
public PartService()
-
-
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
-
partActivated
Description copied from interface:IPartListener
Notifies this listener that the given part has been activated.- Specified by:
partActivated
in interfaceIPartListener
- Parameters:
part
- the part that was activated- See Also:
-
partBroughtToTop
Description copied from interface:IPartListener
Notifies this listener that the given part has been brought to the top.These events occur when an editor is brought to the top in the editor area, or when a view is brought to the top in a page book with multiple views. They are normally only sent when a part is brought to the top programmatically (via
IPerspective.bringToTop
). When a part is activated by the user clicking on it, onlypartActivated
is sent.- Specified by:
partBroughtToTop
in interfaceIPartListener
- Parameters:
part
- the part that was surfaced- See Also:
-
partClosed
Description copied from interface:IPartListener
Notifies this listener that the given part has been closed.- Specified by:
partClosed
in interfaceIPartListener
- Parameters:
part
- the part that was closed- See Also:
-
partDeactivated
Description copied from interface:IPartListener
Notifies this listener that the given part has been deactivated.- Specified by:
partDeactivated
in interfaceIPartListener
- Parameters:
part
- the part that was deactivated- See Also:
-
partOpened
Description copied from interface:IPartListener
Notifies this listener that the given part has been opened.- Specified by:
partOpened
in interfaceIPartListener
- Parameters:
part
- the part that was opened- See Also:
-
partActivated
Description copied from interface:IPartListener2
Notifies this listener that the given part has been activated.- Specified by:
partActivated
in interfaceIPartListener2
- Parameters:
partRef
- the part that was activated- See Also:
-
partBroughtToTop
Description copied from interface:IPartListener2
Notifies this listener that the given part has been brought to the top.These events occur when an editor is brought to the top in the editor area, or when a view is brought to the top in a page book with multiple views. They are normally only sent when a part is brought to the top programmatically (via
IPerspective.bringToTop
). When a part is activated by the user clicking on it, onlypartActivated
is sent.- Specified by:
partBroughtToTop
in interfaceIPartListener2
- Parameters:
partRef
- the part that was surfaced- See Also:
-
partClosed
Description copied from interface:IPartListener2
Notifies this listener that the given part has been closed.Note that if other perspectives in the same page share the view, this notification is not sent. It is only sent when the view is being removed from the page entirely (it is being disposed).
- Specified by:
partClosed
in interfaceIPartListener2
- Parameters:
partRef
- the part that was closed- See Also:
-
partDeactivated
Description copied from interface:IPartListener2
Notifies this listener that the given part has been deactivated.- Specified by:
partDeactivated
in interfaceIPartListener2
- Parameters:
partRef
- the part that was deactivated- See Also:
-
partOpened
Description copied from interface:IPartListener2
Notifies this listener that the given part has been opened.Note that if other perspectives in the same page share the view, this notification is not sent. It is only sent when the view is being newly opened in the page (it is being created).
- Specified by:
partOpened
in interfaceIPartListener2
- Parameters:
partRef
- the part that was opened- See Also:
-
partHidden
Description copied from interface:IPartListener2
Notifies this listener that the given part is hidden or obscured by another part.- Specified by:
partHidden
in interfaceIPartListener2
- Parameters:
partRef
- the part that is hidden or obscured by another part
-
partVisible
Description copied from interface:IPartListener2
Notifies this listener that the given part is visible.- Specified by:
partVisible
in interfaceIPartListener2
- Parameters:
partRef
- the part that is visible
-
partInputChanged
Description copied from interface:IPartListener2
Notifies this listener that the given part's input was changed.- Specified by:
partInputChanged
in interfaceIPartListener2
- Parameters:
partRef
- the part whose input was changed
-
pageChanged
Description copied from interface:IPageChangedListener
Notifies that the selected page has changed.- Specified by:
pageChanged
in interfaceIPageChangedListener
- Parameters:
event
- event object describing the change
-