public abstract class CreateTypeMemberOperation extends CreateElementInCUOperation
JavaModelOperation.IPostAction| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
alteredName
The name of the
ASTNode that may be used to
create this new element. |
protected ASTNode |
createdNode
The AST node representing the element that
this operation created.
|
protected java.lang.String |
source
The source code for the new member.
|
anchorElement, 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 |
|---|
CreateTypeMemberOperation(IJavaElement parentElement,
java.lang.String source,
boolean force)
When executed, this operation will create a type member
in the given parent element with the specified source.
|
| Modifier and Type | Method and Description |
|---|---|
protected ASTNode |
generateElementAST(ASTRewrite rewriter,
ICompilationUnit cu) |
protected java.lang.String |
generateSyntaxIncorrectAST()
Generates an
ASTNode based on the source of this operation
when there is likely a syntax error in the source. |
protected StructuralPropertyDescriptor |
getChildPropertyDescriptor(ASTNode parent) |
protected IType |
getType()
Returns the IType the member is to be created in.
|
protected abstract SimpleName |
rename(ASTNode node,
SimpleName newName) |
protected void |
setAlteredName(java.lang.String newName)
Sets the name of the
ASTNode that will be used to
create this new element. |
IJavaModelStatus |
verify()
Possible failures:
NO_ELEMENTS_TO_PROCESS - the parent element supplied to the operation is
null. |
protected IJavaModelStatus |
verifyNameCollision()
Verify for a name collision in the destination container.
|
checkCanceled, createAfter, createBefore, executeOperation, generateNewCompilationUnitAST, generateResultHandle, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getMainTaskName, getSchedulingRule, initializeDefaultPosition, 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 java.lang.String source
protected java.lang.String alteredName
ASTNode that may be used to
create this new element.
Used by the CopyElementsOperation for renamingprotected ASTNode createdNode
public CreateTypeMemberOperation(IJavaElement parentElement, java.lang.String source, boolean force)
protected StructuralPropertyDescriptor getChildPropertyDescriptor(ASTNode parent)
getChildPropertyDescriptor in class CreateElementInCUOperationprotected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException
generateElementAST in class CreateElementInCUOperationJavaModelExceptionprotected abstract SimpleName rename(ASTNode node, SimpleName newName)
protected java.lang.String generateSyntaxIncorrectAST()
ASTNode based on the source of this operation
when there is likely a syntax error in the source.
Returns the source used to generate this node.protected IType getType()
protected void setAlteredName(java.lang.String newName)
ASTNode that will be used to
create this new element.
Used by the CopyElementsOperation for renamingsetAlteredName in class CreateElementInCUOperationpublic IJavaModelStatus verify()
null.
null or has serious syntax errors.
verify in class CreateElementInCUOperationIJavaModelStatus,
JavaConventionsprotected IJavaModelStatus verifyNameCollision()