org.vishia.gral.swt

## Class SwtWidgetHelper

- java.lang.Object
- - org.vishia.gral.swt.SwtWidgetHelper

- All Implemented Interfaces:
    GralWidgetImpl_ifc

      public class SwtWidgetHelper
      extends java.lang.Object
      implements GralWidgetImpl_ifc

  The static methods of this class are called in some situations, where same functionality is need in some classes.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `SwtMng` | `mng`
    `private static SwtMng` | `mngs`
    `static int` | `version` Version and history 2011-11-18 Hartmut chg: `setFocusOfTabSwt(Control)` is the implementation of all `org.vishia.gral.base.GralWidget#setFocusGThread()` implementations.
    `org.eclipse.swt.widgets.Control` | `widgetSwt`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwtWidgetHelper(org.eclipse.swt.widgets.Control widgetSwt, SwtMng mng)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static GralColor` | `getColor(org.eclipse.swt.graphics.Color swtColor)`
    `static org.eclipse.swt.graphics.Color` | `getColor(GralColor color)`
    `GralRectangle` | `getPixelPositionSize()`
    `static GralRectangle` | `getPixelPositionSize(org.eclipse.swt.widgets.Control widg)` Deprecated. this routine is implemented in `SwtWidgetHelper` which can be used for all widgets (new concept).
    `void` | `removeWidgetImplementation()`
    `static GralColor` | `setBackgroundColor(GralColor color, org.eclipse.swt.widgets.Control swtWidget)`
    `void` | `setBoundsPixel(int x, int y, int dx, int dy)`
    `boolean` | `setFocusGThread()`
    `static boolean` | `setFocusOfTabSwt(org.eclipse.swt.widgets.Control control)` Sets the correct TabItem if any widget at this TabItem is focused.
    `static GralColor` | `setForegroundColor(GralColor color, org.eclipse.swt.widgets.Control swtWidget)`
    `void` | `setVisibleGThread(boolean bVisible)` Sets the implementation widget vible or not.
    `void` | `specifyContextMenu(GralMenu menu)`
    `void` | `swtUpdateRedraw()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### version

          public static final int version

      Version and history
      - 2011-11-18 Hartmut chg: `setFocusOfTabSwt(Control)` is the implementation of all `org.vishia.gral.base.GralWidget#setFocusGThread()` implementations. It regards that a tab in a TabFolder should be selected if any widget inside the tab-panel is focused. Used extensive in JavaCommander.
      See Also:
        Constant Field Values

    - #### mngs

          private static SwtMng mngs

    - #### mng

          public final SwtMng mng

    - #### widgetSwt

          public org.eclipse.swt.widgets.Control widgetSwt

  - ### Constructor Detail

    - #### SwtWidgetHelper

          public SwtWidgetHelper(org.eclipse.swt.widgets.Control widgetSwt,
                                 SwtMng mng)

  - ### Method Detail

    - #### getColor

          public static GralColor getColor(org.eclipse.swt.graphics.Color swtColor)

    - #### getColor

          public static org.eclipse.swt.graphics.Color getColor(GralColor color)

    - #### setBackgroundColor

          public static GralColor setBackgroundColor(GralColor color,
                                                     org.eclipse.swt.widgets.Control swtWidget)

    - #### setForegroundColor

          public static GralColor setForegroundColor(GralColor color,
                                                     org.eclipse.swt.widgets.Control swtWidget)

    - #### setFocusOfTabSwt

          public static boolean setFocusOfTabSwt(org.eclipse.swt.widgets.Control control)

      Sets the correct TabItem if any widget at this TabItem is focused. That is not done by swt graphic on Control.setFocus().
      Parameters:
        `control` -

    - #### swtUpdateRedraw

          public void swtUpdateRedraw()

    - #### setFocusGThread

          public boolean setFocusGThread()

    - #### setVisibleGThread

          public void setVisibleGThread(boolean bVisible)

      Sets the implementation widget vible or not.
      See Also:
        `GralWidgImpl_ifc.setVisibleGThread(boolean)`

    - #### removeWidgetImplementation

          public void removeWidgetImplementation()

    - #### setBoundsPixel

          public void setBoundsPixel(int x,
                                     int y,
                                     int dx,
                                     int dy)

    - #### getPixelPositionSize

          public GralRectangle getPixelPositionSize()

    - #### getPixelPositionSize

          @Deprecated
          public static GralRectangle getPixelPositionSize(org.eclipse.swt.widgets.Control widg)

      Deprecated. this routine is implemented in `SwtWidgetHelper` which can be used for all widgets (new concept).
      Parameters:
        `widg` -
      Returns:

    - #### specifyContextMenu

          public void specifyContextMenu(GralMenu menu)

      Specified by:
        `specifyContextMenu` in interface `GralWidgetImpl_ifc`