T
- The type of objects provided by the IRowDataProviderpublic class RowSelectionProvider<T> extends Object implements org.eclipse.jface.viewers.ISelectionProvider, ILayerListener
Constructor and Description |
---|
RowSelectionProvider(SelectionLayer selectionLayer,
IRowDataProvider<T> rowDataProvider)
Create a RowSelectionProvider that only handles fully selected rows and only fires
SelectionChangedEvents if the row selection changes.
|
RowSelectionProvider(SelectionLayer selectionLayer,
IRowDataProvider<T> rowDataProvider,
boolean fullySelectedRowsOnly)
Create a RowSelectionProvider that only fires SelectionChangedEvents if the row selection changes.
|
RowSelectionProvider(SelectionLayer selectionLayer,
IRowDataProvider<T> rowDataProvider,
boolean fullySelectedRowsOnly,
boolean handleSameRowSelection)
Create a RowSelectionProvider configured with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener) |
org.eclipse.jface.viewers.ISelection |
getSelection() |
void |
handleLayerEvent(ILayerEvent event)
Handle an event notification from an
ILayer |
void |
removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener) |
void |
setAddSelectionOnSet(boolean addSelectionOnSet)
Configure whether
setSelection() should add or set the selection. |
void |
setSelection(org.eclipse.jface.viewers.ISelection selection) |
public RowSelectionProvider(SelectionLayer selectionLayer, IRowDataProvider<T> rowDataProvider)
selectionLayer
- The SelectionLayer this ISelectionProvider is connected torowDataProvider
- The IRowDataProvider needed to access the selected row datapublic RowSelectionProvider(SelectionLayer selectionLayer, IRowDataProvider<T> rowDataProvider, boolean fullySelectedRowsOnly)
selectionLayer
- The SelectionLayer this ISelectionProvider is connected torowDataProvider
- The IRowDataProvider needed to access the selected row datafullySelectedRowsOnly
- Flag to determine if only fully selected rows should be used
to populate the selection or if any selection should be populated.public RowSelectionProvider(SelectionLayer selectionLayer, IRowDataProvider<T> rowDataProvider, boolean fullySelectedRowsOnly, boolean handleSameRowSelection)
selectionLayer
- The SelectionLayer this ISelectionProvider is connected torowDataProvider
- The IRowDataProvider needed to access the selected row datafullySelectedRowsOnly
- Flag to determine if only fully selected rows should be used
to populate the selection or if any selection should be populated.handleSameRowSelection
- Flag to configure whether only SelectionChangedEvents should be
fired if the row selection changes or even if you just select another column.public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
addSelectionChangedListener
in interface org.eclipse.jface.viewers.ISelectionProvider
public org.eclipse.jface.viewers.ISelection getSelection()
getSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
removeSelectionChangedListener
in interface org.eclipse.jface.viewers.ISelectionProvider
public void setSelection(org.eclipse.jface.viewers.ISelection selection)
setSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
public void handleLayerEvent(ILayerEvent event)
ILayerListener
ILayer
handleLayerEvent
in interface ILayerListener
event
- the eventpublic void setAddSelectionOnSet(boolean addSelectionOnSet)
setSelection()
should add or set the selection.
This was added for convenience because the initial code always added the selection
on setSelection()
by creating a SelectRowsCommand with the withControlMask set to true
.
Looking at the specification, setSelection()
is used to set the new selection.
So the default here is now to set instead of add. But for convenience to older code
that relied on the add behaviour it is now possible to change it back to adding.
addSelectionOnSet
- true
to add the selection on calling setSelection()
The default is false
to behave like specified in RowSelectionProviderCopyright © 2013. All Rights Reserved.