Package org.eclipse.ui.texteditor
Class AbstractTextEditor.SelectionProvider
java.lang.Object
org.eclipse.ui.texteditor.AbstractTextEditor.SelectionProvider
- All Implemented Interfaces:
ISelectionValidator
,IPostSelectionProvider
,ISelectionProvider
- Enclosing class:
- AbstractTextEditor
protected class AbstractTextEditor.SelectionProvider
extends Object
implements IPostSelectionProvider, ISelectionValidator
Editor specific selection provider which wraps the source viewer's selection provider.
- Since:
- 3.4 protected, was added in 2.1 as private class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener for post selection changes in this selection provider.void
Adds a listener for selection changes in this selection provider.Returns the current selection for this provider.boolean
isValid
(ISelection postSelection) Tests whether the given post selection is still valid.void
Removes the given listener for post selection changes from this selection provider.void
Removes the given selection change listener from this selection provider.void
setSelection
(ISelection selection) Sets the current selection for this selection provider.
-
Constructor Details
-
SelectionProvider
protected SelectionProvider()
-
-
Method Details
-
addSelectionChangedListener
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 interfaceISelectionProvider
- Parameters:
listener
- a selection changed listener
-
getSelection
Description copied from interface:ISelectionProvider
Returns the current selection for this provider.- Specified by:
getSelection
in interfaceISelectionProvider
- Returns:
- the current selection
-
removeSelectionChangedListener
Description copied from interface:ISelectionProvider
Removes the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
removeSelectionChangedListener
in interfaceISelectionProvider
- Parameters:
listener
- a selection changed listener
-
setSelection
Description copied from interface:ISelectionProvider
Sets the current selection for this selection provider.- Specified by:
setSelection
in interfaceISelectionProvider
- Parameters:
selection
- the new selection
-
addPostSelectionChangedListener
Description copied from interface:IPostSelectionProvider
Adds a listener for post selection changes in this selection provider. Has no effect if an identical listener is already registered.- Specified by:
addPostSelectionChangedListener
in interfaceIPostSelectionProvider
- Parameters:
listener
- a selection changed listener
-
removePostSelectionChangedListener
Description copied from interface:IPostSelectionProvider
Removes the given listener for post selection changes from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
removePostSelectionChangedListener
in interfaceIPostSelectionProvider
- Parameters:
listener
- a selection changed listener
-
isValid
Description copied from interface:ISelectionValidator
Tests whether the given post selection is still valid.- Specified by:
isValid
in interfaceISelectionValidator
- Parameters:
postSelection
- the selection- Returns:
true
if the selection is still valid
-