Package org.eclipse.ui.ide.undo
Class WorkspaceUndoUtil
java.lang.Object
org.eclipse.ui.ide.undo.WorkspaceUndoUtil
WorkspaceUndoUtil defines common utility methods and constants used by
clients who create undoable workspace operations.
- Since:
- 3.3
-
Method Summary
Modifier and TypeMethodDescriptionstatic IUndoContext
Return the undo context that should be used for operations involving bookmarks.static IUndoContext
Return the undo context that should be used for operations involving problems.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.static IUndoContext
Return the undo context that should be used for operations involving tasks.static IAdaptable
getUIInfoAdapter
(Shell shell) Make anIAdaptable
that adapts to the specified shell, suitable for passing for passing to anyIUndoableOperation
orIOperationHistory
method that requires anIAdaptable
uiInfo
parameter.static IUndoContext
Return the undo context that should be used for workspace-wide operations
-
Method Details
-
getWorkspaceUndoContext
Return the undo context that should be used for workspace-wide operations- Returns:
- the undo context suitable for workspace-level operations.
-
getTasksUndoContext
Return the undo context that should be used for operations involving tasks.- Returns:
- the tasks undo context
-
getBookmarksUndoContext
Return the undo context that should be used for operations involving bookmarks.- Returns:
- the bookmarks undo context
-
getProblemsUndoContext
Return the undo context that should be used for operations involving problems.- Returns:
- the problems undo context
- Since:
- 3.7
-
getUIInfoAdapter
Make anIAdaptable
that adapts to the specified shell, suitable for passing for passing to anyIUndoableOperation
orIOperationHistory
method that requires anIAdaptable
uiInfo
parameter.- Parameters:
shell
- the shell that should be returned by the IAdaptable when asked to adapt a shell. If this parameter isnull
, the returned shell will also benull
.- Returns:
- an IAdaptable that will return the specified shell.
-
getShell
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 (ornull
) provided by the caller in order to supply UI information for prompting the user if necessary. When this parameter is notnull
, it contains an adapter for the org.eclipse.swt.widgets.Shell.class- Returns:
- the Shell that can be used to show information
-