private boolean isPatchHunkOk() { if (isPatchHunk()) return Utilities.isHunkOk(getInput()); return false; }
protected void updateToolItems() { //only update toolbar items if diffs need to be calculated (which //dictates whether a toolbar gets added at all) if (!isPatchHunk()){ if (fIgnoreAncestorItem != null) fIgnoreAncestorItem.setVisible(isThreeWay()); if (fCopyDiffLeftToRightItem != null) { IAction a= fCopyDiffLeftToRightItem.getAction(); if (a != null) a.setEnabled(a.isEnabled() && !fHasErrors); } if (fCopyDiffRightToLeftItem != null) { IAction a= fCopyDiffRightToLeftItem.getAction(); if (a != null) a.setEnabled(a.isEnabled() && !fHasErrors); } super.updateToolItems(); } }
@Override protected void updateToolItems() { if (fCopyDiffLeftToRightItem != null) { fCopyDiffLeftToRightItem.setVisible(isRightEditable()); } if (fCopyDiffRightToLeftItem != null) { fCopyDiffRightToLeftItem.setVisible(isLeftEditable()); } //only update toolbar items if diffs need to be calculated (which //dictates whether a toolbar gets added at all) if (!isPatchHunk()){ if (fIgnoreAncestorItem != null) fIgnoreAncestorItem.setVisible(isThreeWay()); if (fCopyDiffLeftToRightItem != null) { IAction a= fCopyDiffLeftToRightItem.getAction(); if (a != null) a.setEnabled(a.isEnabled() && !fHasErrors); } if (fCopyDiffRightToLeftItem != null) { IAction a= fCopyDiffRightToLeftItem.getAction(); if (a != null) a.setEnabled(a.isEnabled() && !fHasErrors); } } super.updateToolItems(); }
if (aDoc != null) { sancestor= new DocLineComparator(aDoc, toRegion(aRegion), ignoreWhiteSpace); if (isPatchHunk()) { ITypedElement right = ((ICompareInput)getInput()).getRight(); isRight = right != null && Utilities.getAdapter(right, IHunk.class) != null; int rightEnd= getTokenEnd2(sright, es.rightStart(), es.rightLength()); if (isPatchHunk()) { if (isRight) leftStart = leftEnd = getHunkStart(); if (ignoreWhiteSpace && !isPatchHunk()) { if (sancestor != null) a= extract2(aDoc, sancestor, es.ancestorStart(), es.ancestorLength()); if (!isPatchHunk()) { if (s == null) s= extract2(lDoc, sleft, es.leftStart(), es.leftLength());
IMergeViewerContentProvider cp= getMergeContentProvider(); if (cp != null) { if (!isPatchHunk()) { rightToLeft= cp.isLeftEditable(getInput()); leftToRight= cp.isRightEditable(getInput());
IMergeViewerContentProvider cp= getMergeContentProvider(); if (cp != null) { if (!isPatchHunk()) { rightToLeft= cp.isLeftEditable(getInput()); leftToRight= cp.isRightEditable(getInput());
if (isPatchHunk()){ setSyncScrolling(false); } else { if (isPatchHunk()) { if (right != null && Utilities.getAdapter(right, IHunk.class) != null) fLeft.setTopIndex(getHunkStart());
if (isPatchHunk()) { if (right != null && Adapters.adapt(right, IHunk.class) != null) fLeft.getSourceViewer().setTopIndex(getHunkStart());