protected void disconnectDocuments() { IMergeViewerContentProvider contentProvider = (IMergeViewerContentProvider) getContentProvider(); Object ancestorContent = contentProvider.getAncestorContent(getInput()); Object leftContent = contentProvider.getLeftContent(getInput()); Object rightContent = contentProvider.getRightContent(getInput()); documentProvider.disconnect(inputObjectStreamContentAccessorMap.get(ancestorContent)); documentProvider.disconnect(inputObjectStreamContentAccessorMap.get(leftContent)); documentProvider.disconnect(inputObjectStreamContentAccessorMap.get(rightContent)); }
void flushLeftSide(Object input, IProgressMonitor monitor) { IMergeViewerContentProvider content = (IMergeViewerContentProvider) getContentProvider(); boolean rightEmpty = content.getRightContent(input) == null; if (getCompareConfiguration().isLeftEditable() && isLeftDirty()) { byte[] bytes = getContents(true); if (rightEmpty && bytes != null && bytes.length == 0) bytes = null; setLeftDirty(false); content.saveLeftContent(input, bytes); } }
@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); } }
boolean rightEmpty= content.getRightContent(input) == null;
protected void flushContent(Object oldInput, IProgressMonitor monitor) { // check and handle any shared buffers IMergeViewerContentProvider content= getMergeContentProvider(); Object leftContent = content.getLeftContent(oldInput); Object rightContent = content.getRightContent(oldInput); if (leftContent != null && getCompareConfiguration().isLeftEditable() && isLeftDirty()) { if (fLeftContributor.hasSharedDocument(leftContent)) { if (flush(fLeftContributor)) setLeftDirty(false); } } if (rightContent != null && getCompareConfiguration().isRightEditable() && isRightDirty()) { if (fRightContributor.hasSharedDocument(rightContent)) { if (flush(fRightContributor)) setRightDirty(false); } } if (!(content instanceof MergeViewerContentProvider) || isLeftDirty() || isRightDirty()) { super.flushContent(oldInput, monitor); } }
Object right= content.getRightContent(input); updateContent(ancestor, left, right);
private void internalRefresh(Object input) { IMergeViewerContentProvider content= getMergeContentProvider(); if (content != null) { Object ancestor= content.getAncestorContent(input); boolean oldFlag = fIsThreeWay; if (Utilities.isHunk(input)) { fIsThreeWay = true; } else if (input instanceof ICompareInput) { fIsThreeWay= (((ICompareInput) input).getKind() & Differencer.DIRECTION_MASK) != 0; } else { fIsThreeWay= ancestor != null; } if (fAncestorItem != null) fAncestorItem.setVisible(fIsThreeWay); if (fAncestorVisible && oldFlag != fIsThreeWay) fComposite.layout(true); Object left= content.getLeftContent(input); Object right= content.getRightContent(input); updateContent(ancestor, left, right); updateHeader(); if (Utilities.okToUse(fComposite) && Utilities.okToUse(fComposite.getParent())) { ToolBarManager tbm = (ToolBarManager) getToolBarManager(fComposite.getParent()); if (tbm != null ) { updateToolItems(); tbm.update(true); tbm.getControl().getParent().layout(true); } } } }