| java.lang.Object org.eclipse.ui.ide.undo.WorkspaceUndoUtil
WorkspaceUndoUtil | public class WorkspaceUndoUtil (Code) | | WorkspaceUndoUtil defines common utility methods and constants used by
clients who create undoable workspace operations.
since: 3.3 |
Method Summary | |
static ResourceDescription[] | copy(IResource[] resources, IPath destination, List resourcesAtDestination, IProgressMonitor monitor, IAdaptable uiInfo, boolean pathIncludesName) Copies the resources to the given destination. | static ResourceDescription[] | delete(IResource[] resourcesToDelete, IProgressMonitor monitor, IAdaptable uiInfo, boolean deleteContent) Delete all of the specified resources, returning resource descriptions
that can be used to restore them.
Parameters: resourcesToDelete - an array of resources to be deleted Parameters: monitor - the progress monitor to use to show the operation's progress Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. | static ResourceDescription | delete(IResource resourceToDelete, IProgressMonitor monitor, IAdaptable uiInfo, boolean forceOutOfSyncDelete, boolean deleteContent) Delete the specified resources, returning a resource description that can
be used to restore it.
Parameters: resourceToDelete - the resource to be deleted Parameters: monitor - the progress monitor to use to show the operation's progress Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. | public static IUndoContext | getBookmarksUndoContext() Return the undo context that should be used for operations involving
bookmarks. | public static Shell | getShell(IAdaptable uiInfo) Return the shell described by the specified adaptable, or the active
shell if no shell has been specified in the adaptable.
Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. | public static IUndoContext | getTasksUndoContext() Return the undo context that should be used for operations involving
tasks. | public static IAdaptable | getUIInfoAdapter(Shell shell) Make an IAdaptable that adapts to the specified shell,
suitable for passing for passing to any
org.eclipse.core.commands.operations.IUndoableOperation or
org.eclipse.core.commands.operations.IOperationHistory method
that requires an
org.eclipse.core.runtime.IAdaptable uiInfo parameter.
Parameters: shell - the shell that should be returned by the IAdaptable when askedto adapt a shell. | public static IUndoContext | getWorkspaceUndoContext() | static ResourceDescription[] | move(IResource[] resources, IPath destination, List resourcesAtDestination, List reverseDestinations, IProgressMonitor monitor, IAdaptable uiInfo, boolean pathIncludesName) Moves the resources to the given destination. | static IResource[] | recreate(ResourceDescription[] resourcesToRecreate, IProgressMonitor monitor, IAdaptable uiInfo) Recreate the resources from the specified resource descriptions.
Parameters: resourcesToRecreate - the ResourceDescriptions describing resources to be recreated Parameters: monitor - the progress monitor used to show progress Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. |
copy | static ResourceDescription[] copy(IResource[] resources, IPath destination, List resourcesAtDestination, IProgressMonitor monitor, IAdaptable uiInfo, boolean pathIncludesName) throws CoreException(Code) | | Copies the resources to the given destination. This method can be called
recursively to merge folders during folder copy.
Parameters: resources - the resources to be copied Parameters: destination - the destination path for the resources, relative to theworkspace Parameters: resourcesAtDestination - A list used to record the new copies. Parameters: monitor - the progress monitor used to show progress Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull , it contains an adapter for theorg.eclipse.swt.widgets.Shell.class Parameters: pathIncludesName - a boolean that indicates whether the specified path includesthe resource's name at the destination. If this value istrue , the destination will contain the desiredname of the resource (usually only desired when only oneresource is being copied). If this value is false ,each resource's name will be appended to the destination. an array of ResourceDescriptions describing any resources thatwere overwritten by the copy operation throws: CoreException - propagates any CoreExceptions thrown from the resources API |
delete | static ResourceDescription[] delete(IResource[] resourcesToDelete, IProgressMonitor monitor, IAdaptable uiInfo, boolean deleteContent) throws CoreException(Code) | | Delete all of the specified resources, returning resource descriptions
that can be used to restore them.
Parameters: resourcesToDelete - an array of resources to be deleted Parameters: monitor - the progress monitor to use to show the operation's progress Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull , it contains an adapter for theorg.eclipse.swt.widgets.Shell.class Parameters: deleteContent - a boolean indicating whether project content should be deletedwhen a project resource is to be deleted an array of ResourceDescriptions that can be used to restore thedeleted resources. throws: CoreException - propagates any CoreExceptions thrown from the resources API |
delete | static ResourceDescription delete(IResource resourceToDelete, IProgressMonitor monitor, IAdaptable uiInfo, boolean forceOutOfSyncDelete, boolean deleteContent) throws CoreException(Code) | | Delete the specified resources, returning a resource description that can
be used to restore it.
Parameters: resourceToDelete - the resource to be deleted Parameters: monitor - the progress monitor to use to show the operation's progress Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull , it contains an adapter for theorg.eclipse.swt.widgets.Shell.class Parameters: forceOutOfSyncDelete - a boolean indicating whether a resource should be deleted evenif it is out of sync with the file system Parameters: deleteContent - a boolean indicating whether project content should be deletedwhen a project resource is to be deleted a ResourceDescription that can be used to restore the deletedresource. throws: CoreException - propagates any CoreExceptions thrown from the resources API |
getBookmarksUndoContext | public static IUndoContext getBookmarksUndoContext()(Code) | | Return the undo context that should be used for operations involving
bookmarks.
the bookmarks undo context |
getShell | public static Shell getShell(IAdaptable uiInfo)(Code) | | Return the shell described by the specified adaptable, or the active
shell if no shell has been specified in the adaptable.
Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull , it contains an adapter for theorg.eclipse.swt.widgets.Shell.class the Shell that can be used to show information |
getTasksUndoContext | public static IUndoContext getTasksUndoContext()(Code) | | Return the undo context that should be used for operations involving
tasks.
the tasks undo context |
getUIInfoAdapter | public static IAdaptable getUIInfoAdapter(Shell shell)(Code) | | Make an IAdaptable that adapts to the specified shell,
suitable for passing for passing to any
org.eclipse.core.commands.operations.IUndoableOperation or
org.eclipse.core.commands.operations.IOperationHistory method
that requires an
org.eclipse.core.runtime.IAdaptable uiInfo parameter.
Parameters: shell - the shell that should be returned by the IAdaptable when askedto adapt a shell. If this parameter is null ,the returned shell will also be null . an IAdaptable that will return the specified shell. |
getWorkspaceUndoContext | public static IUndoContext getWorkspaceUndoContext()(Code) | | Return the undo context that should be used for workspace-wide operations
the undo context suitable for workspace-level operations. |
move | static ResourceDescription[] move(IResource[] resources, IPath destination, List resourcesAtDestination, List reverseDestinations, IProgressMonitor monitor, IAdaptable uiInfo, boolean pathIncludesName) throws CoreException(Code) | | Moves the resources to the given destination. This method can be called
recursively to merge folders during folder move.
Parameters: resources - the resources to be moved Parameters: destination - the destination path for the resources, relative to theworkspace Parameters: resourcesAtDestination - A list used to record each moved resource. Parameters: reverseDestinations - A list used to record each moved resource's original location Parameters: monitor - the progress monitor used to show progress Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull , it contains an adapter for theorg.eclipse.swt.widgets.Shell.class Parameters: pathIncludesName - a boolean that indicates whether the specified path includesthe resource's name at the destination. If this value istrue , the destination will contain the desiredname of the resource (usually only desired when only oneresource is being moved). If this value is false ,each resource's name will be appended to the destination. an array of ResourceDescriptions describing any resources thatwere overwritten by the move operation throws: CoreException - propagates any CoreExceptions thrown from the resources API |
recreate | static IResource[] recreate(ResourceDescription[] resourcesToRecreate, IProgressMonitor monitor, IAdaptable uiInfo) throws CoreException(Code) | | Recreate the resources from the specified resource descriptions.
Parameters: resourcesToRecreate - the ResourceDescriptions describing resources to be recreated Parameters: monitor - the progress monitor used to show progress Parameters: uiInfo - the IAdaptable (or null ) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull , it contains an adapter for theorg.eclipse.swt.widgets.Shell.class an array of resources that were created throws: CoreException - propagates any CoreExceptions thrown from the resources API |
|
|