Class PartService
- All Implemented Interfaces:
IPageChangedListener,IPartListener,IPartListener2,IPartService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPartListener(IPartListener listener) Adds the given listener for part lifecycle events.voidaddPartListener(IPartListener2 listener) Adds the given listener for part lifecycle events.Returns the active part.Returns the active part reference.voidpageChanged(PageChangedEvent event) Notifies that the selected page has changed.voidpartActivated(IWorkbenchPart part) Notifies this listener that the given part has been activated.voidpartActivated(IWorkbenchPartReference partRef) Notifies this listener that the given part has been activated.voidNotifies this listener that the given part has been brought to the top.voidpartBroughtToTop(IWorkbenchPartReference partRef) Notifies this listener that the given part has been brought to the top.voidpartClosed(IWorkbenchPart part) Notifies this listener that the given part has been closed.voidpartClosed(IWorkbenchPartReference partRef) Notifies this listener that the given part has been closed.voidNotifies this listener that the given part has been deactivated.voidpartDeactivated(IWorkbenchPartReference partRef) Notifies this listener that the given part has been deactivated.voidpartHidden(IWorkbenchPartReference partRef) Notifies this listener that the given part is hidden or obscured by another part.voidpartInputChanged(IWorkbenchPartReference partRef) Notifies this listener that the given part's input was changed.voidpartOpened(IWorkbenchPart part) Notifies this listener that the given part has been opened.voidpartOpened(IWorkbenchPartReference partRef) Notifies this listener that the given part has been opened.voidpartVisible(IWorkbenchPartReference partRef) Notifies this listener that the given part is visible.voidremovePartListener(IPartListener listener) Removes the given part listener.voidremovePartListener(IPartListener2 listener) Removes the given part listener.
-
Constructor Details
-
PartService
public PartService()
-
-
Method Details
-
addPartListener
Description copied from interface:IPartServiceAdds 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:
addPartListenerin interfaceIPartService- Parameters:
listener- a part listener- See Also:
-
addPartListener
Description copied from interface:IPartServiceAdds 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:
addPartListenerin interfaceIPartService- Parameters:
listener- a part listener- See Also:
-
getActivePart
Description copied from interface:IPartServiceReturns the active part.- Specified by:
getActivePartin interfaceIPartService- Returns:
- the active part, or
nullif no part is currently active
-
getActivePartReference
Description copied from interface:IPartServiceReturns the active part reference.- Specified by:
getActivePartReferencein interfaceIPartService- Returns:
- the active part reference, or
nullif no part is currently active
-
removePartListener
Description copied from interface:IPartServiceRemoves the given part listener. Has no effect if an identical listener is not registered.- Specified by:
removePartListenerin interfaceIPartService- Parameters:
listener- a part listener
-
removePartListener
Description copied from interface:IPartServiceRemoves the given part listener. Has no effect if an identical listener is not registered.- Specified by:
removePartListenerin interfaceIPartService- Parameters:
listener- a part listener
-
partActivated
Description copied from interface:IPartListenerNotifies this listener that the given part has been activated.- Specified by:
partActivatedin interfaceIPartListener- Parameters:
part- the part that was activated- See Also:
-
partBroughtToTop
Description copied from interface:IPartListenerNotifies 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, onlypartActivatedis sent.- Specified by:
partBroughtToTopin interfaceIPartListener- Parameters:
part- the part that was surfaced- See Also:
-
partClosed
Description copied from interface:IPartListenerNotifies this listener that the given part has been closed.- Specified by:
partClosedin interfaceIPartListener- Parameters:
part- the part that was closed- See Also:
-
partDeactivated
Description copied from interface:IPartListenerNotifies this listener that the given part has been deactivated.- Specified by:
partDeactivatedin interfaceIPartListener- Parameters:
part- the part that was deactivated- See Also:
-
partOpened
Description copied from interface:IPartListenerNotifies this listener that the given part has been opened.- Specified by:
partOpenedin interfaceIPartListener- Parameters:
part- the part that was opened- See Also:
-
partActivated
Description copied from interface:IPartListener2Notifies this listener that the given part has been activated.- Specified by:
partActivatedin interfaceIPartListener2- Parameters:
partRef- the part that was activated- See Also:
-
partBroughtToTop
Description copied from interface:IPartListener2Notifies 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, onlypartActivatedis sent.- Specified by:
partBroughtToTopin interfaceIPartListener2- Parameters:
partRef- the part that was surfaced- See Also:
-
partClosed
Description copied from interface:IPartListener2Notifies 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:
partClosedin interfaceIPartListener2- Parameters:
partRef- the part that was closed- See Also:
-
partDeactivated
Description copied from interface:IPartListener2Notifies this listener that the given part has been deactivated.- Specified by:
partDeactivatedin interfaceIPartListener2- Parameters:
partRef- the part that was deactivated- See Also:
-
partOpened
Description copied from interface:IPartListener2Notifies 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:
partOpenedin interfaceIPartListener2- Parameters:
partRef- the part that was opened- See Also:
-
partHidden
Description copied from interface:IPartListener2Notifies this listener that the given part is hidden or obscured by another part.- Specified by:
partHiddenin interfaceIPartListener2- Parameters:
partRef- the part that is hidden or obscured by another part
-
partVisible
Description copied from interface:IPartListener2Notifies this listener that the given part is visible.- Specified by:
partVisiblein interfaceIPartListener2- Parameters:
partRef- the part that is visible
-
partInputChanged
Description copied from interface:IPartListener2Notifies this listener that the given part's input was changed.- Specified by:
partInputChangedin interfaceIPartListener2- Parameters:
partRef- the part whose input was changed
-
pageChanged
Description copied from interface:IPageChangedListenerNotifies that the selected page has changed.- Specified by:
pageChangedin interfaceIPageChangedListener- Parameters:
event- event object describing the change
-