((IPostSelectionProvider) textSelectionProvider)
.addPostSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(
SelectionChangedEvent event) {
if (event.getSelection() instanceof TextSelection) {
TextSelection textSelection = ((TextSelection) event
.getSelection());
_designViewer
.getSynchronizer()
.textSelectionChanged(
textSelection.getOffset(),
textSelection.getOffset()
+ textSelection
.getLength());
}
}
});
} else {
textSelectionProvider
.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(
SelectionChangedEvent event) {
TextSelection textSelection = ((TextSelection) event
.getSelection());
_designViewer.getSynchronizer()
.textSelectionChanged(
textSelection.getOffset(),
textSelection.getOffset()
+ textSelection
.getLength());
}
});
}
}