public void uninstall() { if (isInstalled) { textViewer.removeTextInputListener(textInputListener); isInstalled = false; if (documentListener != null) { if (textViewer instanceof ISourceViewerExtension4) { ContentAssistantFacade facade = ((ISourceViewerExtension4) textViewer).getContentAssistantFacade(); facade.removeCompletionListener(documentListener); } if (textViewer.getDocument() instanceof IXtextDocument) { ((IXtextDocument) textViewer.getDocument()) .removeXtextDocumentContentObserver(documentListener); } } } }
public void uninstall() { IWorkbenchPartSite site = fEditor.getSite(); IWorkbenchWindow window = site.getWorkbenchWindow(); window.getPartService().removePartListener(fPartListener); fPartListener = null; fViewer.removeTextInputListener(fModelListener); fModelListener = null; IWorkspace workspace = EDTUIPlugin.getWorkspace(); workspace.removeResourceChangeListener(fResourceChangeListener); fResourceChangeListener = null; EDTUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(fPropertyListener); fPropertyListener = null; synchronized (this) { BackgroundThread bt = fThread; fThread = null; bt.cancel(); } }