Lines 1003-1008
Link Here
|
1003 |
IEditorInput input = getDocumentKey(); |
1003 |
IEditorInput input = getDocumentKey(); |
1004 |
if (input != null && input.equals(element)) { |
1004 |
if (input != null && input.equals(element)) { |
1005 |
this.fViewer.updateDirtyState(input, getDocumentProvider(), fLeg); |
1005 |
this.fViewer.updateDirtyState(input, getDocumentProvider(), fLeg); |
|
|
1006 |
|
1007 |
// recalculate diffs and update controls |
1008 |
new UIJob(CompareMessages.DocumentMerger_0) { |
1009 |
public IStatus runInUIThread(IProgressMonitor monitor) { |
1010 |
update(true); |
1011 |
return Status.OK_STATUS; |
1012 |
} |
1013 |
}.schedule(); |
1006 |
} |
1014 |
} |
1007 |
} |
1015 |
} |
1008 |
public void elementContentAboutToBeReplaced(Object element) { |
1016 |
public void elementContentAboutToBeReplaced(Object element) { |
Lines 2491-2498
Link Here
|
2491 |
} |
2499 |
} |
2492 |
|
2500 |
|
2493 |
private void contributeChangeEncodingAction(MergeSourceViewer viewer) { |
2501 |
private void contributeChangeEncodingAction(MergeSourceViewer viewer) { |
2494 |
ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.ui.texteditor.ConstructedTextEditorMessages"); //$NON-NLS-1$ |
2502 |
IAction action = new ChangeEncodingAction(getTextEditorAdapter()); |
2495 |
IAction action = new ChangeEncodingAction(bundle, "Editor.ChangeEncodingAction.", getTextEditorAdapter()); //$NON-NLS-1$ |
|
|
2496 |
viewer.addAction(MergeSourceViewer.CHANGE_ENCODING_ID, action); |
2503 |
viewer.addAction(MergeSourceViewer.CHANGE_ENCODING_ID, action); |
2497 |
} |
2504 |
} |
2498 |
|
2505 |
|
Lines 2879-2901
Link Here
|
2879 |
setRightDirty(dirty); |
2886 |
setRightDirty(dirty); |
2880 |
} |
2887 |
} |
2881 |
|
2888 |
|
2882 |
if (needsDiffRecalculation(e)) { |
2889 |
updateLines(doc); |
2883 |
new UIJob(CompareMessages.DocumentMerger_0) { |
|
|
2884 |
public IStatus runInUIThread(IProgressMonitor monitor) { |
2885 |
// do diff and update controls |
2886 |
update(true); |
2887 |
return Status.OK_STATUS; |
2888 |
} |
2889 |
}.schedule(); |
2890 |
} else { |
2891 |
updateLines(doc); |
2892 |
} |
2893 |
} |
2894 |
|
2895 |
private boolean needsDiffRecalculation(DocumentEvent e) { |
2896 |
IDocument doc = e.getDocument(); |
2897 |
// the doc has been replaced completely |
2898 |
return e.fOffset == 0 && doc.get().length() == e.fText.length(); |
2899 |
} |
2890 |
} |
2900 |
|
2891 |
|
2901 |
/* |
2892 |
/* |