Package org.eclipse.cdt.core.model
Interface ISourceManipulation
- All Known Subinterfaces:
IAsmLabel,IBinaryFunction,IBinaryVariable,IDeclaration,IEnumeration,IEnumerator,IField,IFunction,IFunctionDeclaration,IFunctionTemplate,IFunctionTemplateDeclaration,IInclude,IMacro,IMember,IMethod,IMethodDeclaration,IMethodTemplate,IMethodTemplateDeclaration,INamespace,IPragma,IStructure,IStructureDeclaration,IStructureTemplate,IStructureTemplateDeclaration,ITranslationUnit,ITypeDef,IUsing,IVariable,IVariableDeclaration,IWorkingCopy
public interface ISourceManipulation
Common protocol for C elements that support source code manipulations such
as copy, move, rename, and delete.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(ICElement container, ICElement sibling, String rename, boolean replace, org.eclipse.core.runtime.IProgressMonitor monitor) Copies this element to the given container.voiddelete(boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) Deletes this element, forcing if specified and necessary.voidmove(ICElement container, ICElement sibling, String rename, boolean replace, org.eclipse.core.runtime.IProgressMonitor monitor) Moves this element to the given container.voidRenames this element to the given name.
-
Method Details
-
copy
void copy(ICElement container, ICElement sibling, String rename, boolean replace, org.eclipse.core.runtime.IProgressMonitor monitor) throws CModelException Copies this element to the given container.- Parameters:
container- the containersibling- the sibling element before which the copy should be inserted, ornullif the copy should be inserted as the last child of the containerrename- the new name for the element, ornullif the copy retains the name of this elementreplace-trueif any existing child in the container with the target name should be replaced, andfalseto throw an exception in the event of a name collisionmonitor- a progress monitor- Throws:
CModelException- if this element could not be copied. Reasons include:- This C element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while updating an underlying resource - The container is of an incompatible type (INVALID_DESTINATION)
- The sibling is not a child of the given container (INVALID_SIBLING)
- The new name is invalid (INVALID_NAME)
- A child in the container already exists with the same name (NAME_COLLISION)
and
replacehas been specified asfalse - The container or this element is read-only (READ_ONLY)
IllegalArgumentException- if container isnull
-
delete
void delete(boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws CModelException Deletes this element, forcing if specified and necessary.- Parameters:
force- a flag controlling whether underlying resources that are not in sync with the local file system will be tolerated (same as the force flag in IResource operations).monitor- a progress monitor- Throws:
CModelException- if this element could not be deleted. Reasons include:- This C element does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while updating an underlying resource (CORE_EXCEPTION) - This element is read-only (READ_ONLY)
-
move
void move(ICElement container, ICElement sibling, String rename, boolean replace, org.eclipse.core.runtime.IProgressMonitor monitor) throws CModelException Moves this element to the given container.- Parameters:
container- the containersibling- the sibling element before which the element should be inserted, ornullif the element should be inserted as the last child of the containerrename- the new name for the element, ornullif the element retains its namereplace-trueif any existing child in the container with the target name should be replaced, andfalseto throw an exception in the event of a name collisionmonitor- a progress monitor- Throws:
CModelException- if this element could not be moved. Reasons include:- This C element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while updating an underlying resource - The container is of an incompatible type (INVALID_DESTINATION)
- The sibling is not a child of the given container (INVALID_SIBLING)
- The new name is invalid (INVALID_NAME)
- A child in the container already exists with the same name (NAME_COLLISION)
and
replacehas been specified asfalse - The container or this element is read-only (READ_ONLY)
IllegalArgumentException- if container isnull
-
rename
void rename(String name, boolean replace, org.eclipse.core.runtime.IProgressMonitor monitor) throws CModelException Renames this element to the given name.- Parameters:
name- the new name for the elementreplace-trueif any existing element with the target name should be replaced, andfalseto throw an exception in the event of a name collisionmonitor- a progress monitor- Throws:
CModelException- if this element could not be renamed. Reasons include:- This C element does not exist (ELEMENT_DOES_NOT_EXIST)
- A
CoreExceptionoccurred while updating an underlying resource - The new name is invalid (INVALID_NAME)
- A child in the container already exists with the same name (NAME_COLLISION)
and
replacehas been specified asfalse - This element is read-only (READ_ONLY)
-