Eclipse Platform
2.0

org.eclipse.ui.part
Class MultiPageSelectionProvider

java.lang.Object
  |
  +--org.eclipse.ui.part.MultiPageSelectionProvider
All Implemented Interfaces:
ISelectionProvider

public class MultiPageSelectionProvider
extends Object
implements ISelectionProvider

Manages the current selection in a multi-page editor by tracking the active nested editor within the multi-page editor. When the selection changes, notifications are sent to all registered listeners.

This class may be instantiated; it is not intended to be subclassed. The base implementation of MultiPageEditor.init creates an instance of this class.


Constructor Summary
MultiPageSelectionProvider(MultiPageEditorPart multiPageEditor)
          Creates a selection provider for the given multi-page editor.
 
Method Summary
 void addSelectionChangedListener(ISelectionChangedListener listener)
          Adds a listener for selection changes in this selection provider.
 void fireSelectionChanged(SelectionChangedEvent event)
          Notifies all registered selection changed listeners that the editor's selection has changed.
 MultiPageEditorPart getMultiPageEditor()
          Returns the multi-page editor.
 ISelection getSelection()
          Returns the current selection for this provider.
 void removeSelectionChangedListener(ISelectionChangedListener listener)
          Removes the given selection change listener from this selection provider.
 void setSelection(ISelection selection)
          Sets the current selection for this selection provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiPageSelectionProvider

public MultiPageSelectionProvider(MultiPageEditorPart multiPageEditor)
Creates a selection provider for the given multi-page editor.

Parameters:
multiPageEditor - the multi-page editor
Method Detail

addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener listener)
Description copied from interface: ISelectionProvider
Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.

Specified by:
addSelectionChangedListener in interface ISelectionProvider
Parameters:
listener - a selection changed listener

fireSelectionChanged

public void fireSelectionChanged(SelectionChangedEvent event)
Notifies all registered selection changed listeners that the editor's selection has changed. Only listeners registered at the time this method is called are notified.

Parameters:
event - the selection changed event

getMultiPageEditor

public MultiPageEditorPart getMultiPageEditor()
Returns the multi-page editor.


getSelection

public ISelection getSelection()
Description copied from interface: ISelectionProvider
Returns the current selection for this provider.

Specified by:
getSelection in interface ISelectionProvider
Returns:
the current selection

removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener listener)
Description copied from interface: ISelectionProvider
Removes the given selection change listener from this selection provider. Has no affect if an identical listener is not registered.

Specified by:
removeSelectionChangedListener in interface ISelectionProvider
Parameters:
listener - a selection changed listener

setSelection

public void setSelection(ISelection selection)
Description copied from interface: ISelectionProvider
Sets the current selection for this selection provider.

Specified by:
setSelection in interface ISelectionProvider
Parameters:
selection - the new selection

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.