Package org.eclipse.ui.internal
Class InternalHandlerUtil
java.lang.Object
org.eclipse.ui.internal.InternalHandlerUtil
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection
getActiveContexts
(Object appContext) Return the active contexts.static IEditorPart
getActiveEditor
(Object appContext) Return the active editor.static String
getActiveEditorId
(Object appContext) Return the part id of the active editor.static IWorkbenchPart
getActivePart
(Object appContext) Return the active part.static String
getActivePartId
(Object appContext) Return the part id of the active part.static Shell
getActiveShell
(Object appContext) Return the active shell.static IWorkbenchSite
getActiveSite
(Object appContext) Return the active part site.static IWorkbenchWindow
getActiveWorkbenchWindow
(Object appContext) Return the active workbench window.static ISelection
getCurrentSelection
(Object appContext) Return the current selection.static Object
getVariable
(Object appContext, String name) Extract the variable.
-
Constructor Details
-
InternalHandlerUtil
public InternalHandlerUtil()
-
-
Method Details
-
getVariable
Extract the variable.- Parameters:
appContext
- The application contextname
- The variable name to extract.- Returns:
- The object from the application context, or
null
if it could not be found.
-
getActiveContexts
Return the active contexts.- Parameters:
appContext
- The execution appContext that contains the application context- Returns:
- a collection of String contextIds, or
null
.
-
getActiveShell
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
Return the active workbench window.- Parameters:
appContext
- The execution appContext that contains the application context- Returns:
- the active workbench window, or
null
.
-
getActiveEditor
Return the active editor.- Parameters:
appContext
- The execution appContext that contains the application context- Returns:
- the active editor, or
null
.
-
getActiveEditorId
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
Return the active part.- Parameters:
appContext
- The execution appContext that contains the application context- Returns:
- the active part, or
null
.
-
getActivePartId
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
Return the active part site.- Parameters:
appContext
- The execution appContext that contains the application context- Returns:
- the active part site, or
null
.
-
getCurrentSelection
Return the current selection.- Parameters:
appContext
- The execution appContext that contains the application context- Returns:
- the current selection, or
null
.
-