Class UIUtil

java.lang.Object
org.eclipse.net4j.util.ui.UIUtil

public final class UIUtil extends Object
Author:
Eike Stepper
  • Field Details

  • Method Details

    • redColor

      public static Color redColor()
      Since:
      3.12
    • grayColor

      public static Color grayColor()
      Since:
      3.12
    • errorImage

      public static Image errorImage()
      Since:
      3.12
    • copyToClipboard

      public static void copyToClipboard(Display display, String text)
      Since:
      3.1
    • dispose

      public static void dispose(Font font)
    • dispose

      public static void dispose(Color color)
    • dispose

      public static void dispose(Widget widget)
    • getItalicFont

      public static Font getItalicFont(Control control)
      Since:
      3.3
    • getBoldFont

      public static Font getBoldFont(Control control)
    • getDisplay

      public static Display getDisplay()
    • getShell

      public static Shell getShell()
      Since:
      3.5
    • getWorkbench

      public static IWorkbench getWorkbench()
      Since:
      2.0
    • getActiveWorkbenchWindow

      public static IWorkbenchWindow getActiveWorkbenchWindow()
      Since:
      2.0
    • getActiveWorkbenchPage

      public static IWorkbenchPage getActiveWorkbenchPage()
      Since:
      2.0
    • getActiveWorkbenchPart

      public static IWorkbenchPart getActiveWorkbenchPart()
      Since:
      2.0
    • getElementIfOne

      public static Object getElementIfOne(ISelection selection)
      Since:
      3.0
    • getElement

      public static Object getElement(ISelection selection)
      Since:
      2.0
    • getElement

      public static <T> T getElement(ISelection selection, Class<T> type)
      Since:
      2.0
    • getElements

      public static List<Object> getElements(ISelection selection)
      Since:
      3.5
    • getElements

      public static <T> List<T> getElements(ISelection selection, Class<T> type)
      Since:
      2.0
    • adaptElement

      public static <T> T adaptElement(ISelection selection, Class<T> type)
      Like getElement(ISelection, Class) except that it attempts to adapt IAdaptables to the required type, if necessary.
      Since:
      3.4
    • adaptElements

      public static <T> List<T> adaptElements(ISelection selection, Class<T> type)
      Like getElements(ISelection, Class) except that it attempts to adapt IAdaptables to the required type, if necessary.
      Since:
      3.5
    • setValidationContext

      public static int setValidationContext(Control control, ValidationContext context)
      Since:
      3.1
    • createInteractiveCredentialsProvider

      public static IPasswordCredentialsProvider createInteractiveCredentialsProvider()
    • createBrowser

      public static SafeBrowser createBrowser(Composite parent)
      Since:
      3.19
    • createGridComposite

      public static Composite createGridComposite(Composite parent, int columns)
    • createGridLayout

      public static GridLayout createGridLayout(int columns)
    • createGridData

      public static GridData createGridData()
    • createGridData

      public static GridData createGridData(boolean grabHorizontal, boolean grabVertical)
    • createGridData

      public static GridData createGridData(int horizontalSpan, int verticalSpan)
      Since:
      3.4
    • createEmptyGridData

      public static GridData createEmptyGridData()
      Since:
      3.0
    • addDecorationMargin

      public static void addDecorationMargin(Control control)
    • setIndentation

      public static void setIndentation(Control control, int horizontalIndent, int verticalIndent)
      Adds indentation to the control. if indent value is < 0, the control indentation is left unchanged.
      Since:
      2.0
    • initResource

      public static <T> T initResource(Function<Display,T> initializer)
      Since:
      3.12
    • syncExec

      public static void syncExec(Runnable runnable)
      Since:
      3.5
    • syncExec

      public static void syncExec(Display display, Runnable runnable)
      Since:
      3.5
    • asyncExec

      public static void asyncExec(Runnable runnable)
      Since:
      3.9
    • asyncExec

      public static void asyncExec(Display display, Runnable runnable)
      Since:
      3.9
    • exec

      public static void exec(Display display, boolean sync, Runnable runnable)
      Since:
      3.9
    • runWithProgress

      public static void runWithProgress(IRunnableWithProgress runnable)
      Since:
      3.3
    • preserveViewerState

      public static void preserveViewerState(Viewer viewer, Runnable runnable)
      Since:
      3.3
    • refreshViewer

      public static void refreshViewer(Viewer viewer)
      Since:
      2.0
    • refreshElement

      public static void refreshElement(StructuredViewer viewer, Object element, boolean updateLabels)
      Since:
      3.3
    • updateElements

      public static void updateElements(StructuredViewer viewer, Object element)
      Since:
      3.5
    • setStatusBarMessage

      public static void setStatusBarMessage(String message, Image image)
      Shows a message in the StatusBar. Image can be omitted by passing a null parameter
      Since:
      2.0
    • addDragSupport

      public static void addDragSupport(StructuredViewer viewer)
      Since:
      3.5
    • isParent

      public static boolean isParent(Composite parent, Control controlToCheck)
      Since:
      3.9
    • forEachChild

      public static void forEachChild(Composite composite, Consumer<Control> consumer)
      Since:
      3.9
    • selectReveal

      public static void selectReveal(Object object)
      Since:
      3.10