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

public abstract class MultiOperation extends JavaModelOperation
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.

  • Felddetails

    • insertBeforeElements

      protected Map 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

      protected Map 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

      protected Map renamings
      This table presents the data in fRenamingList in a more convenient way.
    • renamingsList

      protected String[] renamingsList
      The list of renamings supplied to the operation
  • Konstruktordetails

    • MultiOperation

      protected MultiOperation(IJavaElement[] elementsToProcess, boolean force)
      Creates a new MultiOperation on elementsToProcess.
    • MultiOperation

      protected MultiOperation(IJavaElement[] elementsToProcess, IJavaElement[] parentElements, boolean force)
      Creates a new MultiOperation.
  • Methodendetails

    • error

      protected void error(int code, IJavaElement element) throws JavaModelException
      Convenience method to create a JavaModelException embending a JavaModelStatus.
      Löst aus:
      JavaModelException
    • executeOperation

      protected void executeOperation() throws JavaModelException
      Executes the operation.
      Angegeben von:
      executeOperation in Klasse JavaModelOperation
      Löst aus:
      JavaModelException - 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.
    • getDestinationParent

      protected IJavaElement getDestinationParent(IJavaElement child)
      Returns the parent of the element being copied/moved/renamed.
    • getMainTaskName

      protected abstract String getMainTaskName()
      Returns the name to be used by the progress monitor.
    • getNewNameFor

      protected String getNewNameFor(IJavaElement element) throws JavaModelException
      Returns the new name for element, or null if there are no renamings specified.
      Löst aus:
      JavaModelException
    • isMove

      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.
    • isRename

      protected boolean isRename()
      Returns true if this operation represents a rename, false if this operation represents a copy or move.
    • processElement

      protected abstract void processElement(IJavaElement element) throws JavaModelException
      Subclasses must implement this method to process a given IJavaElement.
      Löst aus:
      JavaModelException
    • processElements

      protected void processElements() throws JavaModelException
      Processes all the IJavaElements 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

      public void setInsertBefore(IJavaElement modifiedElement, IJavaElement newSibling)
      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 is null, which indicates that the element is to be inserted at the end of the container.
    • setRenamings

      public void setRenamings(String[] renamingsList)
      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. A 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.

    • verify

      protected abstract void verify(IJavaElement element) throws JavaModelException
      This method is called for each IJavaElement before processElement. It should check that this element can be processed.
      Löst aus:
      JavaModelException
    • verifyDestination

      protected void verifyDestination(IJavaElement element, IJavaElement destination) throws JavaModelException
      Verifies that the destination specified for the element is valid for the types of the element and destination.
      Löst aus:
      JavaModelException
    • verifyRenaming

      protected void verifyRenaming(IJavaElement element) throws JavaModelException
      Verify that the new name specified for element 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 the element is exists and its parent is the destination container of this element.
      Löst aus:
      JavaModelException