org.eclipse.jdt.internal.core
Class CreatePackageDeclarationOperation
java.lang.Object
org.eclipse.jdt.internal.core.JavaModelOperation
org.eclipse.jdt.internal.core.CreateElementInCUOperation
org.eclipse.jdt.internal.core.CreatePackageDeclarationOperation
- All Implemented Interfaces:
- IWorkspaceRunnable, org.eclipse.core.runtime.IProgressMonitor
public class CreatePackageDeclarationOperation
- extends CreateElementInCUOperation
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
Fields inherited from interface org.eclipse.core.runtime.IProgressMonitor |
UNKNOWN |
Method Summary |
java.lang.String |
getMainTaskName()
Returns the name of the main task of this operation for
progress reporting. |
IJavaModelStatus |
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. |
Methods inherited from class org.eclipse.jdt.internal.core.JavaModelOperation |
beginTask, done, executeNestedOperation, getJavaModel, getResultElements, hasModifiedResource, internalWorked, isCanceled, isReadOnly, newJavaElementDelta, run, runOperation, setCanceled, setTaskName, subTask, worked |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CreatePackageDeclarationOperation
public CreatePackageDeclarationOperation(java.lang.String name,
ICompilationUnit parentElement)
- When executed, this operation will add a package declaration to the given compilation unit.
getMainTaskName
public java.lang.String getMainTaskName()
- Description copied from class:
CreateElementInCUOperation
- Returns the name of the main task of this operation for
progress reporting.
- Specified by:
getMainTaskName
in class CreateElementInCUOperation
- See Also:
CreateElementInCUOperation.getMainTaskName()
verify
public IJavaModelStatus 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.
- Overrides:
verify
in class CreateElementInCUOperation
- See Also:
IJavaModelStatus
,
JavaConventions