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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.core;
14 * Common protocol for Java elements that support source code manipulations such
15 * as copy, move, rename, and delete.
17 * This interface is not intended to be implemented by clients.
20 public interface ISourceManipulation {
22 * Copies this element to the given container.
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
31 * the new name for the element, or <code>null</code> if the
32 * copy retains the name of this element
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
40 * @exception JavaModelException
41 * if this element could not be copied. Reasons include:
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
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
59 * @exception IllegalArgumentException
60 * if container is <code>null</code>
62 // void copy(IJavaElement container, IJavaElement sibling, String rename,
63 // boolean replace, IProgressMonitor monitor) throws JavaModelException;
65 * Deletes this element, forcing if specified and necessary.
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).
73 * @exception JavaModelException
74 * if this element could not be deleted. Reasons include:
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>
83 // void delete(boolean force, IProgressMonitor monitor) throws
84 // JavaModelException;
86 * Moves this element to the given container.
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
95 * the new name for the element, or <code>null</code> if the
96 * element retains its name
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
104 * @exception JavaModelException
105 * if this element could not be moved. Reasons include:
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
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
123 * @exception IllegalArgumentException
124 * if container is <code>null</code>
126 // void move(IJavaElement container, IJavaElement sibling, String rename,
127 // boolean replace, IProgressMonitor monitor) throws JavaModelException;
129 * Renames this element to the given name.
132 * the new name for the element
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
139 * @exception JavaModelException
140 * if this element could not be renamed. Reasons include:
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)
153 // void rename(String name, boolean replace, IProgressMonitor monitor)
154 // throws JavaModelException;