Class DeleteElementsOperation
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
org.aspectj.org.eclipse.jdt.internal.core.MultiOperation
org.aspectj.org.eclipse.jdt.internal.core.DeleteElementsOperation
- All Implemented Interfaces:
org.eclipse.core.resources.IWorkspaceRunnable,org.eclipse.core.runtime.ICoreRunnable,org.eclipse.core.runtime.IProgressMonitor
This operation deletes a collection of elements (and
all of their children).
If an element does not exist, it is ignored.
NOTE: This operation only deletes elements contained within leaf resources - that is, elements within compilation units. To delete a compilation unit or a package, etc (which have an actual resource), a DeleteResourcesOperation should be used.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
JavaModelOperation.IPostAction -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MapThe elements this operation processes grouped by compilation unitprotected ASTParserTheASTParserused to manipulate the source code ofICompilationUnit.Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.MultiOperation
insertBeforeElements, newParents, renamings, renamingsListFields inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
actions, actionsEnd, actionsStart, APPEND, attributes, elementsToProcess, force, HAS_MODIFIED_RESOURCE_ATTR, isNested, KEEP_EXISTING, NO_ELEMENTS, OPERATION_STACKS, parentElements, POST_ACTION_VERBOSE, progressMonitor, REMOVEALL_APPEND, resultElements, TRUEFields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionDeleteElementsOperation(IJavaElement[] elementsToDelete, boolean force) When executed, this operation will delete the given elements. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the name to be used by the progress monitor.protected org.eclipse.core.runtime.jobs.ISchedulingRuleprotected voidGroups the elements to be processed by their compilation unit.protected voidprocessElement(IJavaElement element) Deletes this element from its compilation unit.protected voidProcesses all theIJavaElements in turn, collecting errors and updating the progress monitor.protected voidverify(IJavaElement element) This method is called for eachIJavaElementbeforeprocessElement.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.MultiOperation
error, executeOperation, getDestinationParent, getNewNameFor, isMove, isRename, setInsertBefore, setRenamings, verifyDestination, verifyRenaming, verifySiblingMethods inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
addAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, checkCanceled, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, getLatestASTLevel, getNestedFolders, getParentElement, getParentElements, getResultElements, getSubProgressMonitor, hasModifiedResource, internalWorked, isCanceled, isReadOnly, isTopLevelOperation, moveResources, newJavaElementDelta, popOperation, postAction, prefixesOneOf, pushOperation, removeAllPostAction, removeReconcileDelta, run, runOperation, runPostActions, setAttribute, setCanceled, setNested, setTaskName, subTask, verify, workedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IProgressMonitor
clearBlocked, setBlocked, slice
-
Field Details
-
childrenToRemove
The elements this operation processes grouped by compilation unit- See Also:
-
parser
TheASTParserused to manipulate the source code ofICompilationUnit.
-
-
Constructor Details
-
DeleteElementsOperation
When executed, this operation will delete the given elements. The elements to delete cannot benullor empty, and must be contained within a compilation unit.
-
-
Method Details
-
getMainTaskName
Description copied from class:MultiOperationReturns the name to be used by the progress monitor.- Specified by:
getMainTaskNamein classMultiOperation- See Also:
-
getSchedulingRule
protected org.eclipse.core.runtime.jobs.ISchedulingRule getSchedulingRule()- Overrides:
getSchedulingRulein classJavaModelOperation
-
groupElements
Groups the elements to be processed by their compilation unit. If parent/child combinations are present, children are discarded (only the parents are processed). Removes any duplicates specified in elements to be processed.- Throws:
JavaModelException
-
processElement
Deletes this element from its compilation unit.- Specified by:
processElementin classMultiOperation- Throws:
JavaModelException- See Also:
-
processElements
Description copied from class:MultiOperationProcesses all theIJavaElements in turn, collecting errors and updating the progress monitor.- Overrides:
processElementsin classMultiOperation- Throws:
JavaModelException- if one or several operation(s) was unable to be completed.- See Also:
-
verify
Description copied from class:MultiOperationThis method is called for eachIJavaElementbeforeprocessElement. It should check that thiselementcan be processed.- Specified by:
verifyin classMultiOperation- Throws:
JavaModelException- See Also:
-