Class WorkbenchUtils

java.lang.Object
com._1c.g5.v8.dt.common.ui.WorkbenchUtils

public final class WorkbenchUtils extends Object
Various utilities related to IWorkbench
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Allows to set focus to some default state.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.eclipse.ui.IWorkbenchWindow
     
    static void
    selectAndReveal(Object objects, org.eclipse.ui.IWorkbenchWindow workbenchWindow)
    Attempts to select and reveal the specified objects 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 specified selection 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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 specified objects 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 withing Display.asyncExec(Runnable).
      Parameters:
      objects - a sinle object or an iterable/array of objects to select, if null or empty iterable/array nothing will happen.
      workbenchWindow - the window to select and reveal the objects, cannot be null.
      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 specified selection 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 withing Display.asyncExec(Runnable).
      Parameters:
      selection - a selection, cannot be null.
      workbenchWindow - the window to select and reveal the objects, cannot be null.
      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.