Package com._1c.g5.v8.dt.common.ui.utils
Class UiUtil
java.lang.Object
com._1c.g5.v8.dt.common.ui.utils.UiUtil
UI utilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 disposedstatic void
hookDisposal
(org.eclipse.swt.widgets.Widget widget, org.eclipse.swt.graphics.Resource resource) Dispose of the resource when the widget is disposedstatic void
setEnabledRecursively
(org.eclipse.swt.widgets.Control control, boolean enable) Set enabled state of the control and all its children
-
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 benull
resource
- the resource reference, cannot benull
-
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 benull
resource
- the resources manager reference, cannot benull
-
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 benull
enable
- ,true
if control is enabled
-
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
.
-