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
Constructors Modifier Constructor Description protectedSelectionProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPostSelectionChangedListener(ISelectionChangedListener listener)Adds a listener for post selection changes in this selection provider.voidaddSelectionChangedListener(ISelectionChangedListener listener)Adds a listener for selection changes in this selection provider.ISelectiongetSelection()Returns the current selection for this provider.booleanisValid(ISelection postSelection)Tests whether the given post selection is still valid.voidremovePostSelectionChangedListener(ISelectionChangedListener listener)Removes the given listener for post selection changes from this selection provider.voidremoveSelectionChangedListener(ISelectionChangedListener listener)Removes the given selection change listener from this selection provider.voidsetSelection(ISelection selection)Sets the current selection for this selection provider.
-
-
-
Method Detail
-
addSelectionChangedListener
public void addSelectionChangedListener(ISelectionChangedListener listener)
Description copied from interface:ISelectionProviderAdds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.- Specified by:
addSelectionChangedListenerin interfaceISelectionProvider- Parameters:
listener- a selection changed listener
-
getSelection
public ISelection getSelection()
Description copied from interface:ISelectionProviderReturns the current selection for this provider.- Specified by:
getSelectionin interfaceISelectionProvider- Returns:
- the current selection
-
removeSelectionChangedListener
public void removeSelectionChangedListener(ISelectionChangedListener listener)
Description copied from interface:ISelectionProviderRemoves the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
removeSelectionChangedListenerin interfaceISelectionProvider- Parameters:
listener- a selection changed listener
-
setSelection
public void setSelection(ISelection selection)
Description copied from interface:ISelectionProviderSets the current selection for this selection provider.- Specified by:
setSelectionin interfaceISelectionProvider- Parameters:
selection- the new selection
-
addPostSelectionChangedListener
public void addPostSelectionChangedListener(ISelectionChangedListener listener)
Description copied from interface:IPostSelectionProviderAdds a listener for post selection changes in this selection provider. Has no effect if an identical listener is already registered.- Specified by:
addPostSelectionChangedListenerin interfaceIPostSelectionProvider- Parameters:
listener- a selection changed listener
-
removePostSelectionChangedListener
public void removePostSelectionChangedListener(ISelectionChangedListener listener)
Description copied from interface:IPostSelectionProviderRemoves the given listener for post selection changes from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
removePostSelectionChangedListenerin interfaceIPostSelectionProvider- Parameters:
listener- a selection changed listener
-
isValid
public boolean isValid(ISelection postSelection)
Description copied from interface:ISelectionValidatorTests whether the given post selection is still valid.- Specified by:
isValidin interfaceISelectionValidator- Parameters:
postSelection- the selection- Returns:
trueif the selection is still valid
-
-