public void elementContentReplaced(Object element) { if (!checkState()) return; IEditorInput input = getDocumentKey(); if (input != null && input.equals(element)) { this.fViewer.updateDirtyState(input, getDocumentProvider(), fLeg); } } public void elementContentAboutToBeReplaced(Object element) {
@Override public void elementDirtyStateChanged(Object element, boolean isDirty) { if (!checkState()) return; IEditorInput input = getDocumentKey(); if (input != null && input.equals(element)) { this.fViewer.updateDirtyState(input, getDocumentProvider(), fLeg); } }
public void elementDirtyStateChanged(Object element, boolean isDirty) { if (!checkState()) return; IEditorInput input = getDocumentKey(); if (input != null && input.equals(element)) { this.fViewer.updateDirtyState(input, getDocumentProvider(), fLeg); } }
IDocumentProvider documentProvider = getDocumentProvider(); if (documentProvider != null) { try {
/** * Connect to a shared document if possible. Return <code>null</code> * if the connection was not possible. * @return the shared document or <code>null</code> if connection to a * shared document was not possible */ private IDocument connectToSharedDocument() { IEditorInput key = getDocumentKey(); if (key != null) { if (fDocumentProvider != null) { // We've already connected and setup the document return fDocumentProvider.getDocument(key); } IDocumentProvider documentProvider = getDocumentProvider(); if (documentProvider != null) { try { connect(documentProvider, key); setCachedDocumentProvider(key, documentProvider); IDocument newDoc = documentProvider.getDocument(key); this.fViewer.updateDirtyState(key, documentProvider, fLeg); return newDoc; } catch (CoreException e) { // Connection failed. Log the error and continue without a shared document CompareUIPlugin.log(e); } } } return null; }
@Override public void elementContentReplaced(Object element) { if (!checkState()) return; IEditorInput input = getDocumentKey(); if (input != null && input.equals(element)) { this.fViewer.updateDirtyState(input, getDocumentProvider(), fLeg); // recalculate diffs and update controls new UIJob(CompareMessages.DocumentMerger_0) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { update(true); updateStructure(fLeg); return Status.OK_STATUS; } }.schedule(); } } @Override