Package com._1c.g5.v8.dt.common.ui
Class WorkbenchUtils
- java.lang.Object
-
- com._1c.g5.v8.dt.common.ui.WorkbenchUtils
-
public final class WorkbenchUtils extends Object
Various utilities related toIWorkbench
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
WorkbenchUtils.IWithDefaultFocus
Allows to set focus to some default state.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.ui.IWorkbenchWindow
getActiveWorkbenchWindow()
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 Detail
-
getActiveWorkbenchWindow
public static org.eclipse.ui.IWorkbenchWindow getActiveWorkbenchWindow()
- Returns:
- The active workbench window;
null
can be returned.
-
selectAndReveal
public 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. 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.
-
-