public class CreateTypeOperation extends CreateTypeMemberOperation
This operation creates a class or interface.
Required Attributes:
JavaModelOperation.IPostActionalteredName, 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 |
|---|
CreateTypeOperation(IJavaElement parentElement,
java.lang.String source,
boolean force)
When executed, this operation will create a type unit
in the given parent element (a compilation unit, type)
|
| 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 IType |
getType()
Returns the
IType the member is to be created in. |
protected SimpleName |
rename(ASTNode node,
SimpleName newName) |
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.
|
generateSyntaxIncorrectAST, getChildPropertyDescriptor, setAlteredNamecheckCanceled, createAfter, createBefore, executeOperation, generateNewCompilationUnitAST, generateResultHandles, getCompilationUnit, getMainAmountOfWork, 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, workedpublic CreateTypeOperation(IJavaElement parentElement, java.lang.String source, boolean force)
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 IType getType()
IType the member is to be created in.getType in class CreateTypeMemberOperationprotected IJavaModelStatus verifyNameCollision()
CreateTypeMemberOperationverifyNameCollision in class CreateTypeMemberOperationCreateTypeMemberOperation.verifyNameCollision()public IJavaModelStatus verify()
CreateTypeMemberOperationnull.
null or has serious syntax errors.
verify in class CreateTypeMemberOperationIJavaModelStatus,
JavaConventionsprotected SimpleName rename(ASTNode node, SimpleName newName)
rename in class CreateTypeMemberOperation