use of org.eclipse.jface.text.ITextViewerExtension in project mylyn.docs by eclipse.
the class FindAndReplaceTarget method uninstall.
private void uninstall() {
if (!installed) {
return;
}
StyledText textWidget = textViewer.getTextWidget();
if (textWidget == null) {
return;
}
textViewer.removeTextListener(this);
textWidget.removeMouseListener(this);
textWidget.removeFocusListener(this);
ISelectionProvider selectionProvider = textViewer.getSelectionProvider();
if (selectionProvider != null) {
selectionProvider.removeSelectionChangedListener(this);
}
if (textViewer instanceof ITextViewerExtension) {
((ITextViewerExtension) textViewer).removeVerifyKeyListener(this);
} else {
textWidget.removeVerifyKeyListener(this);
}
ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getAdapter(ICommandService.class);
if (commandService != null) {
commandService.removeExecutionListener(this);
}
installed = false;
}
Aggregations