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 interfaceAllows to set focus to some default state. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.ui.IWorkbenchWindowstatic voidselectAndReveal(Object objects, org.eclipse.ui.IWorkbenchWindow workbenchWindow) Attempts to select and reveal the specifiedobjectsin all parts within the given workbench window's active page.static voidselectAndReveal(ISelection selection, org.eclipse.ui.IWorkbenchWindow workbenchWindow) Attempts to select and reveal the specifiedselectionin all parts within the given workbench window's active page.static voidsetPropertiesViewDefaultFocus(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;
nullcan be returned.
-
selectAndReveal
Attempts to select and reveal the specifiedobjectsin 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, ifnullor 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 specifiedselectionin 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-IWorkbenchWindowto which target properties view belong.
-