Eclipse Platform
Release 3.1

org.eclipse.ui.actions
Class MoveFilesAndFoldersOperation

java.lang.Object
  extended byorg.eclipse.ui.actions.CopyFilesAndFoldersOperation
      extended byorg.eclipse.ui.actions.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

Constructor Summary
MoveFilesAndFoldersOperation(Shell shell)
          Creates a new operation initialized with a shell.
 
Method Summary
protected  boolean canPerformAutoRename()
          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 subMonitor)
          Moves the resources to the given destination.
protected  String getDeepCheckQuestion(IResource source)
          Returns the message for querying deep copy/move of a linked resource.
protected  String getOperationTitle()
          Returns the task title for this operation's progress dialog.
protected  String getProblemsMessage()
          Returns the message for this operation's problems dialog.
protected  String getProblemsTitle()
          Returns the title for this operation's problems dialog.
protected  boolean getValidateConflictSource()
          Returns whether the source file in a destination collision will be validateEdited together with the collision itself.
 String validateDestination(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, copyResources, getFile, getFiles, getFolder, homogenousResources, validateImportDestination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

copy

protected void copy(IResource[] resources,
                    IPath destination,
                    IProgressMonitor subMonitor)
             throws CoreException
Moves the resources to the given destination. This method is called recursively to merge folders during folder move.

Overrides:
copy in class CopyFilesAndFoldersOperation
Parameters:
resources - the resources to move
destination - destination to which resources will be moved
subMonitor - a progress monitor for showing progress and for cancelation
Throws:
CoreException

getDeepCheckQuestion

protected 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

getOperationTitle

protected String getOperationTitle()
Returns the task title for this operation's progress dialog.

Overrides:
getOperationTitle in class CopyFilesAndFoldersOperation
Returns:
the task title

getProblemsMessage

protected String getProblemsMessage()
Returns the message for this operation's problems dialog.

Overrides:
getProblemsMessage in class CopyFilesAndFoldersOperation
Returns:
the problems message

getProblemsTitle

protected 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 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

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.