Klasse SortElementsOperation

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
org.aspectj.org.eclipse.jdt.internal.core.SortElementsOperation
Alle implementierten Schnittstellen:
org.eclipse.core.resources.IWorkspaceRunnable, org.eclipse.core.runtime.ICoreRunnable, org.eclipse.core.runtime.IProgressMonitor

public class SortElementsOperation extends JavaModelOperation
This operation is used to sort elements in a compilation unit according to certain criteria.
Seit:
2.1
  • Felddetails

  • Konstruktordetails

    • SortElementsOperation

      public SortElementsOperation(int level, IJavaElement[] elements, int[] positions, Comparator comparator)
      Constructor for SortElementsOperation.
      Parameter:
      level - the AST API level; one of the AST LEVEL constants
      elements -
      positions -
      comparator -
  • Methodendetails

    • getMainAmountOfWork

      protected int getMainAmountOfWork()
      Returns the amount of work for the main task of this operation for progress reporting.
    • isMalformed

      protected boolean isMalformed(ASTNode node)
    • executeOperation

      protected void executeOperation() throws JavaModelException
      Beschreibung aus Klasse kopiert: JavaModelOperation
      Performs the operation specific behavior. Subclasses must override.
      Angegeben von:
      executeOperation in Klasse JavaModelOperation
      Löst aus:
      JavaModelException
      Siehe auch:
    • calculateEdit

      public org.eclipse.text.edits.TextEdit calculateEdit(CompilationUnit unit, org.eclipse.text.edits.TextEditGroup group) throws JavaModelException
      Calculates the required text edits to sort the unit
      Parameter:
      group -
      Gibt zurück:
      the edit or null if no sorting is required
      Löst aus:
      JavaModelException
    • verify

      public IJavaModelStatus verify()
      Possible failures:
      • NO_ELEMENTS_TO_PROCESS - the compilation unit supplied to the operation is null
      • .
      • INVALID_ELEMENT_TYPES - the supplied elements are not an instance of IWorkingCopy
      • .
      Setzt außer Kraft:
      verify in Klasse JavaModelOperation
      Gibt zurück:
      IJavaModelStatus
      Siehe auch:
    • insert

      public static void insert(org.eclipse.text.edits.TextEdit parent, org.eclipse.text.edits.TextEdit edit)