org.aspectj.org.eclipse.jdt.internal.core
Class CreatePackageFragmentOperation

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
      extended by org.aspectj.org.eclipse.jdt.internal.core.CreatePackageFragmentOperation

public class CreatePackageFragmentOperation
extends JavaModelOperation

This operation creates a new package fragment under a given package fragment root. The following must be specified:

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:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
JavaModelOperation.IPostAction
 
Field Summary
protected  java.lang.String[] pkgName
          The fully qualified, dot-delimited, package name.
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.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, TRUE
 
Constructor Summary
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.
 
Method Summary
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.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.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, 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, worked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pkgName

protected java.lang.String[] pkgName
The fully qualified, dot-delimited, package name.

Constructor Detail

CreatePackageFragmentOperation

public 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. The dot-separated name is broken into segments. Intermediate folders are created as required for each segment. If the folders already exist, this operation has no effect.

Method Detail

executeOperation

protected void executeOperation()
                         throws JavaModelException
Execute the operation - creates the new package fragment and any side effect package fragments.

Specified by:
executeOperation in class JavaModelOperation
Throws:
JavaModelException - if the operation is unable to complete

getSchedulingRule

protected ISchedulingRule getSchedulingRule()
Overrides:
getSchedulingRule in class JavaModelOperation

verify

public IJavaModelStatus verify()
Possible failures:

Overrides:
verify in class JavaModelOperation
See Also:
IJavaModelStatus, JavaConventions