Composite Refactoring
v1.0

compositeRefactoring.codemanipulation
Class CreateImport

java.lang.Object
  |
  +--org.eclipse.jdt.internal.core.JavaModelOperation
        |
        +--org.eclipse.jdt.internal.core.CreateElementInCUOperation
              |
              +--org.eclipse.jdt.internal.core.CreateImportOperation
                    |
                    +--compositeRefactoring.codemanipulation.CreateImport
All Implemented Interfaces:
IProgressMonitor, IWorkspaceRunnable

public class CreateImport
extends CreateImportOperation

This is a convenience class to make the CreateImportOperation public. The class creates an importdeclaration (like import java.lang.util.Vector;.


Fields inherited from class org.eclipse.jdt.internal.core.CreateImportOperation
fImportName
 
Fields inherited from class org.eclipse.jdt.internal.core.CreateElementInCUOperation
fAnchorElement, fCreatedElement, fCreationOccurred, fCUDOM, fInsertionPolicy, fInsertionPosition, fReplacementLength, INSERT_AFTER, INSERT_BEFORE, INSERT_LAST
 
Fields inherited from class org.eclipse.jdt.internal.core.JavaModelOperation
fDeltas, fElementsToProcess, fForce, fgEmptyResult, fMonitor, fNested, fParentElements, fResultElements, hasModifiedResource
 
Fields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN
 
Constructor Summary
CreateImport(String importName, ICompilationUnit cu)
          creates an object of CreateImport
 
Method Summary
 void executeOperation()
          creates the compilation unit.
 
Methods inherited from class org.eclipse.jdt.internal.core.CreateImportOperation
generateElementDOM, generateResultHandle, getMainTaskName, initializeDefaultPosition, verify
 
Methods inherited from class org.eclipse.jdt.internal.core.CreateElementInCUOperation
checkCanceled, createAfter, createBefore, generateNewCompilationUnitDOM, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getResultElements, insertDOMNode, setAlteredName, setRelativePosition
 
Methods inherited from class org.eclipse.jdt.internal.core.JavaModelOperation
addDelta, beginTask, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, execute, executeNestedOperation, getCompilationUnitFor, getElementsToProcess, getElementToProcess, getJavaModel, getParentElement, getParentElements, getSubProgressMonitor, getWorkspace, hasModifiedResource, internalWorked, isCanceled, isReadOnly, makeWorkingCopiesConsistent, moveResources, newJavaElementDelta, registerDeltas, run, setCanceled, setNested, setTaskName, subTask, walkDeltaMakingWorkingCopiesConsistent, worked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateImport

public CreateImport(String importName,
                    ICompilationUnit cu)
creates an object of CreateImport
Parameters:
importName - the name of the import (like java.lang.util.Vector)
cu - the compilation unit in which the import is to be created.
Method Detail

executeOperation

public void executeOperation()
creates the compilation unit.
Overrides:
executeOperation in class CreateElementInCUOperation
Following copied from class: org.eclipse.jdt.internal.core.CreateElementInCUOperation
Throws:
JavaModelException - if the operation is unable to complete

Composite Refactoring
v1.0