Class NativeWidgetHelper


  • public final class NativeWidgetHelper
    extends java.lang.Object
    Util class for faking native widgets.
    Author:
    jfaltermeier
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.eclipse.swt.graphics.Image getCheckBoxImage​(org.eclipse.swt.widgets.Control control, NativeWidgetHelper.CheckBoxState state)
      Returns the image of a checkbox.
      static void initCheckBoxImages​(org.eclipse.swt.widgets.Control control)
      Creates screenshots of the platform's native checkbox in checked and unchecked state.
      • Methods inherited from class java.lang.Object

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

      • initCheckBoxImages

        public static void initCheckBoxImages​(org.eclipse.swt.widgets.Control control)
        Creates screenshots of the platform's native checkbox in checked and unchecked state. The images can be accessed via getCheckBoxImage(Control, CheckBoxState).
        Parameters:
        control - a control which provides the Display and Shell to create the screen shots
      • getCheckBoxImage

        public static org.eclipse.swt.graphics.Image getCheckBoxImage​(org.eclipse.swt.widgets.Control control,
                                                                      NativeWidgetHelper.CheckBoxState state)
        Returns the image of a checkbox. If initCheckBoxImages(Control) was called beforehand this will return images resembling the platform's native widgets. Otherwise a default image (Windows 7) will be returned.
        Parameters:
        control - a control which provides the Display to create the image
        state - the state of the checkbox
        Returns:
        the image