Klasse MultiOperation
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
org.aspectj.org.eclipse.jdt.internal.core.MultiOperation
- Alle implementierten Schnittstellen:
org.eclipse.core.resources.IWorkspaceRunnable
,org.eclipse.core.runtime.ICoreRunnable
,org.eclipse.core.runtime.IProgressMonitor
- Bekannte direkte Unterklassen:
CopyElementsOperation
,CopyResourceElementsOperation
,DeleteElementsOperation
,DeleteResourceElementsOperation
This class is used to perform operations on multiple
IJavaElement
.
It is responible for running each operation in turn, collecting
the errors and merging the corresponding JavaElementDelta
s.
If several errors occured, they are collected in a multi-status
JavaModelStatus
. Otherwise, a simple JavaModelStatus
is thrown.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
JavaModelOperation.IPostAction
-
Feldübersicht
Modifizierer und TypFeldBeschreibungprotected Map
Table specifying insertion positions for elements being copied/moved/renamed.protected Map
Table specifying the new parent for elements being copied/moved/renamed.protected Map
This table presents the data infRenamingList
in a more convenient way.protected String[]
The list of renamings supplied to the operationVon 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
-
Konstruktorübersicht
ModifiziererKonstruktorBeschreibungprotected
MultiOperation
(IJavaElement[] elementsToProcess, boolean force) Creates a newMultiOperation
onelementsToProcess
.protected
MultiOperation
(IJavaElement[] elementsToProcess, IJavaElement[] parentElements, boolean force) Creates a newMultiOperation
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
error
(int code, IJavaElement element) Convenience method to create aJavaModelException
embending aJavaModelStatus
.protected void
Executes the operation.protected IJavaElement
getDestinationParent
(IJavaElement child) Returns the parent of the element being copied/moved/renamed.protected abstract String
Returns the name to be used by the progress monitor.protected String
getNewNameFor
(IJavaElement element) Returns the new name forelement
, ornull
if there are no renamings specified.protected boolean
isMove()
Returnstrue
if this operation represents a move or rename,false
if this operation represents a copy.
Note: a rename is just a move within the same parent with a name change.protected boolean
isRename()
Returnstrue
if this operation represents a rename,false
if this operation represents a copy or move.protected abstract void
processElement
(IJavaElement element) Subclasses must implement this method to process a givenIJavaElement
.protected void
Processes all theIJavaElement
s in turn, collecting errors and updating the progress monitor.void
setInsertBefore
(IJavaElement modifiedElement, IJavaElement newSibling) Sets the insertion position in the new container for the modified element.void
setRenamings
(String[] renamingsList) Sets the new names to use for each element being copied.protected abstract void
verify
(IJavaElement element) This method is called for eachIJavaElement
beforeprocessElement
.protected void
verifyDestination
(IJavaElement element, IJavaElement destination) Verifies that thedestination
specified for theelement
is valid for the types of theelement
anddestination
.protected void
verifyRenaming
(IJavaElement element) Verify that the new name specified forelement
is valid for that type of Java element.protected void
verifySibling
(IJavaElement element, IJavaElement destination) Verifies that the positioning sibling specified for theelement
is exists and its parent is the destination container of thiselement
.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, verify, 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
-
Felddetails
-
insertBeforeElements
Table specifying insertion positions for elements being copied/moved/renamed. Keyed by elements being processed, and values are the corresponding insertion point.- Siehe auch:
-
newParents
Table specifying the new parent for elements being copied/moved/renamed. Keyed by elements being processed, and values are the corresponding destination parent. -
renamings
This table presents the data infRenamingList
in a more convenient way. -
renamingsList
The list of renamings supplied to the operation
-
-
Konstruktordetails
-
MultiOperation
Creates a newMultiOperation
onelementsToProcess
. -
MultiOperation
protected MultiOperation(IJavaElement[] elementsToProcess, IJavaElement[] parentElements, boolean force) Creates a newMultiOperation
.
-
-
Methodendetails
-
error
Convenience method to create aJavaModelException
embending aJavaModelStatus
.- Löst aus:
JavaModelException
-
executeOperation
Executes the operation.- Angegeben von:
executeOperation
in KlasseJavaModelOperation
- Löst aus:
JavaModelException
- if one or several errors occured during the operation. If multiple errors occured, the correspondingJavaModelStatus
is a multi-status. Otherwise, it is a simple one.
-
getDestinationParent
Returns the parent of the element being copied/moved/renamed. -
getMainTaskName
Returns the name to be used by the progress monitor. -
getNewNameFor
Returns the new name forelement
, ornull
if there are no renamings specified.- Löst aus:
JavaModelException
-
isMove
protected boolean isMove()Returnstrue
if this operation represents a move or rename,false
if this operation represents a copy.
Note: a rename is just a move within the same parent with a name change. -
isRename
protected boolean isRename()Returnstrue
if this operation represents a rename,false
if this operation represents a copy or move. -
processElement
Subclasses must implement this method to process a givenIJavaElement
.- Löst aus:
JavaModelException
-
processElements
Processes all theIJavaElement
s in turn, collecting errors and updating the progress monitor.- Löst aus:
JavaModelException
- if one or several operation(s) was unable to be completed.
-
setInsertBefore
Sets the insertion position in the new container for the modified element. The element being modified will be inserted before the specified new sibling. The given sibling must be a child of the destination container specified for the modified element. The default isnull
, which indicates that the element is to be inserted at the end of the container. -
setRenamings
Sets the new names to use for each element being copied. The renamings correspond to the elements being processed, and the number of renamings must match the number of elements being processed. Anull
entry in the list indicates that an element is not to be renamed.Note that some renamings may not be used. If both a parent and a child have been selected for copy/move, only the parent is changed. Therefore, if a new name is specified for the child, the child's name will not be changed.
-
verify
This method is called for eachIJavaElement
beforeprocessElement
. It should check that thiselement
can be processed.- Löst aus:
JavaModelException
-
verifyDestination
protected void verifyDestination(IJavaElement element, IJavaElement destination) throws JavaModelException Verifies that thedestination
specified for theelement
is valid for the types of theelement
anddestination
.- Löst aus:
JavaModelException
-
verifyRenaming
Verify that the new name specified forelement
is valid for that type of Java element.- Löst aus:
JavaModelException
-
verifySibling
protected void verifySibling(IJavaElement element, IJavaElement destination) throws JavaModelException Verifies that the positioning sibling specified for theelement
is exists and its parent is the destination container of thiselement
.- Löst aus:
JavaModelException
-