Klasse CreatePackageDeclarationOperation
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.CreatePackageDeclarationOperation
- Alle implementierten Schnittstellen:
org.eclipse.core.resources.IWorkspaceRunnable,org.eclipse.core.runtime.ICoreRunnable,org.eclipse.core.runtime.IProgressMonitor
This operation adds/replaces a package declaration in an existing compilation unit. If the compilation unit already includes the specified package declaration, it is not generated (it does not generate duplicates).
Required Attributes:
- Compilation unit element
- Package name
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
JavaModelOperation.IPostAction -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected StringThe name of the package declaration being createdVon Klasse geerbte Felder org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
anchorElement, creationOccurred, cuAST, INSERT_AFTER, INSERT_BEFORE, INSERT_LAST, insertionPolicyVon Klasse geerbte Felder 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, TRUEVon Schnittstelle geerbte Felder org.eclipse.core.runtime.IProgressMonitor
UNKNOWN -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreatePackageDeclarationOperation(String name, ICompilationUnit parentElement) When executed, this operation will add a package declaration to the given compilation unit. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected ASTNodegenerateElementAST(ASTRewrite rewriter, ICompilationUnit cu) protected IJavaElementCreates and returns the handle for the element this operation created.protected StructuralPropertyDescriptorgetChildPropertyDescriptor(ASTNode parent) Returns the name of the main task of this operation for progress reporting.protected voidSets the correct position for new package declaration: before the first import if no imports, before the first type if no type - first thing in the CUverify()Possible failures: NO_ELEMENTS_TO_PROCESS - no compilation unit was supplied to the operation INVALID_NAME - a name supplied to the operation was not a valid package declaration name.Von Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
checkCanceled, createAfter, createBefore, executeOperation, generateNewCompilationUnitAST, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getSchedulingRule, insertASTNode, parse, setAlteredName, setRelativePositionVon Klasse geerbte Methoden 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, workedVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden org.eclipse.core.runtime.IProgressMonitor
clearBlocked, setBlocked, slice
-
Felddetails
-
name
The name of the package declaration being created
-
-
Konstruktordetails
-
CreatePackageDeclarationOperation
When executed, this operation will add a package declaration to the given compilation unit.
-
-
Methodendetails
-
getChildPropertyDescriptor
- Angegeben von:
getChildPropertyDescriptorin KlasseCreateElementInCUOperation
-
generateElementAST
protected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException - Angegeben von:
generateElementASTin KlasseCreateElementInCUOperation- Löst aus:
JavaModelException
-
generateResultHandle
Creates and returns the handle for the element this operation created.- Angegeben von:
generateResultHandlein KlasseCreateElementInCUOperation
-
getMainTaskName
Beschreibung aus Klasse kopiert:CreateElementInCUOperationReturns the name of the main task of this operation for progress reporting.- Angegeben von:
getMainTaskNamein KlasseCreateElementInCUOperation- Siehe auch:
-
initializeDefaultPosition
protected void initializeDefaultPosition()Sets the correct position for new package declaration:- before the first import
- if no imports, before the first type
- if no type - first thing in the CU
- Setzt außer Kraft:
initializeDefaultPositionin KlasseCreateElementInCUOperation
-
verify
Possible failures:- NO_ELEMENTS_TO_PROCESS - no compilation unit was supplied to the operation
- INVALID_NAME - a name supplied to the operation was not a valid package declaration name.
- Setzt außer Kraft:
verifyin KlasseCreateElementInCUOperation- Siehe auch:
-