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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CollectiongetActiveContexts(Object appContext) Return the active contexts.static IEditorPartgetActiveEditor(Object appContext) Return the active editor.static StringgetActiveEditorId(Object appContext) Return the part id of the active editor.static IWorkbenchPartgetActivePart(Object appContext) Return the active part.static StringgetActivePartId(Object appContext) Return the part id of the active part.static ShellgetActiveShell(Object appContext) Return the active shell.static IWorkbenchSitegetActiveSite(Object appContext) Return the active part site.static IWorkbenchWindowgetActiveWorkbenchWindow(Object appContext) Return the active workbench window.static ISelectiongetCurrentSelection(Object appContext) Return the current selection.static ObjectgetVariable(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
nullif 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.
-