Class CopyProjectChange

All Implemented Interfaces:
IAdaptable

public class CopyProjectChange extends ResourceChange
Change that copies a project
Since:
3.15
  • Constructor Details

    • CopyProjectChange

      public CopyProjectChange(IProject resourcePath, IPath newLocation, String newName)
      Copy a project.
      Parameters:
      resourcePath - the project path
      newLocation - location of the new project
      newName - name of the new project
  • Method Details

    • getModifiedResource

      protected IResource getModifiedResource()
      Description copied from class: ResourceChange
      Returns the resource of this change.
      Specified by:
      getModifiedResource in class ResourceChange
      Returns:
      the resource of this change
    • getName

      public String getName()
      Description copied from class: Change
      Returns the human readable name of this change. The name MUST not be null.
      Specified by:
      getName in class Change
      Returns:
      the human readable name of this change
    • perform

      public Change perform(IProgressMonitor pm) throws CoreException
      Description copied from class: Change
      Performs this change. If this method is called on an invalid or disabled change object the result is unspecified. Changes should in general not respond to IProgressMonitor.isCanceled() since canceling a change tree in the middle of its execution leaves the workspace in a half changed state.
      Specified by:
      perform in class Change
      Parameters:
      pm - a progress monitor
      Returns:
      the undo change for this change object or null if no undo is provided
      Throws:
      CoreException - if an error occurred during change execution
    • getDescriptor

      public ChangeDescriptor getDescriptor()
      Description copied from class: Change
      Returns a descriptor of this change.

      Subclasses of changes created by Refactoring.createChange(IProgressMonitor) should override this method to return a RefactoringChangeDescriptor. A change tree created by a particular refactoring is supposed to contain at most one change which returns a refactoring descriptor. Refactorings usually return an instance of CompositeChange in their Refactoring.createChange(IProgressMonitor) method which implements this method. The refactoring framework searches the change tree top-down until a refactoring descriptor is found.

      Overrides:
      getDescriptor in class Change
      Returns:
      a descriptor of this change, or null if this change does not provide a change descriptor.
    • setDescriptor

      public void setDescriptor(ChangeDescriptor descriptor)
      Sets the change descriptor to be returned by Change.getDescriptor().
      Parameters:
      descriptor - the change descriptor