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
ConstructorsConstructorDescriptionCreates a new operation initialized with a shell. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanReturns whether this operation is able to perform on-the-fly auto-renaming of resources with name collisions.protected voidcopy(IResource[] resources, IPath destination, IProgressMonitor monitor) Deprecated.protected StringgetDeepCheckQuestion(IResource source) Returns the message for querying deep copy/move of a linked resource.protected StringReturns the task title for this operation's progress dialog.protected StringReturns the message for this operation's problems dialog.protected StringReturns the title for this operation's problems dialog.protected AbstractWorkspaceOperationgetUndoableCopyOrMoveOperation(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 booleanReturns whether the source file in a destination collision will be validateEdited together with the collision itself.protected booleanisMove()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:
canPerformAutoRenamein classCopyFilesAndFoldersOperation- Returns:
trueif auto-rename is supported, andfalseotherwise
-
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:
copyin 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:
getDeepCheckQuestionin 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:
getOperationTitlein classCopyFilesAndFoldersOperation- Returns:
- the task title
-
getProblemsMessage
Returns the message for this operation's problems dialog.- Overrides:
getProblemsMessagein classCopyFilesAndFoldersOperation- Returns:
- the problems message
-
getProblemsTitle
Returns the title for this operation's problems dialog.- Overrides:
getProblemsTitlein 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:
getValidateConflictSourcein classCopyFilesAndFoldersOperation- Returns:
- boolean
true, the source file in a destination collision should be validateEdited.
-
validateDestination
Description copied from class:CopyFilesAndFoldersOperationChecks whether the destination is valid for copying the source resources.Note this method is for internal use only. It is not API.
- Overrides:
validateDestinationin classCopyFilesAndFoldersOperation- Parameters:
destination- the destination containersourceResources- the source resources- Returns:
- an error message, or
nullif the path is valid
-
isMove
protected boolean isMove()Description copied from class:CopyFilesAndFoldersOperationReturn whether the operation is a move or a copy- Overrides:
isMovein 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:
getUndoableCopyOrMoveOperationin 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)