Package org.eclipse.ui.actions
Class MoveFilesAndFoldersOperation
java.lang.Object
org.eclipse.ui.actions.CopyFilesAndFoldersOperation
org.eclipse.ui.actions.MoveFilesAndFoldersOperation
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 Summary
ConstructorDescriptionCreates a new operation initialized with a shell. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Returns whether this operation is able to perform on-the-fly auto-renaming of resources with name collisions.protected void
copy
(IResource[] resources, IPath destination, IProgressMonitor monitor) Deprecated.protected String
getDeepCheckQuestion
(IResource source) Returns the message for querying deep copy/move of a linked resource.protected String
Returns the task title for this operation's progress dialog.protected String
Returns the message for this operation's problems dialog.protected String
Returns the title for this operation's problems dialog.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.protected boolean
Returns whether the source file in a destination collision will be validateEdited together with the collision itself.protected boolean
isMove()
Return whether the operation is a move or a copyvalidateDestination
(IContainer destination, IResource[] sourceResources) Checks whether the destination is valid for copying the source resources.Methods inherited from class org.eclipse.ui.actions.CopyFilesAndFoldersOperation
copyFiles, copyFiles, copyFilesInCurrentThread, copyFilesInCurrentThread, copyOrLinkFiles, copyResources, copyResourcesInCurrentThread, createVirtualFoldersAndLinks, getFile, getFiles, getFolder, getModelProviderIds, homogenousResources, linkFiles, setCreateLinks, setModelProviderIds, setRelativeVariable, setVirtualFolders, validateImportDestination
-
Constructor Details
-
MoveFilesAndFoldersOperation
Creates a new operation initialized with a shell.- Parameters:
shell
- parent shell for error dialogs
-
-
Method Details
-
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 classCopyFilesAndFoldersOperation
- Returns:
true
if auto-rename is supported, andfalse
otherwise
-
copy
@Deprecated protected void copy(IResource[] resources, IPath destination, IProgressMonitor monitor) throws CoreException Deprecated.As of 3.3, the work is performed in the undoable operation created ingetUndoableCopyOrMoveOperation(IResource[], IPath)
Moves the resources to the given destination. This method is called recursively to merge folders during folder move.- Overrides:
copy
in classCopyFilesAndFoldersOperation
- Parameters:
resources
- the resources to movedestination
- destination to which resources will be movedmonitor
- a progress monitor for showing progress and for cancelation- Throws:
CoreException
-
getDeepCheckQuestion
Returns the message for querying deep copy/move of a linked resource.- Overrides:
getDeepCheckQuestion
in classCopyFilesAndFoldersOperation
- Parameters:
source
- resource the query is made for- Returns:
- the deep query message
-
getOperationTitle
Returns the task title for this operation's progress dialog.- Overrides:
getOperationTitle
in classCopyFilesAndFoldersOperation
- Returns:
- the task title
-
getProblemsMessage
Returns the message for this operation's problems dialog.- Overrides:
getProblemsMessage
in classCopyFilesAndFoldersOperation
- Returns:
- the problems message
-
getProblemsTitle
Returns the title for this operation's problems dialog.- Overrides:
getProblemsTitle
in classCopyFilesAndFoldersOperation
- 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 classCopyFilesAndFoldersOperation
- Returns:
- boolean
true
, the source file in a destination collision should be validateEdited.
-
validateDestination
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 classCopyFilesAndFoldersOperation
- Parameters:
destination
- the destination containersourceResources
- the source resources- Returns:
- an error message, or
null
if the path is valid
-
isMove
protected boolean isMove()Description copied from class:CopyFilesAndFoldersOperation
Return whether the operation is a move or a copy- Overrides:
isMove
in classCopyFilesAndFoldersOperation
- Returns:
- whether the operation is a move or a copy
-
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 classCopyFilesAndFoldersOperation
- Parameters:
resources
- the resources to be moved or copieddestinationPath
- 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
-
getUndoableCopyOrMoveOperation(IResource[], IPath)