Package org.eclipse.ui

# Interface ISelectionListener

All Superinterfaces:
  `EventListener`

All Known Subinterfaces:
  `INullSelectionListener`, `IPropertySheetPage`

All Known Implementing Classes:
  `EditorPluginAction`, `ObjectPluginAction`, `PartPluginAction`, `PartSelectionListener`, `PluginAction`, `PropertySheet`, `PropertySheetPage`, `TabbedPropertySheetPage`, `ViewPluginAction`, `WWinPluginAction`, `WWinPluginPulldown`

public interface ISelectionListener extends EventListener
Interface for listening to selection changes.

This interface may be implemented by clients.

See Also:
  - `ISelectionService.addSelectionListener(ISelectionListener)`
  - `ISelectionService.addSelectionListener(String, ISelectionListener)`
  - `INullSelectionListener`

## Method Summary

Modifier and Type
Method
Description
`void`
`selectionChanged(IWorkbenchPart part, ISelection selection)`
Notifies this listener that the selection has changed.

## Method Details

### selectionChanged

void selectionChanged(IWorkbenchPart part, ISelection selection)
Notifies this listener that the selection has changed.

Note: it is important that this method returns as quickly as possible to avoid UI freezes. For example, do not update the UI if the UI is not visible. See the `SelectionListenerFactory` for listeners that are build for this purpose.

This method is called when the selection changes to a `non-null` value, but not when the selection changes to `null`. If there is a requirement to be notified in the latter scenario, implement `INullSelectionListener`. The event will be posted through this method.

Parameters:
  `part` - the workbench part containing the selection
  `selection` - the current selection. This may be `null` if `INullSelectionListener` is implemented.
See Also:
  - `SelectionListenerFactory.createVisibleListener(IWorkbenchPart, ISelectionListener)`
  - `SelectionListenerFactory.createVisibleSelfMutedListener(IWorkbenchPart, ISelectionListener)`