Class WorkspaceUndoUtil

java.lang.Object
org.eclipse.ui.ide.undo.WorkspaceUndoUtil

public class WorkspaceUndoUtil extends Object
WorkspaceUndoUtil defines common utility methods and constants used by clients who create undoable workspace operations.
Since:
3.3
  • Method Details

    • getWorkspaceUndoContext

      public static IUndoContext getWorkspaceUndoContext()
      Return the undo context that should be used for workspace-wide operations
      Returns:
      the undo context suitable for workspace-level operations.
    • getTasksUndoContext

      public static IUndoContext getTasksUndoContext()
      Return the undo context that should be used for operations involving tasks.
      Returns:
      the tasks undo context
    • getBookmarksUndoContext

      public static IUndoContext getBookmarksUndoContext()
      Return the undo context that should be used for operations involving bookmarks.
      Returns:
      the bookmarks undo context
    • getProblemsUndoContext

      public static IUndoContext getProblemsUndoContext()
      Return the undo context that should be used for operations involving problems.
      Returns:
      the problems undo context
      Since:
      3.7
    • getUIInfoAdapter

      public static IAdaptable getUIInfoAdapter(Shell shell)
      Make an IAdaptable that adapts to the specified shell, suitable for passing for passing to any IUndoableOperation or IOperationHistory method that requires an IAdaptable uiInfo parameter.
      Parameters:
      shell - the shell that should be returned by the IAdaptable when asked to adapt a shell. If this parameter is null, the returned shell will also be null.
      Returns:
      an IAdaptable that will return the specified shell.
    • getFirstLeafFolder

      public static IContainerSnapshot<? extends IContainer> getFirstLeafFolder(IContainerSnapshot<? extends IContainer> parent)
      Return the first folder found that has no child folders.
      Parameters:
      parent - the parent folder
      Returns:
      the container description for the first child in the receiver that is a leaf, or this container if there are no children.
      Since:
      3.22
    • getShell

      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 the caller in order to supply UI information for prompting the user if necessary. When this parameter is not null, it contains an adapter for the org.eclipse.swt.widgets.Shell.class
      Returns:
      the Shell that can be used to show information