/** * 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); }
/** * Called to copy one side of the given node to the other. * This default implementation delegates the call to {@code ICompareInput.copy(...)}. * Clients may override. * * @param node the node to copy * @param leftToRight if {@code true} the left side is copied to the right side. * If {@code false} 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 saveRightContent(Object element, byte[] bytes) { if (element instanceof ICompareInput) { ICompareInput node= (ICompareInput) element; if (bytes != null) { ITypedElement right= node.getRight(); // #9869: problem if right is null (because no resource exists yet) nothing is done! if (right == null) { node.copy(true); right= node.getRight(); } if (right instanceof IEditableContent) ((IEditableContent)right).setContent(bytes); if (node instanceof ResourceCompareInput.MyDiffNode) ((ResourceCompareInput.MyDiffNode)node).fireChange(); } else { node.copy(true); } } } }
@Override public void saveRightContent(Object element, byte[] bytes) { if (element instanceof ICompareInput) { ICompareInput node= (ICompareInput) element; if (bytes != null) { ITypedElement right= node.getRight(); // #9869: problem if right is null (because no resource exists yet) nothing is done! if (right == null) { node.copy(true); right= node.getRight(); } if (right instanceof IEditableContent) ((IEditableContent)right).setContent(bytes); if (node instanceof ResourceCompareInput.MyDiffNode) ((ResourceCompareInput.MyDiffNode)node).fireChange(); } else { node.copy(true); } } } }
public void saveLeftContent(Object element, byte[] bytes) { if (element instanceof ICompareInput) { ICompareInput node= (ICompareInput) element; if (bytes != null) { ITypedElement left= node.getLeft(); // #9869: problem if left is null (because no resource exists yet) nothing is done! if (left == null) { node.copy(false); left= node.getLeft(); } if (left instanceof IEditableContent) ((IEditableContent)left).setContent(bytes); if (node instanceof ResourceCompareInput.MyDiffNode) ((ResourceCompareInput.MyDiffNode)node).fireChange(); } else { node.copy(false); } } }
@Override public void saveLeftContent(Object element, byte[] bytes) { if (element instanceof ICompareInput) { ICompareInput node= (ICompareInput) element; if (bytes != null) { ITypedElement left= node.getLeft(); // #9869: problem if left is null (because no resource exists yet) nothing is done! if (left == null) { node.copy(false); left= node.getLeft(); } if (left instanceof IEditableContent) ((IEditableContent)left).setContent(bytes); if (node instanceof ResourceCompareInput.MyDiffNode) ((ResourceCompareInput.MyDiffNode)node).fireChange(); } else { node.copy(false); } } }