KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > localstore > IsSynchronizedVisitor


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.internal.localstore;
12
13 import org.eclipse.core.internal.resources.Resource;
14 import org.eclipse.core.runtime.IProgressMonitor;
15
16 /**
17  * Visits a unified tree, and throws a ResourceChangedException on the first
18  * node that is discovered to be out of sync. The exception that is thrown
19  * will not have any meaningful status, message, or stack trace. Nodes
20  * discovered to be out of sync are not brought to be in sync with the workspace.
21  */

22 public class IsSynchronizedVisitor extends CollectSyncStatusVisitor {
23     static class ResourceChangedException extends RuntimeException JavaDoc {
24         private static final long serialVersionUID = 1L;
25     }
26
27     protected static ResourceChangedException exception = new ResourceChangedException();
28
29     /**
30      * Creates a new IsSynchronizedVisitor.
31      */

32     public IsSynchronizedVisitor(IProgressMonitor monitor) {
33         super("", monitor); //$NON-NLS-1$
34
}
35
36     /**
37      * @see CollectSyncStatusVisitor#changed(Resource)
38      */

39     protected void changed(Resource target) {
40         throw exception;
41     }
42 }
43
Popular Tags