Class UiUtil

java.lang.Object
com._1c.g5.v8.dt.common.ui.utils.UiUtil

public final class UiUtil extends Object
UI utilities
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Optional<org.eclipse.swt.widgets.Shell>
    Finds UI shell.
    static void
    hookDisposal(org.eclipse.swt.widgets.Widget widget, org.eclipse.jface.resource.ResourceManager resources)
    Dispose of the resource manager when the widget is disposed
    static void
    hookDisposal(org.eclipse.swt.widgets.Widget widget, org.eclipse.swt.graphics.Resource resource)
    Dispose of the resource when the widget is disposed
    static void
    setEnabledRecursively(org.eclipse.swt.widgets.Control control, boolean enable)
    Set enabled state of the control and all its children

    Methods inherited from class java.lang.Object

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

    • UiUtil

      public UiUtil()
  • Method Details

    • hookDisposal

      public static void hookDisposal(org.eclipse.swt.widgets.Widget widget, org.eclipse.swt.graphics.Resource resource)
      Dispose of the resource when the widget is disposed
      Parameters:
      widget - the widget reference, cannot be null
      resource - the resource reference, cannot be null
    • hookDisposal

      public static void hookDisposal(org.eclipse.swt.widgets.Widget widget, org.eclipse.jface.resource.ResourceManager resources)
      Dispose of the resource manager when the widget is disposed
      Parameters:
      widget - the widget reference, cannot be null
      resource - the resources manager reference, cannot be null
    • setEnabledRecursively

      public static void setEnabledRecursively(org.eclipse.swt.widgets.Control control, boolean enable)
      Set enabled state of the control and all its children
      Parameters:
      control - , the control, cannot be null
      enable - , true if control is enabled
    • findShell

      public static Optional<org.eclipse.swt.widgets.Shell> findShell()
      Finds UI shell.
      Returns:
      Shell of active workbench window if called from UI thread. Otherwise, returns shell of some other main window or an empty value if there are no main windows or workbench is not running. Never null.