@Override protected void handleDispose(DisposeEvent event) { Object input = getInput(); if (input instanceof ICompareInput) { ICompareInput ci = (ICompareInput) input; ci.removeCompareInputChangeListener(fCompareInputChangeListener); } compareInputChanged(null); fContentChangedListener= null; super.handleDispose(event); }
private IDisposable getDisposable(Object object) { if (object instanceof IDisposable) { return (IDisposable) object; } if (object instanceof DocumentRangeNode) { DocumentRangeNode node = (DocumentRangeNode) object; return getDisposable(node.getParentNode()); } return null; }
@Override public int category(Object node) { if (node instanceof DiffNode) { Object o= ((DiffNode) node).getId(); if (o instanceof DocumentRangeNode) return ((DocumentRangeNode) o).getTypeCode(); } return 0; }
@Override protected void inputChanged(Object input, Object oldInput) { if (oldInput instanceof ICompareInput) { ICompareInput old = (ICompareInput) oldInput; old.removeCompareInputChangeListener(fCompareInputChangeListener); } if (input instanceof ICompareInput) { ICompareInput ci = (ICompareInput) input; ci.addCompareInputChangeListener(fCompareInputChangeListener); compareInputChanged(ci); if (input != oldInput) initialSelection(); } }
public void removeToRoot(IDiffElement child) { if (fChildren != null) { fChildren.remove(child); child.setParent(null); if (fChildren.size() == 0) { IDiffContainer p= getParent(); if (p != null) p.removeToRoot(this); } } }
@Override public Object getLeftContent(Object element) { if (element instanceof ICompareInput) return ((ICompareInput) element).getLeft(); return null; }
/** * Overridden to call the <code>save</code> method on the structure creator after * nodes have been copied from one side to the other side of an input object. * * @param leftToRight if <code>true</code> the left side is copied to the right side. * If <code>false</code> the right side is copied to the left side */ protected void copySelected(boolean leftToRight) { super.copySelected(leftToRight); if (fStructureCreator != null) fStructureCreator.save( leftToRight ? fRightStructure.getStructureComparator() : fLeftStructure.getStructureComparator(), leftToRight ? fRightStructure.getInput() : fLeftStructure.getInput()); }
public void resetRoot() { IDiffElement[] children = root.getChildren(); for (int i = 0; i < children.length; i++) { IDiffElement child = children[i]; root.remove(child); } }
/** * Called to copy one side of the given node to the other. * This default implementation delegates the call to <code>ICompareInput.copy(...)</code>. * Clients may override. * @param node the node to copy * @param leftToRight if <code>true</code> the left side is copied to the right side. * If <code>false</code> the right side is copied to the left side */ protected void copyOne(ICompareInput node, boolean leftToRight) { node.copy(leftToRight); // update node's image update(new Object[] { node }, null); }
public void dispose() { inputChanged(DiffTreeViewer.this, getInput(), null); }
public ManifestNode(DocumentRangeNode parent, int type, String id, IDocument doc, int start, int length) { super(parent, type, id, doc, start, length); if (parent != null) { parent.addChild(ManifestNode.this); } }
@Override public IEditorInput getDocumentKey(Object element) { if (hasSameDocument(element)) { return super.getDocumentKey(input); } return super.getDocumentKey(element); } private boolean hasSameDocument(Object element) {
public IEditorInput getDocumentKey(Object element) { if (hasSameDocument(element)) { return super.getDocumentKey(input); } return super.getDocumentKey(element); } private boolean hasSameDocument(Object element) {
protected void handleDispose(DisposeEvent event) { Object input = getInput(); if (input instanceof ICompareInput) { ICompareInput ci = (ICompareInput) input; ci.removeCompareInputChangeListener(fCompareInputChangeListener); } compareInputChanged(null); fContentChangedListener= null; super.handleDispose(event); }
@Override public void removeToRoot(IDiffElement child) { if (fChildren != null) { fChildren.remove(child); child.setParent(null); if (fChildren.isEmpty()) { IDiffContainer p= getParent(); if (p != null) p.removeToRoot(this); } } }
public int category(Object node) { if (node instanceof DiffNode) { Object o= ((DiffNode) node).getId(); if (o instanceof DocumentRangeNode) return ((DocumentRangeNode) o).getTypeCode(); } return 0; } }
private IDisposable getDisposable(Object object) { if (object instanceof IDisposable) { return (IDisposable) object; } if (object instanceof DocumentRangeNode) { DocumentRangeNode node = (DocumentRangeNode) object; return getDisposable(node.getParentNode()); } return null; } }