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;
.
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 |
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.
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