KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > resources > mapping > IResourceChangeDescriptionFactory


1 /*******************************************************************************
2  * Copyright (c) 2006 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.mapping;
12
13 import org.eclipse.core.resources.*;
14 import org.eclipse.core.runtime.IPath;
15 import org.eclipse.core.runtime.IProgressMonitor;
16
17 /**
18  * This factory is used to build a resource delta that represents a proposed change
19  * that can then be passed to the {@link ResourceChangeValidator#validateChange(IResourceDelta, IProgressMonitor)}
20  * method in order to validate the change with any model providers stored in those resources.
21  * The deltas created by calls to the methods of this interface will be the same as
22  * those generated by the workspace if the proposed operations were performed.
23  * <p>
24  * This factory does not validate that the proposed operation is valid given the current
25  * state of the resources and any other proposed changes. It only records the
26  * delta that would result.
27  * <p>
28  * This interface is not intended to be implemented by clients.
29  * </p>
30  *
31  * @see ResourceChangeValidator
32  * @see ModelProvider
33  * @since 3.2
34  */

35 public interface IResourceChangeDescriptionFactory {
36
37     /**
38      * Record a delta that represents a content change for the given file.
39      * @param file the file whose contents will be changed
40      */

41     public void change(IFile file);
42
43     /**
44      * Record the set of deltas representing the closed of a project.
45      * @param project the project that will be closed
46      */

47     public void close(IProject project);
48
49     /**
50      * Record the set of deltas representing a copy of the given resource to the
51      * given workspace path.
52      * @param resource the resource that will be copied
53      * @param destination the full workspace path of the destination the resource is being copied to
54      */

55     public void copy(IResource resource, IPath destination);
56
57     /**
58      * Record a delta that represents a resource being created.
59      * @param resource the resource that is created
60      */

61     public void create(IResource resource);
62
63     /**
64      * Record the set of deltas representing a deletion of the given resource.
65      * @param resource the resource that will be deleted
66      */

67     public void delete(IResource resource);
68
69     /**
70      * Return the proposed delta that has been accumulated by this factory.
71      * @return the proposed delta that has been accumulated by this factory
72      */

73     public IResourceDelta getDelta();
74
75     /**
76      * Record the set of deltas representing a move of the given resource to the
77      * given workspace path. Note that this API is used to describe a resource
78      * being moved to another path in the workspace, rather than a move in the
79      * file system.
80      * @param resource the resource that will be moved
81      * @param destination the full workspace path of the destination the resource is being moved to
82      */

83     public void move(IResource resource, IPath destination);
84
85 }
86
Popular Tags