Klasse CopyElementsOperation
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.CopyElementsOperation
- Alle implementierten Schnittstellen:
SuffixConstants
,org.eclipse.core.resources.IWorkspaceRunnable
,org.eclipse.core.runtime.ICoreRunnable
,org.eclipse.core.runtime.IProgressMonitor
- Bekannte direkte Unterklassen:
MoveElementsOperation
This operation copies/moves a collection of elements from their current
container to a new container, optionally renaming the
elements.
Notes:
- If there is already an element with the same name in the new container, the operation either overwrites or aborts, depending on the collision policy setting. The default setting is abort.
- When constructors are copied to a type, the constructors are automatically renamed to the name of the destination type.
- When main types are renamed (move within the same parent), the compilation unit and constructors are automatically renamed
- The collection of elements being copied must all share the same type of container (for example, must all be type members).
- The elements are inserted in the new container in the order given.
- The elements can be positioned in the new container - see #setInsertBefore. By default, the elements are inserted based on the default positions as specified in the creation operation for that element type.
- This operation can be used to copy and rename elements within the same container.
- This operation only copies elements contained within compilation units.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
JavaModelOperation.IPostAction
-
Feldübersicht
Von Klasse geerbte Felder org.aspectj.org.eclipse.jdt.internal.core.MultiOperation
insertBeforeElements, newParents, renamings, renamingsList
Von Klasse geerbte Felder 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, TRUE
Von Schnittstelle geerbte Felder org.eclipse.core.runtime.IProgressMonitor
UNKNOWN
Von Schnittstelle geerbte Felder org.aspectj.org.eclipse.jdt.internal.compiler.util.SuffixConstants
EXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, EXTENSION_jmod, EXTENSION_JMOD, 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
-
Konstruktorübersicht
KonstruktorBeschreibungCopyElementsOperation
(IJavaElement[] elementsToCopy, IJavaElement[] destContainers, boolean force) When executed, this operation will copy the given elements to the given containers.CopyElementsOperation
(IJavaElement[] elementsToCopy, IJavaElement destContainer, boolean force) When executed, this operation will copy the given elements to the given container. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected String
Returns theString
to use as the main task name for progress monitoring.protected JavaModelOperation
getNestedOperation
(IJavaElement element) Returns the nested operation to use for processing this elementprotected boolean
isRenamingMainType
(IJavaElement element, IJavaElement dest) Returnstrue
if this element is the main type of its compilation unit.protected void
processElement
(IJavaElement element) Copy/move the element from the source to destination, renaming the elements as specified, honoring the collision policy.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 eachIJavaElement
beforeprocessElement
.Von Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.core.MultiOperation
error, executeOperation, getDestinationParent, getNewNameFor, isMove, isRename, processElements, setInsertBefore, setRenamings, verifyDestination, verifyRenaming, verifySibling
Von Klasse geerbte Methoden 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, getSchedulingRule, getSubProgressMonitor, hasModifiedResource, internalWorked, isCanceled, isReadOnly, isTopLevelOperation, moveResources, newJavaElementDelta, popOperation, postAction, prefixesOneOf, pushOperation, removeAllPostAction, removeReconcileDelta, run, runOperation, runPostActions, setAttribute, setCanceled, setNested, setTaskName, subTask, worked
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden org.eclipse.core.runtime.IProgressMonitor
clearBlocked, setBlocked, slice
-
Konstruktordetails
-
CopyElementsOperation
public CopyElementsOperation(IJavaElement[] elementsToCopy, IJavaElement[] destContainers, boolean force) When executed, this operation will copy the given elements to the given containers. The elements and destination containers must be in the correct order. If there is > 1 destination, the number of destinations must be the same as the number of elements being copied/moved/renamed. -
CopyElementsOperation
public CopyElementsOperation(IJavaElement[] elementsToCopy, IJavaElement destContainer, boolean force) When executed, this operation will copy the given elements to the given container.
-
-
Methodendetails
-
getMainTaskName
Returns theString
to use as the main task name for progress monitoring.- Angegeben von:
getMainTaskName
in KlasseMultiOperation
-
getNestedOperation
Returns the nested operation to use for processing this element -
isRenamingMainType
protected boolean isRenamingMainType(IJavaElement element, IJavaElement dest) throws JavaModelException Returnstrue
if this element is the main type of its compilation unit.- Löst aus:
JavaModelException
-
processElement
Copy/move the element from the source to destination, renaming the elements as specified, honoring the collision policy.- Angegeben von:
processElement
in KlasseMultiOperation
- Löst aus:
JavaModelException
- if the operation is unable to be completed
-
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.
- Setzt außer Kraft:
verify
in KlasseJavaModelOperation
- Siehe auch:
-
verify
Beschreibung aus Klasse kopiert:MultiOperation
This method is called for eachIJavaElement
beforeprocessElement
. It should check that thiselement
can be processed.- Angegeben von:
verify
in KlasseMultiOperation
- Löst aus:
JavaModelException
- Siehe auch:
-