public class CopyResourceElementsOperation extends MultiOperation implements SuffixConstants
Notes:
JavaModelOperation.IPostAction| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList |
createdElements
The list of new resources created during this operation.
|
protected java.util.Map |
deltasPerProject
Table specifying deltas for elements being
copied/moved/renamed.
|
protected ASTParser |
parser
The
ASTParser used to manipulate the source code of
ICompilationUnit. |
insertBeforeElements, newParents, renamings, renamingsListactions, 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, TRUEEXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, SUFFIX_aj, SUFFIX_AJ, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_aj, SUFFIX_STRING_AJ, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVA| Constructor and Description |
|---|
CopyResourceElementsOperation(IJavaElement[] resourcesToCopy,
IJavaElement[] destContainers,
boolean force)
When executed, this operation will copy the given resources to the
given containers.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getMainTaskName()
Returns the name to be used by the progress monitor.
|
protected ISchedulingRule |
getSchedulingRule() |
protected void |
prepareDeltas(IJavaElement sourceElement,
IJavaElement destinationElement,
boolean isMove,
boolean overWriteCU)
Sets the deltas to register the changes resulting from this operation
for this source element and its destination.
|
protected void |
processDeltas()
Process all of the changed deltas generated by this operation.
|
protected void |
processElement(IJavaElement element)
Subclasses must implement this method to process a given
IJavaElement. |
protected void |
processElements()
Processes all the
IJavaElements in turn, collecting errors
and updating the progress monitor. |
protected IJavaModelStatus |
verify()
Possible failures:
NO_ELEMENTS_TO_PROCESS - no elements supplied to the operation
INDEX_OUT_OF_BOUNDS - the number of renamings supplied to the operation
does not match the number of elements that were supplied.
|
protected void |
verify(IJavaElement element)
This method is called for each
IJavaElement before
processElement. |
error, executeOperation, getDestinationParent, getNewNameFor, isMove, isRename, setInsertBefore, setRenamings, verifyDestination, verifyRenaming, verifySiblingaddAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, checkCanceled, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, 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, workedprotected java.util.ArrayList createdElements
protected java.util.Map deltasPerProject
protected ASTParser parser
ASTParser used to manipulate the source code of
ICompilationUnit.public CopyResourceElementsOperation(IJavaElement[] resourcesToCopy, IJavaElement[] destContainers, boolean force)
protected java.lang.String getMainTaskName()
MultiOperationgetMainTaskName in class MultiOperationMultiOperationprotected ISchedulingRule getSchedulingRule()
getSchedulingRule in class JavaModelOperationprotected void prepareDeltas(IJavaElement sourceElement, IJavaElement destinationElement, boolean isMove, boolean overWriteCU)
protected void processDeltas()
protected void processElement(IJavaElement element) throws JavaModelException
MultiOperationIJavaElement.processElement in class MultiOperationJavaModelExceptionThis method delegates to processCompilationUnitResource or
processPackageFragmentResource, depending on the type of
element.protected void processElements()
throws JavaModelException
MultiOperationIJavaElements in turn, collecting errors
and updating the progress monitor.processElements in class MultiOperationJavaModelException - if one or several operation(s) was unable to
be completed.Overridden to allow special processing of JavaElementDeltas
and fResultElements.protected IJavaModelStatus verify()
verify in class JavaModelOperationIJavaModelStatusprotected void verify(IJavaElement element) throws JavaModelException
MultiOperationIJavaElement before
processElement. It should check that this element
can be processed.verify in class MultiOperationJavaModelExceptionMultiOperation