A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / ISourceManipulation.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.core;
12
13 /**
14  * Common protocol for Java elements that support source code manipulations such
15  * as copy, move, rename, and delete.
16  * <p>
17  * This interface is not intended to be implemented by clients.
18  * </p>
19  */
20 public interface ISourceManipulation {
21         /**
22          * Copies this element to the given container.
23          * 
24          * @param container
25          *            the container
26          * @param sibling
27          *            the sibling element before which the copy should be inserted,
28          *            or <code>null</code> if the copy should be inserted as the
29          *            last child of the container
30          * @param rename
31          *            the new name for the element, or <code>null</code> if the
32          *            copy retains the name of this element
33          * @param replace
34          *            <code>true</code> if any existing child in the container
35          *            with the target name should be replaced, and
36          *            <code>false</code> to throw an exception in the event of a
37          *            name collision
38          * @param monitor
39          *            a progress monitor
40          * @exception JavaModelException
41          *                if this element could not be copied. Reasons include:
42          *                <ul>
43          *                <li> This Java element, container element, or sibling does
44          *                not exist (ELEMENT_DOES_NOT_EXIST)</li>
45          *                <li> A <code>CoreException</code> occurred while
46          *                updating an underlying resource
47          *                <li> The container is of an incompatible type
48          *                (INVALID_DESTINATION)
49          *                <li> The sibling is not a child of the given container
50          *                (INVALID_SIBLING)
51          *                <li> The new name is invalid (INVALID_NAME)
52          *                <li> A child in the container already exists with the same
53          *                name (NAME_COLLISION) and <code>replace</code> has been
54          *                specified as <code>false</code>
55          *                <li> The container or this element is read-only
56          *                (READ_ONLY)
57          *                </ul>
58          * 
59          * @exception IllegalArgumentException
60          *                if container is <code>null</code>
61          */
62         // void copy(IJavaElement container, IJavaElement sibling, String rename,
63         // boolean replace, IProgressMonitor monitor) throws JavaModelException;
64         /**
65          * Deletes this element, forcing if specified and necessary.
66          * 
67          * @param force
68          *            a flag controlling whether underlying resources that are not
69          *            in sync with the local file system will be tolerated (same as
70          *            the force flag in IResource operations).
71          * @param monitor
72          *            a progress monitor
73          * @exception JavaModelException
74          *                if this element could not be deleted. Reasons include:
75          *                <ul>
76          *                <li> This Java element does not exist
77          *                (ELEMENT_DOES_NOT_EXIST)</li>
78          *                <li> A <code>CoreException</code> occurred while
79          *                updating an underlying resource (CORE_EXCEPTION)</li>
80          *                <li> This element is read-only (READ_ONLY)</li>
81          *                </ul>
82          */
83         // void delete(boolean force, IProgressMonitor monitor) throws
84         // JavaModelException;
85         /**
86          * Moves this element to the given container.
87          * 
88          * @param container
89          *            the container
90          * @param sibling
91          *            the sibling element before which the element should be
92          *            inserted, or <code>null</code> if the element should be
93          *            inserted as the last child of the container
94          * @param rename
95          *            the new name for the element, or <code>null</code> if the
96          *            element retains its name
97          * @param replace
98          *            <code>true</code> if any existing child in the container
99          *            with the target name should be replaced, and
100          *            <code>false</code> to throw an exception in the event of a
101          *            name collision
102          * @param monitor
103          *            a progress monitor
104          * @exception JavaModelException
105          *                if this element could not be moved. Reasons include:
106          *                <ul>
107          *                <li> This Java element, container element, or sibling does
108          *                not exist (ELEMENT_DOES_NOT_EXIST)</li>
109          *                <li> A <code>CoreException</code> occurred while
110          *                updating an underlying resource
111          *                <li> The container is of an incompatible type
112          *                (INVALID_DESTINATION)
113          *                <li> The sibling is not a child of the given container
114          *                (INVALID_SIBLING)
115          *                <li> The new name is invalid (INVALID_NAME)
116          *                <li> A child in the container already exists with the same
117          *                name (NAME_COLLISION) and <code>replace</code> has been
118          *                specified as <code>false</code>
119          *                <li> The container or this element is read-only
120          *                (READ_ONLY)
121          *                </ul>
122          * 
123          * @exception IllegalArgumentException
124          *                if container is <code>null</code>
125          */
126         // void move(IJavaElement container, IJavaElement sibling, String rename,
127         // boolean replace, IProgressMonitor monitor) throws JavaModelException;
128         /**
129          * Renames this element to the given name.
130          * 
131          * @param name
132          *            the new name for the element
133          * @param replace
134          *            <code>true</code> if any existing element with the target
135          *            name should be replaced, and <code>false</code> to throw an
136          *            exception in the event of a name collision
137          * @param monitor
138          *            a progress monitor
139          * @exception JavaModelException
140          *                if this element could not be renamed. Reasons include:
141          *                <ul>
142          *                <li> This Java element does not exist
143          *                (ELEMENT_DOES_NOT_EXIST)</li>
144          *                <li> A <code>CoreException</code> occurred while
145          *                updating an underlying resource
146          *                <li> The new name is invalid (INVALID_NAME)
147          *                <li> A child in the container already exists with the same
148          *                name (NAME_COLLISION) and <code>replace</code> has been
149          *                specified as <code>false</code>
150          *                <li> This element is read-only (READ_ONLY)
151          *                </ul>
152          */
153         // void rename(String name, boolean replace, IProgressMonitor monitor)
154         // throws JavaModelException;
155 }