1 /*******************************************************************************2 * Copyright (c) 2000, 2006 IBM Corporation and others.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 *8 * Contributors:9 * IBM Corporation - initial API and implementation10 *******************************************************************************/11 package org.eclipse.team.core.diff;12 13 14 /**15 * An objects that visits diffs in a diff tree.16 * <p> 17 * Usage:18 * <pre>19 * class Visitor implements IDiffVisitor {20 * public boolean visit(IDiffNode diff) {21 * switch (diff.getKind()) {22 * case IResourceDelta.ADDED :23 * // handle added resource24 * break;25 * case IResourceDelta.REMOVED :26 * // handle removed resource27 * break;28 * case IResourceDelta.CHANGED :29 * // handle changed resource30 * break;31 * }32 * return true;33 * }34 * }35 * IDiffTree tree = ...;36 * tree.accept(new Visitor());37 * </pre>38 * </p>39 * <p>40 * Clients may implement this interface.41 * </p>42 * @see IDiffTree#accept(org.eclipse.core.runtime.IPath, IDiffVisitor, int)43 * 44 * @since 3.245 */46 public interface IDiffVisitor {47 48 /** 49 * Visits the given diff.50 * @param diff the diff being visited51 * @return <code>true</code> if the diff's children should52 * be visited; <code>false</code> if they should be skipped.53 */54 public boolean visit(IDiff diff);55 }56