|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
org.aspectj.org.eclipse.jdt.internal.core.MultiOperation
public abstract class MultiOperation
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 JavaElementDeltas.
If several errors occured, they are collected in a multi-status
JavaModelStatus. Otherwise, a simple JavaModelStatus
is thrown.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation |
|---|
JavaModelOperation.IPostAction |
| Field Summary | |
|---|---|
protected java.util.Map |
insertBeforeElements
Table specifying insertion positions for elements being copied/moved/renamed. |
protected java.util.Map |
newParents
Table specifying the new parent for elements being copied/moved/renamed. |
protected java.util.Map |
renamings
This table presents the data in fRenamingList in a more
convenient way. |
protected java.lang.String[] |
renamingsList
The list of renamings supplied to the operation |
| Fields 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, TRUE |
| Constructor Summary | |
|---|---|
protected |
MultiOperation(IJavaElement[] elementsToProcess,
boolean force)
Creates a new MultiOperation on elementsToProcess. |
protected |
MultiOperation(IJavaElement[] elementsToProcess,
IJavaElement[] parentElements,
boolean force)
Creates a new MultiOperation. |
| Method Summary | |
|---|---|
protected void |
error(int code,
IJavaElement element)
Convenience method to create a JavaModelException
embending a JavaModelStatus. |
protected void |
executeOperation()
Executes the operation. |
protected IJavaElement |
getDestinationParent(IJavaElement child)
Returns the parent of the element being copied/moved/renamed. |
protected abstract java.lang.String |
getMainTaskName()
Returns the name to be used by the progress monitor. |
protected java.lang.String |
getNewNameFor(IJavaElement element)
Returns the new name for element, or null
if there are no renamings specified. |
protected boolean |
isMove()
Returns true 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()
Returns true 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 given IJavaElement. |
protected void |
processElements()
Processes all the IJavaElements 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(java.lang.String[] renamingsList)
Sets the new names to use for each element being copied. |
protected abstract void |
verify(IJavaElement element)
This method is called for each IJavaElement before
processElement. |
protected void |
verifyDestination(IJavaElement element,
IJavaElement destination)
Verifies that the destination specified for the element is valid for the types of the
element and destination. |
protected void |
verifyRenaming(IJavaElement element)
Verify that the new name specified for element is
valid for that type of Java element. |
protected void |
verifySibling(IJavaElement element,
IJavaElement destination)
Verifies that the positioning sibling specified for the element is exists and
its parent is the destination container of this element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map insertBeforeElements
processElements()protected java.util.Map newParents
protected java.util.Map renamings
fRenamingList in a more
convenient way.
protected java.lang.String[] renamingsList
| Constructor Detail |
|---|
protected MultiOperation(IJavaElement[] elementsToProcess,
boolean force)
MultiOperation on elementsToProcess.
protected MultiOperation(IJavaElement[] elementsToProcess,
IJavaElement[] parentElements,
boolean force)
MultiOperation.
| Method Detail |
|---|
protected void error(int code,
IJavaElement element)
throws JavaModelException
JavaModelException
embending a JavaModelStatus.
JavaModelException
protected void executeOperation()
throws JavaModelException
executeOperation in class JavaModelOperationJavaModelException - if one or several errors occured during the operation.
If multiple errors occured, the corresponding JavaModelStatus is a
multi-status. Otherwise, it is a simple one.protected IJavaElement getDestinationParent(IJavaElement child)
protected abstract java.lang.String getMainTaskName()
protected java.lang.String getNewNameFor(IJavaElement element)
throws JavaModelException
element, or null
if there are no renamings specified.
JavaModelExceptionprotected boolean isMove()
true if this operation represents a move or rename, false
if this operation represents a copy.
protected boolean isRename()
true if this operation represents a rename, false
if this operation represents a copy or move.
protected abstract void processElement(IJavaElement element)
throws JavaModelException
IJavaElement.
JavaModelException
protected void processElements()
throws JavaModelException
IJavaElements in turn, collecting errors
and updating the progress monitor.
JavaModelException - if one or several operation(s) was unable to
be completed.
public void setInsertBefore(IJavaElement modifiedElement,
IJavaElement newSibling)
null, which indicates that the element is to be
inserted at the end of the container.
public void setRenamings(java.lang.String[] renamingsList)
null 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.
protected abstract void verify(IJavaElement element)
throws JavaModelException
IJavaElement before
processElement. It should check that this element
can be processed.
JavaModelException
protected void verifyDestination(IJavaElement element,
IJavaElement destination)
throws JavaModelException
destination specified for the element is valid for the types of the
element and destination.
JavaModelException
protected void verifyRenaming(IJavaElement element)
throws JavaModelException
element is
valid for that type of Java element.
JavaModelException
protected void verifySibling(IJavaElement element,
IJavaElement destination)
throws JavaModelException
element is exists and
its parent is the destination container of this element.
JavaModelException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||