Class CreateTypeHierarchyOperation
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
org.aspectj.org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation
- All Implemented Interfaces:
org.eclipse.core.resources.IWorkspaceRunnable, org.eclipse.core.runtime.ICoreRunnable, org.eclipse.core.runtime.IProgressMonitor
This operation creates an
ITypeHierarchy for a specific type within
a specified region, or for all types within a region. The specified
region limits the number of resolved subtypes (to the subset of
types in the specified region). The resolved supertypes may go outside
of the specified region in order to reach the root(s) of the type
hierarchy. A Java Project is required to provide a context (classpath)
to use while resolving supertypes and subtypes.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JavaModelOperation
JavaModelOperation.IPostAction -
Field Summary
FieldsFields inherited from class 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, TRUEModifier and TypeFieldDescriptionprotected JavaModelOperation.IPostAction[]protected intprotected intprotected static final intprotected HashMapprotected IJavaElement[]The elements this operation operates on, ornullif this operation does not operate on specific elements.protected booleanConflict resolution policy - by default do not force (fail on a conflict).static final Stringprotected booleanA flag indicating whether this operation is nested.protected static final intprotected static final IJavaElement[]An empty collection ofIJavaElements - the common empty result if no elements are created, or if this operation is not actually executed.protected static final ThreadLocalprotected IJavaElement[]The parent elements this operation operates with ornullif this operation does not operate with specific parent elements.protected static booleanorg.eclipse.core.runtime.SubMonitorThe progress monitor passed into this operationprotected static final intprotected IJavaElement[]The elements created by this operation - empty until the operation actually creates elements.static final StringFields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionCreateTypeHierarchyOperation(IRegion region, ICompilationUnit[] workingCopies, IType element, boolean computeSubtypes) Constructs an operation to create a type hierarchy for the given type within the specified region, in the context of the given project.CreateTypeHierarchyOperation(IType element, ICompilationUnit[] workingCopies, IJavaProject project, boolean computeSubtypes) Constructs an operation to create a type hierarchy for the given type and working copies.CreateTypeHierarchyOperation(IType element, ICompilationUnit[] workingCopies, IJavaSearchScope scope, boolean computeSubtypes) Constructs an operation to create a type hierarchy for the given type and working copies. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerforms the operation - creates the type hierarchyReturns the generated type hierarchy.booleanReturnstrueif this operation performs no resource modifications, otherwisefalse.verify()Possible failures: NO_ELEMENTS_TO_PROCESS - at least one of a type or region must be provided to generate a type hierarchy.Methods inherited from class JavaModelOperation
addAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, checkCanceled, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, getLatestASTLevel, getNestedFolders, getParentElement, getParentElements, getResultElements, getSchedulingRule, getSubProgressMonitor, hasModifiedResource, internalWorked, isCanceled, isTopLevelOperation, moveResources, newJavaElementDelta, popOperation, postAction, prefixesOneOf, pushOperation, removeAllPostAction, removeReconcileDelta, run, runOperation, runPostActions, setAttribute, setCanceled, setNested, setTaskName, subTask, workedModifier and TypeMethodDescriptionprotected voidprotected voidaddDelta(IJavaElementDelta delta) protected voidaddReconcileDelta(ICompilationUnit workingCopy, IJavaElementDelta delta) protected voidapplyTextEdit(ICompilationUnit cu, org.eclipse.text.edits.TextEdit edits) voidprotected booleanprotected voidChecks with the progress monitor to see whether this operation should be canceled.protected IJavaModelStatusCommon code used to verify the elements this operation is processing.protected voidcopyResources(org.eclipse.core.resources.IResource[] resources, org.eclipse.core.runtime.IPath container) Convenience method to copy resourcesprotected voidcreateFile(org.eclipse.core.resources.IContainer folder, String name, byte[] contents, boolean forceFlag) Convenience method to create a fileprotected voidcreateFolder(org.eclipse.core.resources.IContainer parentFolder, String name, boolean forceFlag) Convenience method to create a folderprotected voiddeleteEmptyPackageFragment(IPackageFragment fragment, boolean forceFlag, org.eclipse.core.resources.IResource rootResource) Convenience method to delete an empty package fragmentprotected voiddeleteResource(org.eclipse.core.resources.IResource resource, int flags) Convenience method to delete a resourceprotected voiddeleteResources(org.eclipse.core.resources.IResource[] resources, boolean forceFlag) Convenience method to delete resourcesvoiddone()protected booleanequalsOneOf(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] otherPaths) voidexecuteNestedOperation(JavaModelOperation operation, int subWorkAmount) Convenience method to run an operation within this operationprotected intfirstActionWithID(String id, int start) protected static ObjectgetAttribute(Object key) protected ICompilationUnitgetCompilationUnitFor(IJavaElement element) Returns the compilation unit the given element is contained in, or the element itself (if it is a compilation unit), otherwisenull.protected static ArrayListprotected org.eclipse.jface.text.IDocumentprotected IJavaElementReturns the element to which this operation applies, ornullif not applicable.Returns the Java Model this operation is operating in.protected intprotected org.eclipse.core.runtime.IPath[]protected IJavaElementReturns the parent element to which this operation applies, ornullif not applicable.protected IJavaElement[]Returns the parent elements to which this operation applies, ornullif not applicable.Returns the elements created by this operation.protected org.eclipse.core.runtime.jobs.ISchedulingRuleprotected org.eclipse.core.runtime.IProgressMonitorgetSubProgressMonitor(int workAmount) Creates and returns a subprogress monitor if appropriate.booleanReturns whether this operation has performed any resource modifications.voidinternalWorked(double work) booleanprotected booleanprotected voidmoveResources(org.eclipse.core.resources.IResource[] resources, org.eclipse.core.runtime.IPath container) Convenience method to move resourcesCreates and returns a newIJavaElementDeltaon the Java Model.protected JavaModelOperationprotected voidpostAction(JavaModelOperation.IPostAction action, int insertionMode) protected booleanprefixesOneOf(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] otherPaths) protected voidpushOperation(JavaModelOperation operation) protected voidremoveAllPostAction(String actionID) protected voidremoveReconcileDelta(ICompilationUnit workingCopy) voidrun(org.eclipse.core.runtime.IProgressMonitor monitor) Runs this operation and registers any deltas created.voidrunOperation(org.eclipse.core.runtime.IProgressMonitor monitor) Main entry point for Java Model operations.protected voidprotected static voidsetAttribute(Object key, Object attribute) voidsetCanceled(boolean b) protected voidsetNested(boolean nested) Sets whether this operation is nested or not.voidsetTaskName(String name) voidvoidworked(int work) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IProgressMonitor
clearBlocked, setBlocked, slice
-
Field Details
-
typeHierarchy
The generated type hierarchy
-
-
Constructor Details
-
CreateTypeHierarchyOperation
public CreateTypeHierarchyOperation(IRegion region, ICompilationUnit[] workingCopies, IType element, boolean computeSubtypes) Constructs an operation to create a type hierarchy for the given type within the specified region, in the context of the given project. -
CreateTypeHierarchyOperation
public CreateTypeHierarchyOperation(IType element, ICompilationUnit[] workingCopies, IJavaSearchScope scope, boolean computeSubtypes) Constructs an operation to create a type hierarchy for the given type and working copies. -
CreateTypeHierarchyOperation
public CreateTypeHierarchyOperation(IType element, ICompilationUnit[] workingCopies, IJavaProject project, boolean computeSubtypes) Constructs an operation to create a type hierarchy for the given type and working copies.
-
-
Method Details
-
executeOperation
Performs the operation - creates the type hierarchy- Specified by:
executeOperationin classJavaModelOperation- Throws:
JavaModelException- The operation has failed.
-
getResult
Returns the generated type hierarchy. -
isReadOnly
public boolean isReadOnly()Description copied from class:JavaModelOperationReturnstrueif this operation performs no resource modifications, otherwisefalse. Subclasses must override.- Overrides:
isReadOnlyin classJavaModelOperation- See Also:
-
verify
Possible failures:- NO_ELEMENTS_TO_PROCESS - at least one of a type or region must be provided to generate a type hierarchy.
- ELEMENT_NOT_PRESENT - the provided type or type's project does not exist
- Overrides:
verifyin classJavaModelOperation- See Also:
-