Class CreateFieldOperation
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
org.aspectj.org.eclipse.jdt.internal.core.CreateTypeMemberOperation
org.aspectj.org.eclipse.jdt.internal.core.CreateFieldOperation
- All Implemented Interfaces:
org.eclipse.core.resources.IWorkspaceRunnable
,org.eclipse.core.runtime.ICoreRunnable
,org.eclipse.core.runtime.IProgressMonitor
This operation creates a field declaration in a type.
Required Attributes:
- Containing Type
- The source code for the declaration. No verification of the source is performed.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
JavaModelOperation.IPostAction
-
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateTypeMemberOperation
alteredName, createdNode, source
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
anchorElement, creationOccurred, cuAST, INSERT_AFTER, INSERT_BEFORE, INSERT_LAST, insertionPolicy
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
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
Fields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN
-
Constructor Summary
ConstructorDescriptionCreateFieldOperation(IType parentElement, String source, boolean force)
When executed, this operation will create a field with the given name in the given type with the specified source. -
Method Summary
Modifier and TypeMethodDescriptionprotected ASTNode
generateElementAST(ASTRewrite rewriter, ICompilationUnit cu)
protected IJavaElement
Creates and returns the handle for the element this operation created.Returns the name of the main task of this operation for progress reporting.protected void
By default the new field is positioned after the last existing field declaration, or as the first member in the type if there are no field declarations.protected SimpleName
rename(ASTNode node, SimpleName newName)
protected IJavaModelStatus
Verify for a name collision in the destination container.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateTypeMemberOperation
generateSyntaxIncorrectAST, getChildPropertyDescriptor, getType, setAlteredName, verify
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
checkCanceled, createAfter, createBefore, executeOperation, generateNewCompilationUnitAST, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getSchedulingRule, insertASTNode, parse, setRelativePosition
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
addAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, getLatestASTLevel, 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, worked
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.core.runtime.IProgressMonitor
clearBlocked, setBlocked, slice
-
Constructor Details
-
CreateFieldOperation
When executed, this operation will create a field with the given name in the given type with the specified source.By default the new field is positioned after the last existing field declaration, or as the first member in the type if there are no field declarations.
-
-
Method Details
-
generateElementAST
protected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException- Overrides:
generateElementAST
in classCreateTypeMemberOperation
- Throws:
JavaModelException
-
generateResultHandle
Description copied from class:CreateElementInCUOperation
Creates and returns the handle for the element this operation created.- Specified by:
generateResultHandle
in classCreateElementInCUOperation
- See Also:
CreateElementInCUOperation.generateResultHandle()
-
getMainTaskName
Description copied from class:CreateElementInCUOperation
Returns the name of the main task of this operation for progress reporting.- Specified by:
getMainTaskName
in classCreateElementInCUOperation
- See Also:
CreateElementInCUOperation.getMainTaskName()
-
initializeDefaultPosition
protected void initializeDefaultPosition()By default the new field is positioned after the last existing field declaration, or as the first member in the type if there are no field declarations.- Overrides:
initializeDefaultPosition
in classCreateElementInCUOperation
-
verifyNameCollision
Description copied from class:CreateTypeMemberOperation
Verify for a name collision in the destination container.- Overrides:
verifyNameCollision
in classCreateTypeMemberOperation
- See Also:
CreateTypeMemberOperation.verifyNameCollision()
-
rename
- Specified by:
rename
in classCreateTypeMemberOperation
-