Class InternalHandlerUtil

java.lang.Object
org.eclipse.ui.internal.InternalHandlerUtil

public class InternalHandlerUtil extends Object
Some common utilities for working with handlers and IEvaluationContexts in Platform UI.

Note: this class should not be instantiated or extended by clients.

PROVISIONAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.

Since:
3.3
  • Constructor Details

    • InternalHandlerUtil

      public InternalHandlerUtil()
  • Method Details

    • getVariable

      public static Object getVariable(Object appContext, String name)
      Extract the variable.
      Parameters:
      appContext - The application context
      name - The variable name to extract.
      Returns:
      The object from the application context, or null if it could not be found.
    • getActiveContexts

      public static Collection getActiveContexts(Object appContext)
      Return the active contexts.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      a collection of String contextIds, or null.
    • getActiveShell

      public static Shell getActiveShell(Object appContext)
      Return the active shell. Is not necessarily the active workbench window shell.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      the active shell, or null.
    • getActiveWorkbenchWindow

      public static IWorkbenchWindow getActiveWorkbenchWindow(Object appContext)
      Return the active workbench window.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      the active workbench window, or null.
    • getActiveEditor

      public static IEditorPart getActiveEditor(Object appContext)
      Return the active editor.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      the active editor, or null.
    • getActiveEditorId

      public static String getActiveEditorId(Object appContext)
      Return the part id of the active editor.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      the part id of the active editor, or null.
    • getActivePart

      public static IWorkbenchPart getActivePart(Object appContext)
      Return the active part.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      the active part, or null.
    • getActivePartId

      public static String getActivePartId(Object appContext)
      Return the part id of the active part.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      the part id of the active part, or null.
    • getActiveSite

      public static IWorkbenchSite getActiveSite(Object appContext)
      Return the active part site.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      the active part site, or null.
    • getCurrentSelection

      public static ISelection getCurrentSelection(Object appContext)
      Return the current selection.
      Parameters:
      appContext - The execution appContext that contains the application context
      Returns:
      the current selection, or null.