public class ConvertingSelectionProvider extends Object implements ISelectionProvider
getSelection
and setSelection
. The default strategy
used to adapt the elements of the selection to IJavaElement
or a IResource
,
but implementors can override this behavior.Constructor and Description |
---|
ConvertingSelectionProvider(ISelectionProvider provider)
Creates a
ConvertingSelectionProvider to convert from a given selection provider
using the default mechanism. |
Modifier and Type | Method and Description |
---|---|
void |
addSelectionChangedListener(ISelectionChangedListener listener) |
ISelection |
convertFrom(ISelection viewerSelection)
Converts the given original viewer selection into a new
selection.
|
ISelection |
convertTo(ISelection selection)
Converts a selection to a viewer selection.
|
ISelection |
getSelection() |
void |
removeSelectionChangedListener(ISelectionChangedListener listener) |
void |
setSelection(ISelection selection) |
public ConvertingSelectionProvider(ISelectionProvider provider)
ConvertingSelectionProvider
to convert from a given selection provider
using the default mechanism.provider
- the provider to covert from and topublic ISelection convertFrom(ISelection viewerSelection)
IJavaElement
then to IResource
.
Implementors want to override this method.viewerSelection
- the original viewer selectionpublic ISelection convertTo(ISelection selection)
selection
- the selection to convertpublic final ISelection getSelection()
getSelection
in interface ISelectionProvider
public final void setSelection(ISelection selection)
setSelection
in interface ISelectionProvider
public void addSelectionChangedListener(ISelectionChangedListener listener)
addSelectionChangedListener
in interface ISelectionProvider
public void removeSelectionChangedListener(ISelectionChangedListener listener)
removeSelectionChangedListener
in interface ISelectionProvider
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.