Class SlaveSelectionService
- All Implemented Interfaces:
ISelectionService,IDisposable
- Since:
- 3.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPostSelectionListener(String partId, ISelectionListener listener) Adds a part-specific selection listener which is notified when selection changes in the part with the given id.voidaddPostSelectionListener(ISelectionListener listener) Adds the given post selection listener.It is equivalent to selection changed if the selection was triggered by the mouse but it has a delay if the selection is triggered by the keyboard arrows.voidaddSelectionListener(String partId, ISelectionListener listener) Adds a part-specific selection listener which is notified when selection changes in the part with the given id.voidaddSelectionListener(ISelectionListener listener) Adds the given selection listener.voiddispose()Disposes of this service.Returns the current selection in the active part.getSelection(String partId) Returns the current selection in the part with the given id.voidremovePostSelectionListener(String partId, ISelectionListener listener) Removes the given part-specific post selection listener.voidRemoves the given post selection listener.voidremoveSelectionListener(String partId, ISelectionListener listener) Removes the given part-specific selection listener.voidremoveSelectionListener(ISelectionListener listener) Removes the given selection listener.
-
Constructor Details
-
SlaveSelectionService
-
-
Method Details
-
addPostSelectionListener
Description copied from interface:ISelectionServiceAdds the given post selection listener.It is equivalent to selection changed if the selection was triggered by the mouse but it has a delay if the selection is triggered by the keyboard arrows. Has no effect if an identical listener is already registered. Note: Works only for StructuredViewer(s).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.
Note: only update the UI when the UI is visible. See the
SelectionListenerFactoryfor listeners that will only be called when the UI is visible to the user.- Specified by:
addPostSelectionListenerin interfaceISelectionService- Parameters:
listener- a selection listener- See Also:
-
addPostSelectionListener
Description copied from interface:ISelectionServiceAdds a part-specific selection listener which is notified when selection changes in the part with the given id. This is independent of part activation - the part need not be active for notification to be sent.When the part is created, the listener is passed the part's initial selection. When the part is disposed, the listener is passed a
nullselection, but only if the listener implementsINullSelectionListener.Note: this will not correctly track editor parts as each editor does not have a unique partId.
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.
Note: only update the UI when the UI is visible. See the
SelectionListenerFactoryfor listeners that will only be called when the UI is visible to the user.- Specified by:
addPostSelectionListenerin interfaceISelectionService- Parameters:
partId- the id of the part to tracklistener- a selection listener- See Also:
-
addSelectionListener
Description copied from interface:ISelectionServiceAdds the given selection listener. 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.
Note: only update the UI when the UI is visible. See the
SelectionListenerFactoryfor listeners that will only be called when the UI is visible to the user.- Specified by:
addSelectionListenerin interfaceISelectionService- Parameters:
listener- a selection listener- See Also:
-
addSelectionListener
Description copied from interface:ISelectionServiceAdds a part-specific selection listener which is notified when selection changes in the part with the given id. This is independent of part activation - the part need not be active for notification to be sent.When the part is created, the listener is passed the part's initial selection. When the part is disposed, the listener is passed a
nullselection, but only if the listener implementsINullSelectionListener.Note: this will not correctly track editor parts as each editor does not have a unique partId.
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.
Note: only update the UI when the UI is visible. See the
SelectionListenerFactoryfor listeners that will only be called when the UI is visible to the user.- Specified by:
addSelectionListenerin interfaceISelectionService- Parameters:
partId- the id of the part to tracklistener- a selection listener- See Also:
-
getSelection
Description copied from interface:ISelectionServiceReturns the current selection in the active part. If the selection in the active part is undefined (the active part has no selection provider) the result will benull.- Specified by:
getSelectionin interfaceISelectionService- Returns:
- the current selection, or
nullif undefined
-
getSelection
Description copied from interface:ISelectionServiceReturns the current selection in the part with the given id. If the part is not open, or if the selection in the active part is undefined (the active part has no selection provider) the result will benull.- Specified by:
getSelectionin interfaceISelectionService- Parameters:
partId- the id of the part- Returns:
- the current selection, or
nullif undefined
-
removePostSelectionListener
Description copied from interface:ISelectionServiceRemoves the given post selection listener. Has no effect if an identical listener is not registered.- Specified by:
removePostSelectionListenerin interfaceISelectionService- Parameters:
listener- a selection listener
-
removePostSelectionListener
Description copied from interface:ISelectionServiceRemoves the given part-specific post selection listener. Has no effect if an identical listener is not registered for the given part id.- Specified by:
removePostSelectionListenerin interfaceISelectionService- Parameters:
partId- the id of the part to tracklistener- a selection listener
-
removeSelectionListener
Description copied from interface:ISelectionServiceRemoves the given selection listener. Has no effect if an identical listener is not registered.- Specified by:
removeSelectionListenerin interfaceISelectionService- Parameters:
listener- a selection listener
-
removeSelectionListener
Description copied from interface:ISelectionServiceRemoves the given part-specific selection listener. Has no effect if an identical listener is not registered for the given part id.- Specified by:
removeSelectionListenerin interfaceISelectionService- Parameters:
partId- the id of the part to tracklistener- a selection listener
-
dispose
public void dispose()Description copied from interface:IDisposableDisposes 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:
disposein interfaceIDisposable
-