org.vishia.gral.swt

## Class SwtTransparentLabel

- java.lang.Object
- - org.eclipse.swt.widgets.Widget
  - - org.eclipse.swt.widgets.Control
    - - org.eclipse.swt.widgets.Scrollable
      - - org.eclipse.swt.widgets.Composite
        - - org.eclipse.swt.widgets.Canvas
          - - org.vishia.gral.swt.SwtTransparentLabel

- All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable

      public class SwtTransparentLabel
      extends org.eclipse.swt.widgets.Canvas

  This class supports drawing a Label without background. The Problem is: A swt.Color doesn't support the transparent/opaque/alpha property of colors. Therefore setBackground(Color) with an non-opaque color can't be used in SWT (in the current version). But a swt.widgets.Composite support drawing without background. This class isn't offer in the Gral interface. It is used for Prompt labels which overlay an input field.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) org.eclipse.swt.graphics.Font` | `font`
    `protected org.eclipse.swt.events.PaintListener` | `paintListener` The listener for paint events.
    `(package private) java.lang.String` | `text`

    - ### Fields inherited from class org.eclipse.swt.widgets.Control

      `handle`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwtTransparentLabel(org.eclipse.swt.widgets.Composite parent, int style)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getText()`
    `void` | `setBackground(org.eclipse.swt.graphics.Color color)`
    `void` | `setFont(org.eclipse.swt.graphics.Font font)`
    `void` | `setText(java.lang.String string)`

    - ### Methods inherited from class org.eclipse.swt.widgets.Canvas

      `drawBackground, getCaret, getIME, scroll, setCaret, setIME`

    - ### Methods inherited from class org.eclipse.swt.widgets.Composite

      `changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList`

    - ### Methods inherited from class org.eclipse.swt.widgets.Scrollable

      `computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar`

    - ### Methods inherited from class org.eclipse.swt.widgets.Control

      `addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update`

    - ### Methods inherited from class org.eclipse.swt.widgets.Widget

      `addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString`

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

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

    - ### Methods inherited from interface org.eclipse.swt.graphics.Drawable

      `isAutoScalable`

- - ### Field Detail

    - #### text

          java.lang.String text

    - #### font

          org.eclipse.swt.graphics.Font font

    - #### paintListener

          protected org.eclipse.swt.events.PaintListener paintListener

      The listener for paint events. It is called whenever the window is shown newly.

  - ### Constructor Detail

    - #### SwtTransparentLabel

          public SwtTransparentLabel(org.eclipse.swt.widgets.Composite parent,
                                     int style)

  - ### Method Detail

    - #### setText

          public void setText(java.lang.String string)

    - #### setFont

          public void setFont(org.eclipse.swt.graphics.Font font)

      Overrides:
        `setFont` in class `org.eclipse.swt.widgets.Canvas`

    - #### setBackground

          public void setBackground(org.eclipse.swt.graphics.Color color)

      Overrides:
        `setBackground` in class `org.eclipse.swt.widgets.Control`

    - #### getText

          public java.lang.String getText()