# Class SelectionChangedEvent

java.lang.Object
java.util.EventObject
org.eclipse.jface.viewers.SelectionChangedEvent

All Implemented Interfaces:
  `Serializable`

public class SelectionChangedEvent extends EventObject
Event object describing a selection change. The source of these events is a selection provider.

See Also:
  - `ISelection`
  - `ISelectionProvider`
  - `ISelectionChangedListener`
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`protected ISelection`
`selection`
The selection.

### Fields inherited from class EventObject

`source`

## Constructor Summary

Constructors
Constructor
Description
`SelectionChangedEvent(ISelectionProvider source, ISelection selection)`
Creates a new event for the given source and selection.

## Method Summary

Modifier and Type
Method
Description
`ISelection`
`getSelection()`
Returns the selection.
`ISelectionProvider`
`getSelectionProvider()`
Returns the selection provider that is the source of this event.
`IStructuredSelection`
`getStructuredSelection()`
Returns the selection.

### Methods inherited from class EventObject

`getSource, toString`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### selection

protected ISelection selection
The selection.

## Constructor Details

### SelectionChangedEvent

public SelectionChangedEvent(ISelectionProvider source, ISelection selection)
Creates a new event for the given source and selection.

Parameters:
  `source` - the selection provider
  `selection` - the selection

## Method Details

### getSelection

public ISelection getSelection()
Returns the selection.

Returns:
  the selection

### getStructuredSelection

public IStructuredSelection getStructuredSelection() throws ClassCastException
Returns the selection.

Returns:
  IStructuredSelection
Throws:
  `ClassCastException` - if the selection is not an instance of IStructuredSelection
Since:
  3.13

### getSelectionProvider

public ISelectionProvider getSelectionProvider()
Returns the selection provider that is the source of this event.

Returns:
  the originating selection provider