Class MoveFilesAndFoldersOperation


  • public class MoveFilesAndFoldersOperation
    extends CopyFilesAndFoldersOperation
    Moves files and folders.

    This class may be instantiated; it is not intended to be subclassed.

    Since:
    2.1
    Restriction:
    This class is not intended to be subclassed by clients.
    • Constructor Detail

      • MoveFilesAndFoldersOperation

        public MoveFilesAndFoldersOperation​(Shell shell)
        Creates a new operation initialized with a shell.
        Parameters:
        shell - parent shell for error dialogs
    • Method Detail

      • canPerformAutoRename

        protected boolean canPerformAutoRename()
        Returns whether this operation is able to perform on-the-fly auto-renaming of resources with name collisions.
        Overrides:
        canPerformAutoRename in class CopyFilesAndFoldersOperation
        Returns:
        true if auto-rename is supported, and false otherwise
      • getDeepCheckQuestion

        protected java.lang.String getDeepCheckQuestion​(IResource source)
        Returns the message for querying deep copy/move of a linked resource.
        Overrides:
        getDeepCheckQuestion in class CopyFilesAndFoldersOperation
        Parameters:
        source - resource the query is made for
        Returns:
        the deep query message
      • getProblemsTitle

        protected java.lang.String getProblemsTitle()
        Returns the title for this operation's problems dialog.
        Overrides:
        getProblemsTitle in class CopyFilesAndFoldersOperation
        Returns:
        the problems dialog title
      • getValidateConflictSource

        protected boolean getValidateConflictSource()
        Returns whether the source file in a destination collision will be validateEdited together with the collision itself. Returns true.
        Overrides:
        getValidateConflictSource in class CopyFilesAndFoldersOperation
        Returns:
        boolean true, the source file in a destination collision should be validateEdited.
      • validateDestination

        public java.lang.String validateDestination​(IContainer destination,
                                                    IResource[] sourceResources)
        Description copied from class: CopyFilesAndFoldersOperation
        Checks whether the destination is valid for copying the source resources.

        Note this method is for internal use only. It is not API.

        Overrides:
        validateDestination in class CopyFilesAndFoldersOperation
        Parameters:
        destination - the destination container
        sourceResources - the source resources
        Returns:
        an error message, or null if the path is valid
      • getUndoableCopyOrMoveOperation

        protected AbstractWorkspaceOperation getUndoableCopyOrMoveOperation​(IResource[] resources,
                                                                            IPath destinationPath)
        Returns an AbstractWorkspaceOperation suitable for performing the move or copy operation that will move or copy the given resources to the given destination path.
        Overrides:
        getUndoableCopyOrMoveOperation in class CopyFilesAndFoldersOperation
        Parameters:
        resources - the resources to be moved or copied
        destinationPath - the destination path to which the resources should be moved
        Returns:
        the operation that should be used to perform the move or copy
        Since:
        3.3