public class SortElementsOperation extends JavaModelOperation
JavaModelOperation.IPostAction| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONTAINS_MALFORMED_NODES |
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 and Description |
|---|
SortElementsOperation(int level,
IJavaElement[] elements,
int[] positions,
java.util.Comparator comparator)
Constructor for SortElementsOperation.
|
| Modifier and Type | Method and Description |
|---|---|
TextEdit |
calculateEdit(CompilationUnit unit,
TextEditGroup group)
Calculates the required text edits to sort the
unit |
protected void |
executeOperation()
Performs the operation specific behavior.
|
protected int |
getMainAmountOfWork()
Returns the amount of work for the main task of this operation for
progress reporting.
|
static void |
insert(TextEdit parent,
TextEdit edit) |
protected boolean |
isMalformed(ASTNode node) |
IJavaModelStatus |
verify()
Possible failures:
NO_ELEMENTS_TO_PROCESS - the compilation unit supplied to the operation is
null. |
addAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, checkCanceled, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, 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, workedpublic static final java.lang.String CONTAINS_MALFORMED_NODES
public SortElementsOperation(int level,
IJavaElement[] elements,
int[] positions,
java.util.Comparator comparator)
level - the AST API level; one of the AST LEVEL constantselements - positions - comparator - protected int getMainAmountOfWork()
protected boolean isMalformed(ASTNode node)
protected void executeOperation()
throws JavaModelException
JavaModelOperationexecuteOperation in class JavaModelOperationJavaModelExceptionJavaModelOperation.executeOperation()public TextEdit calculateEdit(CompilationUnit unit, TextEditGroup group) throws JavaModelException
unitgroup - JavaModelExceptionpublic IJavaModelStatus verify()
nullverify in class JavaModelOperationIJavaModelStatuspublic static void insert(TextEdit parent,
TextEdit edit)