Lines 60-65
Link Here
|
60 |
import org.eclipse.compare.internal.ICompareContextIds; |
60 |
import org.eclipse.compare.internal.ICompareContextIds; |
61 |
import org.eclipse.compare.internal.MergeSourceViewer; |
61 |
import org.eclipse.compare.internal.MergeSourceViewer; |
62 |
import org.eclipse.compare.internal.BufferedCanvas; |
62 |
import org.eclipse.compare.internal.BufferedCanvas; |
|
|
63 |
import org.eclipse.compare.internal.MergeViewerContentProvider; |
63 |
import org.eclipse.compare.internal.Utilities; |
64 |
import org.eclipse.compare.internal.Utilities; |
64 |
import org.eclipse.compare.internal.TokenComparator; |
65 |
import org.eclipse.compare.internal.TokenComparator; |
65 |
import org.eclipse.compare.internal.DocLineComparator; |
66 |
import org.eclipse.compare.internal.DocLineComparator; |
Lines 257-262
Link Here
|
257 |
private IPositionUpdater fPositionUpdater; |
258 |
private IPositionUpdater fPositionUpdater; |
258 |
private boolean fIsMotif; |
259 |
private boolean fIsMotif; |
259 |
private boolean fIsCarbon; |
260 |
private boolean fIsCarbon; |
|
|
261 |
|
262 |
private boolean fHasErrors; |
260 |
|
263 |
|
261 |
|
264 |
|
262 |
// SWT widgets |
265 |
// SWT widgets |
Lines 1664-1679
Link Here
|
1664 |
fChangeDiffs= null; |
1667 |
fChangeDiffs= null; |
1665 |
fAllDiffs= null; |
1668 |
fAllDiffs= null; |
1666 |
fEndOfDocReached= false; |
1669 |
fEndOfDocReached= false; |
|
|
1670 |
fHasErrors= false; // start with no errors |
1667 |
|
1671 |
|
1668 |
CompareConfiguration cc= getCompareConfiguration(); |
1672 |
CompareConfiguration cc= getCompareConfiguration(); |
1669 |
IMergeViewerContentProvider cp= getMergeContentProvider(); |
1673 |
IMergeViewerContentProvider cp= getMergeContentProvider(); |
1670 |
|
1674 |
|
1671 |
boolean rightEditable= cc.isRightEditable() && cp.isRightEditable(input); |
1675 |
if (cp instanceof MergeViewerContentProvider) { |
1672 |
boolean leftEditable= cc.isLeftEditable() && cp.isLeftEditable(input); |
1676 |
MergeViewerContentProvider mcp= (MergeViewerContentProvider) cp; |
|
|
1677 |
mcp.setAncestorError(null); |
1678 |
mcp.setLeftError(null); |
1679 |
mcp.setRightError(null); |
1680 |
} |
1673 |
|
1681 |
|
1674 |
fRight.setEditable(rightEditable); |
|
|
1675 |
fLeft.setEditable(leftEditable); |
1676 |
|
1677 |
// set new documents |
1682 |
// set new documents |
1678 |
setDocument(fLeft, 'L', left); |
1683 |
setDocument(fLeft, 'L', left); |
1679 |
fLeftLineCount= fLeft.getLineCount(); |
1684 |
fLeftLineCount= fLeft.getLineCount(); |
Lines 1685-1697
Link Here
|
1685 |
|
1690 |
|
1686 |
setDocument(fAncestor, 'A', ancestor); |
1691 |
setDocument(fAncestor, 'A', ancestor); |
1687 |
|
1692 |
|
1688 |
doDiff(); |
1693 |
updateHeader(); |
1689 |
|
1694 |
updateControls(); |
|
|
1695 |
updateToolItems(); |
1696 |
|
1697 |
if (!fHasErrors) |
1698 |
doDiff(); |
1699 |
|
1700 |
fRight.setEditable(cc.isRightEditable() && cp.isRightEditable(input)); |
1701 |
fLeft.setEditable(cc.isLeftEditable() && cp.isLeftEditable(input)); |
1702 |
|
1690 |
invalidateLines(); |
1703 |
invalidateLines(); |
1691 |
updateVScrollBar(); |
1704 |
updateVScrollBar(); |
1692 |
refreshBirdsEyeView(); |
1705 |
refreshBirdsEyeView(); |
1693 |
|
1706 |
|
1694 |
if (!emptyInput && !fComposite.isDisposed()) { |
1707 |
if (!fHasErrors && !emptyInput && !fComposite.isDisposed()) { |
1695 |
Diff selectDiff= null; |
1708 |
Diff selectDiff= null; |
1696 |
if (FIX_47640) { |
1709 |
if (FIX_47640) { |
1697 |
if (leftRange != null) |
1710 |
if (leftRange != null) |
Lines 1878-1883
Link Here
|
1878 |
return 0; |
1891 |
return 0; |
1879 |
} |
1892 |
} |
1880 |
|
1893 |
|
|
|
1894 |
private void setError(char type, String message) { |
1895 |
IMergeViewerContentProvider cp= getMergeContentProvider(); |
1896 |
if (cp instanceof MergeViewerContentProvider) { |
1897 |
MergeViewerContentProvider mcp= (MergeViewerContentProvider) cp; |
1898 |
switch (type) { |
1899 |
case 'A': |
1900 |
mcp.setAncestorError(message); |
1901 |
break; |
1902 |
case 'L': |
1903 |
mcp.setLeftError(message); |
1904 |
break; |
1905 |
case 'R': |
1906 |
mcp.setRightError(message); |
1907 |
break; |
1908 |
} |
1909 |
} |
1910 |
fHasErrors= true; |
1911 |
} |
1912 |
|
1881 |
/** |
1913 |
/** |
1882 |
* Returns true if a new Document could be installed. |
1914 |
* Returns true if a new Document could be installed. |
1883 |
*/ |
1915 |
*/ |
Lines 1906-1912
Link Here
|
1906 |
try { |
1938 |
try { |
1907 |
s= Utilities.readString(sca); |
1939 |
s= Utilities.readString(sca); |
1908 |
} catch (CoreException ex) { |
1940 |
} catch (CoreException ex) { |
1909 |
// NeedWork |
1941 |
setError(type, ex.getMessage()); |
1910 |
} |
1942 |
} |
1911 |
|
1943 |
|
1912 |
newDoc= new Document(s != null ? s : ""); //$NON-NLS-1$ |
1944 |
newDoc= new Document(s != null ? s : ""); //$NON-NLS-1$ |
Lines 3161-3166
Link Here
|
3161 |
|
3193 |
|
3162 |
if (fIgnoreAncestorItem != null) |
3194 |
if (fIgnoreAncestorItem != null) |
3163 |
fIgnoreAncestorItem.setVisible(isThreeWay()); |
3195 |
fIgnoreAncestorItem.setVisible(isThreeWay()); |
|
|
3196 |
|
3197 |
if (fCopyDiffLeftToRightItem != null) { |
3198 |
IAction a= fCopyDiffLeftToRightItem.getAction(); |
3199 |
if (a != null) |
3200 |
a.setEnabled(a.isEnabled() && !fHasErrors); |
3201 |
} |
3202 |
if (fCopyDiffRightToLeftItem != null) { |
3203 |
IAction a= fCopyDiffRightToLeftItem.getAction(); |
3204 |
if (a != null) |
3205 |
a.setEnabled(a.isEnabled() && !fHasErrors); |
3206 |
} |
3164 |
|
3207 |
|
3165 |
super.updateToolItems(); |
3208 |
super.updateToolItems(); |
3166 |
} |
3209 |
} |