KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > resources > IResourceDeltaVisitor


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.resources;
12
13 import org.eclipse.core.runtime.CoreException;
14
15 /**
16  * An objects that visits resource deltas.
17  * <p>
18  * Usage:
19  * <pre>
20  * class Visitor implements IResourceDeltaVisitor {
21  * public boolean visit(IResourceDelta delta) {
22  * switch (delta.getKind()) {
23  * case IResourceDelta.ADDED :
24  * // handle added resource
25  * break;
26  * case IResourceDelta.REMOVED :
27  * // handle removed resource
28  * break;
29  * case IResourceDelta.CHANGED :
30  * // handle changed resource
31  * break;
32  * }
33  * return true;
34  * }
35  * }
36  * IResourceDelta rootDelta = ...;
37  * rootDelta.accept(new Visitor());
38  * </pre>
39  * </p>
40  * <p>
41  * Clients may implement this interface.
42  * </p>
43  *
44  * @see IResource#accept(IResourceVisitor)
45  */

46 public interface IResourceDeltaVisitor {
47     /**
48      * Visits the given resource delta.
49      *
50      * @return <code>true</code> if the resource delta's children should
51      * be visited; <code>false</code> if they should be skipped.
52      * @exception CoreException if the visit fails for some reason.
53      */

54     public boolean visit(IResourceDelta delta) throws CoreException;
55 }
56
Popular Tags