Package org.eclipse.ui

# Class PerspectiveAdapter

java.lang.Object
org.eclipse.ui.PerspectiveAdapter

All Implemented Interfaces:
  `IPerspectiveListener`, `IPerspectiveListener2`, `IPerspectiveListener3`, `IPerspectiveListener4`

Direct Known Subclasses:
  `PerspectiveTracker`

public class PerspectiveAdapter extends Object implements IPerspectiveListener4
This adapter class provides default implementations for the methods described by the `IPerspectiveListener` interface and its extension interfaces.

Classes that wish to deal with events which occur as perspectives are added, removed, activated and changed, can extend this class and override only the methods which they are interested in.

Since:
  3.1
See Also:
  - `IPerspectiveListener`
  - `IPerspectiveListener2`
  - `IPerspectiveListener3`
  - `IPerspectiveListener4`

## Constructor Summary

Constructors
Constructor
Description
`PerspectiveAdapter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective)`
Notifies this listener that a perspective in the given page has been activated.
`void`
`perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId)`
Notifies this listener that a perspective has changed in some way (for example, editor area hidden, perspective reset, view show/hide, editor open/close, etc).
`void`
`perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId)`
Notifies this listener that a part in the given page's perspective has changed in some way (for example, view show/hide, editor open/close, etc).
`void`
`perspectiveClosed(IWorkbenchPage page, IPerspectiveDescriptor perspective)`
Notifies this listener that a perspective in the given page has been closed.
`void`
`perspectiveDeactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective)`
Notifies this listener that a perspective in the given page has been deactivated.
`void`
`perspectiveOpened(IWorkbenchPage page, IPerspectiveDescriptor perspective)`
Notifies this listener that a perspective in the given page has been opened.
`void`
`perspectivePreDeactivate(IWorkbenchPage page, IPerspectiveDescriptor perspective)`
Notifies this listener that a perspective in the given page is about to be deactivated.
`void`
`perspectiveSavedAs(IWorkbenchPage page, IPerspectiveDescriptor oldPerspective, IPerspectiveDescriptor newPerspective)`
Notifies this listener that a perspective in the given page has been saved as a new perspective with a different perspective descriptor.

### Methods inherited from class java.lang.Object

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

## Constructor Details

### PerspectiveAdapter

public PerspectiveAdapter()

## Method Details

### perspectiveOpened

public void perspectiveOpened(IWorkbenchPage page, IPerspectiveDescriptor perspective)
Description copied from interface: `IPerspectiveListener3`
Notifies this listener that a perspective in the given page has been opened.

Specified by:
  `perspectiveOpened` in interface `IPerspectiveListener3`
Parameters:
  `page` - the page containing the opened perspective
  `perspective` - the perspective descriptor that was opened
See Also:
  - `IWorkbenchPage.setPerspective(IPerspectiveDescriptor)`

### perspectiveClosed

public void perspectiveClosed(IWorkbenchPage page, IPerspectiveDescriptor perspective)
Description copied from interface: `IPerspectiveListener3`
Notifies this listener that a perspective in the given page has been closed.

Specified by:
  `perspectiveClosed` in interface `IPerspectiveListener3`
Parameters:
  `page` - the page containing the closed perspective
  `perspective` - the perspective descriptor that was closed
See Also:
  - `IWorkbenchPage.closePerspective(IPerspectiveDescriptor, boolean, boolean)`
  - `IWorkbenchPage.closeAllPerspectives(boolean, boolean)`

### perspectiveChanged

public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId)
Description copied from interface: `IPerspectiveListener2`
Notifies this listener that a part in the given page's perspective has changed in some way (for example, view show/hide, editor open/close, etc).

Specified by:
  `perspectiveChanged` in interface `IPerspectiveListener2`
Parameters:
  `page` - the workbench page containing the perspective
  `perspective` - the descriptor for the changed perspective
  `partRef` - the reference to the affected part
  `changeId` - one of the `CHANGE_*` constants on IWorkbenchPage

### perspectiveActivated

public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective)
Description copied from interface: `IPerspectiveListener`
Notifies this listener that a perspective in the given page has been activated.

Specified by:
  `perspectiveActivated` in interface `IPerspectiveListener`
Parameters:
  `page` - the page containing the activated perspective
  `perspective` - the perspective descriptor that was activated
See Also:
  - `IWorkbenchPage.setPerspective(org.eclipse.ui.IPerspectiveDescriptor)`

### perspectiveChanged

public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId)
Description copied from interface: `IPerspectiveListener`
Notifies this listener that a perspective has changed in some way (for example, editor area hidden, perspective reset, view show/hide, editor open/close, etc).

Specified by:
  `perspectiveChanged` in interface `IPerspectiveListener`
Parameters:
  `page` - the page containing the affected perspective
  `perspective` - the perspective descriptor
  `changeId` - one of the `CHANGE_*` constants on IWorkbenchPage

### perspectiveDeactivated

public void perspectiveDeactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective)
Description copied from interface: `IPerspectiveListener3`
Notifies this listener that a perspective in the given page has been deactivated.

Specified by:
  `perspectiveDeactivated` in interface `IPerspectiveListener3`
Parameters:
  `page` - the page containing the deactivated perspective
  `perspective` - the perspective descriptor that was deactivated
See Also:
  - `IWorkbenchPage.setPerspective(IPerspectiveDescriptor)`

### perspectiveSavedAs

public void perspectiveSavedAs(IWorkbenchPage page, IPerspectiveDescriptor oldPerspective, IPerspectiveDescriptor newPerspective)
Description copied from interface: `IPerspectiveListener3`
Notifies this listener that a perspective in the given page has been saved as a new perspective with a different perspective descriptor.

Specified by:
  `perspectiveSavedAs` in interface `IPerspectiveListener3`
Parameters:
  `page` - the page containing the saved perspective
  `oldPerspective` - the old perspective descriptor
  `newPerspective` - the new perspective descriptor
See Also:
  - `IWorkbenchPage.savePerspectiveAs(IPerspectiveDescriptor)`

### perspectivePreDeactivate

public void perspectivePreDeactivate(IWorkbenchPage page, IPerspectiveDescriptor perspective)

Notifies this listener that a perspective in the given page is about to be deactivated.

Note: This does not have the ability to veto a perspective deactivation.

Specified by:
  `perspectivePreDeactivate` in interface `IPerspectiveListener4`
Parameters:
  `page` - the page containing the deactivated perspective
  `perspective` - the perspective descriptor that was deactivated
Since:
  3.2
See Also:
  - `IWorkbenchPage.setPerspective(IPerspectiveDescriptor)`