public class CreateInitializerOperation extends CreateTypeMemberOperation
This operation creates a initializer in a type.
Required Attributes:
JavaModelOperation.IPostAction| Modifier and Type | Field and Description |
|---|---|
protected int |
numberOfInitializers
The current number of initializers in the parent type.
|
alteredName, createdNode, sourceanchorElement, creationOccurred, cuAST, INSERT_AFTER, INSERT_BEFORE, INSERT_LAST, insertionPolicyactions, 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 |
|---|
CreateInitializerOperation(IType parentElement,
java.lang.String source)
When executed, this operation will create an initializer with the given name
in the given type with the specified source.
|
| Modifier and Type | Method and Description |
|---|---|
protected ASTNode |
generateElementAST(ASTRewrite rewriter,
ICompilationUnit cu) |
protected IJavaElement |
generateResultHandle()
Creates and returns the handle for the element this operation created.
|
java.lang.String |
getMainTaskName()
Returns the name of the main task of this operation for
progress reporting.
|
protected void |
initializeDefaultPosition()
By default the new initializer is positioned after the last existing initializer
declaration, or as the first member in the type if there are no
initializers.
|
protected SimpleName |
rename(ASTNode node,
SimpleName newName) |
generateSyntaxIncorrectAST, getChildPropertyDescriptor, getType, setAlteredName, verify, verifyNameCollisioncheckCanceled, createAfter, createBefore, executeOperation, generateNewCompilationUnitAST, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getSchedulingRule, insertASTNode, parse, setRelativePositionaddAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, getNestedFolders, getParentElement, getParentElements, getResultElements, getSubProgressMonitor, hasModifiedResource, internalWorked, isCanceled, isReadOnly, isTopLevelOperation, moveResources, newJavaElementDelta, popOperation, postAction, prefixesOneOf, pushOperation, removeAllPostAction, removeReconcileDelta, run, runOperation, runPostActions, setAttribute, setCanceled, setNested, setTaskName, subTask, workedprotected int numberOfInitializers
public CreateInitializerOperation(IType parentElement, java.lang.String source)
By default the new initializer is positioned after the last existing initializer declaration, or as the first member in the type if there are no initializers.
protected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException
generateElementAST in class CreateTypeMemberOperationJavaModelExceptionprotected IJavaElement generateResultHandle()
CreateElementInCUOperationgenerateResultHandle in class CreateElementInCUOperationCreateElementInCUOperation.generateResultHandle()public java.lang.String getMainTaskName()
CreateElementInCUOperationgetMainTaskName in class CreateElementInCUOperationCreateElementInCUOperation.getMainTaskName()protected SimpleName rename(ASTNode node, SimpleName newName)
rename in class CreateTypeMemberOperationprotected void initializeDefaultPosition()
initializeDefaultPosition in class CreateElementInCUOperation