public class CreatePackageFragmentOperation extends JavaModelOperation
Any needed folders/package fragments are created.
If the package fragment already exists, this operation has no effect.
The result elements include the IPackageFragment created and any side effect
package fragments that were created.
NOTE: A default package fragment exists by default for a given root.
Possible exception conditions:
JavaModelOperation.IPostAction| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String[] |
pkgName
The fully qualified, dot-delimited, package name.
|
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, TRUE| Constructor and Description |
|---|
CreatePackageFragmentOperation(IPackageFragmentRoot parentElement,
java.lang.String packageName,
boolean force)
When executed, this operation will create a package fragment with the given name
under the given package fragment root.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
executeOperation()
Execute the operation - creates the new package fragment and any
side effect package fragments.
|
protected ISchedulingRule |
getSchedulingRule() |
IJavaModelStatus |
verify()
Possible failures:
NO_ELEMENTS_TO_PROCESS - the root supplied to the operation is
null. |
addAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, checkCanceled, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, 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, workedprotected java.lang.String[] pkgName
public CreatePackageFragmentOperation(IPackageFragmentRoot parentElement, java.lang.String packageName, boolean force)
protected void executeOperation()
throws JavaModelException
executeOperation in class JavaModelOperationJavaModelException - if the operation is unable to completeprotected ISchedulingRule getSchedulingRule()
getSchedulingRule in class JavaModelOperationpublic IJavaModelStatus verify()
null.
null or is not a valid package fragment name.
verify in class JavaModelOperationIJavaModelStatus,
JavaConventions