Package com._1c.g5.v8.dt.common.ui
Class WorkbenchUtils
java.lang.Object
com._1c.g5.v8.dt.common.ui.WorkbenchUtils
Various utilities related to
IWorkbench
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Allows to set focus to some default state. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.ui.IWorkbenchWindow
static void
selectAndReveal
(Object objects, org.eclipse.ui.IWorkbenchWindow workbenchWindow) Attempts to select and reveal the specifiedobjects
in all parts within the given workbench window's active page.static void
selectAndReveal
(ISelection selection, org.eclipse.ui.IWorkbenchWindow workbenchWindow) Attempts to select and reveal the specifiedselection
in all parts within the given workbench window's active page.static void
setPropertiesViewDefaultFocus
(org.eclipse.ui.IWorkbenchWindow workbenchWindow) Sets default focus for properties view, usually the focus is set to first editing control.
-
Method Details
-
getActiveWorkbenchWindow
public static org.eclipse.ui.IWorkbenchWindow getActiveWorkbenchWindow()- Returns:
- The active workbench window;
null
can be returned.
-
selectAndReveal
Attempts to select and reveal the specifiedobjects
in all parts within the given workbench window's active page. Checks all parts in the active page to see if they implement ISetSelectionTarget, either directly or as an adapter. If so, tells the part to select and reveal the specified objects.
NOTE: the 'select and reveal' operation is performed in asynchronous way withingDisplay.asyncExec(Runnable)
.- Parameters:
objects
- a sinle object or an iterable/array of objects to select, ifnull
or empty iterable/array nothing will happen.workbenchWindow
- the window to select and reveal the objects, cannot benull
.- See Also:
-
BasicNewResourceWizard.selectAndReveal(org.eclipse.core.resources.IResource)
-
selectAndReveal
public static void selectAndReveal(ISelection selection, org.eclipse.ui.IWorkbenchWindow workbenchWindow) Attempts to select and reveal the specifiedselection
in all parts within the given workbench window's active page. Checks all parts in the active page to see if they implement ISetSelectionTarget, either directly or as an adapter. If so, tells the part to select and reveal the specified objects.
NOTE: the 'select and reveal' operation is performed in asynchronous way withingDisplay.asyncExec(Runnable)
.- Parameters:
selection
- a selection, cannot benull
.workbenchWindow
- the window to select and reveal the objects, cannot benull
.- See Also:
-
BasicNewResourceWizard.selectAndReveal(org.eclipse.core.resources.IResource)
-
setPropertiesViewDefaultFocus
public static void setPropertiesViewDefaultFocus(org.eclipse.ui.IWorkbenchWindow workbenchWindow) Sets default focus for properties view, usually the focus is set to first editing control.- Parameters:
workbenchWindow
-IWorkbenchWindow
to which target properties view belong.
-