Search in sources :

Example 36 with ITextViewerExtension

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;
}
Also used : ITextViewerExtension(org.eclipse.jface.text.ITextViewerExtension) StyledText(org.eclipse.swt.custom.StyledText) ISelectionProvider(org.eclipse.jface.viewers.ISelectionProvider) ICommandService(org.eclipse.ui.commands.ICommandService)

Aggregations

ITextViewerExtension (org.eclipse.jface.text.ITextViewerExtension)36 StyledText (org.eclipse.swt.custom.StyledText)13 Point (org.eclipse.swt.graphics.Point)13 IDocument (org.eclipse.jface.text.IDocument)8 IRewriteTarget (org.eclipse.jface.text.IRewriteTarget)7 ISelectionProvider (org.eclipse.jface.viewers.ISelectionProvider)6 ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)5 Control (org.eclipse.swt.widgets.Control)5 ITextViewer (org.eclipse.jface.text.ITextViewer)4 Composite (org.eclipse.swt.widgets.Composite)4 ICommandService (org.eclipse.ui.commands.ICommandService)4 BadLocationException (org.eclipse.jface.text.BadLocationException)3 IEclipsePreferences (org.eclipse.core.runtime.preferences.IEclipsePreferences)2 IEditingSupportRegistry (org.eclipse.jface.text.IEditingSupportRegistry)2 IRegion (org.eclipse.jface.text.IRegion)2 ICompletionProposalExtension (org.eclipse.jface.text.contentassist.ICompletionProposalExtension)2 ICompletionProposalExtension2 (org.eclipse.jface.text.contentassist.ICompletionProposalExtension2)2 LinkedModeModel (org.eclipse.jface.text.link.LinkedModeModel)2 LinkedModeUI (org.eclipse.jface.text.link.LinkedModeUI)2 LinkedPosition (org.eclipse.jface.text.link.LinkedPosition)2