@Override protected void handleCompareInputChange() { try { beginRefresh(); super.handleCompareInputChange(); } finally { endRefresh(); } }
private boolean flush(final ContributorInfo info) { try { return info.flush(); } catch (CoreException e) { handleException(e); } return false; }
@Override protected void updateHeader() { super.updateHeader(); updateControls(); }
@Override void flushLeftSide(Object oldInput, IProgressMonitor monitor){ IMergeViewerContentProvider content= getMergeContentProvider(); Object leftContent = content.getLeftContent(oldInput); if (leftContent != null && isLeftEditable() && isLeftDirty()) { if (fLeftContributor.hasSharedDocument(leftContent)) { if (flush(fLeftContributor)) setLeftDirty(false); } } if (!(content instanceof MergeViewerContentProvider) || isLeftDirty()) { super.flushLeftSide(oldInput, monitor); } }
@Override void flushRightSide(Object oldInput, IProgressMonitor monitor){ IMergeViewerContentProvider content= getMergeContentProvider(); Object rightContent = content.getRightContent(oldInput); if (rightContent != null && isRightEditable() && isRightDirty()) { if (fRightContributor.hasSharedDocument(rightContent)) { if (flush(fRightContributor)) setRightDirty(false); } } if (!(content instanceof MergeViewerContentProvider) || isRightDirty()) { super.flushRightSide(oldInput, monitor); } }
@Override protected void flushContent(Object oldInput, IProgressMonitor monitor) { flushLeftSide(oldInput, monitor); flushRightSide(oldInput, monitor); IMergeViewerContentProvider content = getMergeContentProvider(); if (!(content instanceof MergeViewerContentProvider) || isLeftDirty() || isRightDirty()) { super.flushContent(oldInput, monitor); } }
private void resetDocument() { // Need to remove the document from the manager before refreshing // or the old document will still be found clearCachedDocument(); // TODO: This is fine for now but may need to be revisited if a refresh is performed // higher up as well (e.g. perhaps a refresh request that waits until after all parties // have been notified). if (checkState()) fViewer.refresh(); }
@Override public boolean isDirty() { if (fFocusPart == fLeft) { return isLeftDirty(); } else if (fFocusPart == fRight) { return isRightDirty(); } return false; }
/** * @param monitor * @noreference This method is not intended to be referenced by clients. */ @Override public void flushRight(IProgressMonitor monitor) { flushRightSide(getInput(), monitor); }
@Override public void run() { copy(leftToRight); } });
@Override public IStatus runInUIThread(IProgressMonitor monitor) { update(true); updateStructure(fLeg); return Status.OK_STATUS; } }.schedule();
@Override public Object getInput() { return TextMergeViewer.this.getInput(); } @Override
/** * Sets the viewer's foreground color to the given RGB value. * If the value is <code>null</code> the system's default foreground color is used. * @param foreground the foreground color or <code>null</code> to use the system's default foreground color * @since 2.0 */ public void setForegroundColor(RGB foreground) { fIsUsingSystemForeground= (foreground == null); fForeground= foreground; updateColors(null); }
private IFindReplaceTarget getFindReplaceTarget() { if (fFindReplaceTarget == null) fFindReplaceTarget= new FindReplaceTarget(); return fFindReplaceTarget; }
public void mouseUp(MouseEvent e) { fIsDown= false; if (!fLiveResize) resize(e); }
private int[] getCenterCurvePoints(int startx, int starty, int endx, int endy) { if (fBasicCenterCurve == null) buildBaseCenterCurve(endx-startx); double height= endy - starty; height= height/2; int width= endx-startx; int[] points= new int[width]; for (int i= 0; i < width; i++) { points[i]= (int) (-height * fBasicCenterCurve[i] + height + starty); } return points; }
private Diff findNewDiff(Diff oldDiff) { if (oldDiff == null) return null; Diff newDiff = findNewDiff(oldDiff, LEFT_CONTRIBUTOR); if (newDiff == null) { newDiff = findNewDiff(oldDiff, RIGHT_CONTRIBUTOR); } return newDiff; }
protected void handleCompareInputChange() { try { beginRefresh(); super.handleCompareInputChange(); } finally { endRefresh(); } }
private void resetDocument() { // Need to remove the document from the manager before refreshing // or the old document will still be found clearCachedDocument(); // TODO: This is fine for now but may need to be revisited if a refresh is performed // higher up as well (e.g. perhaps a refresh request that waits until after all parties // have been notified). if (checkState()) fViewer.refresh(); }
private boolean flush(final ContributorInfo info) { try { return info.flush(); } catch (CoreException e) { handleException(e); } return false; }