/** * Disonnect the CompilationUnitDocumentProvider from the * * @input and disconnect the annotation model from the provider from the IDocument of the * @input. */ protected void disconnect(IEditorInput input) { IDocument doc = cuDocumentProvider.getDocument(input); cuDocumentProvider.getAnnotationModel(input).disconnect(doc); javaWorkingCopyManager.disconnect(input); }
protected void revert(IEditorInput input) { try { cuDocumentProvider.resetDocument(input); } catch (CoreException e) { Logger.getLogger().logError(e); } IDocument doc = cuDocumentProvider.getDocument(input); IAnnotationModel model = cuDocumentProvider.getAnnotationModel(input); if (model instanceof AbstractMarkerAnnotationModel) { AbstractMarkerAnnotationModel markerModel = (AbstractMarkerAnnotationModel) model; markerModel.resetMarkers(); } model.disconnect(doc); javaWorkingCopyManager.disconnect(input); }
public void dispose() { AJLog.log("Disposing editor for:" + getTitle()); //$NON-NLS-1$ IEditorInput input = getEditorInput(); if (input instanceof IFileEditorInput) { IFileEditorInput fInput = (IFileEditorInput) input; // Fix for bug 79633 - editor buffer is not refreshed JavaUI.getWorkingCopyManager().disconnect(input); AJLog.log("Editor closed - " + fInput.getFile().getName()); //$NON-NLS-1$ synchronized(activeEditorList) { activeEditorList.remove(this); } try { ICompilationUnit unit = AJCompilationUnitManager.INSTANCE.getAJCompilationUnitFromCache(fInput.getFile()); if (unit != null) { unit.discardWorkingCopy(); } } catch (JavaModelException e) { } } if (aspectJEditorErrorTickUpdater != null) { aspectJEditorErrorTickUpdater.dispose(); aspectJEditorErrorTickUpdater = null; } if (AspectJUIPlugin.usingXref) { XRefUIUtils.removeWorkingCopyManagerForEditor(this); } super.dispose(); }