# ComponentStatusLabel (ARX GUI Documentation)

org.deidentifier.arx.gui.view.impl.common

## Class ComponentStatusLabel

- 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.deidentifier.arx.gui.view.impl.common.ComponentStatusLabel

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

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

  A label that can display animated GIFs. Adapted from https://stackoverflow.com/questions/6896632/is-there-a-custom-label-widget-which-supports-animated-gif

- - ### Field Summary

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

      `embeddedHandle`

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

      `handle`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.eclipse.swt.graphics.Point` | `computeSize(int wHint, int hHint, boolean changed)`
    `void` | `dispose()`
    `int` | `getAlignment()`
    `int` | `getBottomMargin()`
    `org.eclipse.swt.graphics.Image` | `getImage()`
    `int` | `getLeftMargin()`
    `int` | `getRightMargin()`
    `int` | `getStyle()`
    `java.lang.String` | `getText()`
    `java.lang.String` | `getToolTipText()`
    `int` | `getTopMargin()`
    `void` | `setAlignment(int align)`
    `void` | `setBackground(org.eclipse.swt.graphics.Color color)`
    `void` | `setBackground(org.eclipse.swt.graphics.Color[] colors, int[] percents)`
    `void` | `setBackground(org.eclipse.swt.graphics.Color[] colors, int[] percents, boolean vertical)`
    `void` | `setBackground(org.eclipse.swt.graphics.Image image)`
    `void` | `setBottomMargin(int bottomMargin)`
    `void` | `setFont(org.eclipse.swt.graphics.Font font)`
    `void` | `setGIF(java.io.InputStream inputStream)`
    `void` | `setGIF(java.lang.String path)`
    `void` | `setImage(org.eclipse.swt.graphics.Image image)`
    `void` | `setLeftMargin(int leftMargin)`
    `void` | `setMargins(int leftMargin, int topMargin, int rightMargin, int bottomMargin)`
    `void` | `setProgressProvider(ComponentStatusLabelProgressProvider provider)` Sets a progress provider, if any
    `void` | `setRightMargin(int rightMargin)`
    `void` | `setText(java.lang.String text)`
    `void` | `setToolTipText(java.lang.String string)`
    `void` | `setTopMargin(int topMargin)`
    `protected java.lang.String` | `shortenText(org.eclipse.swt.graphics.GC gc, java.lang.String t, int width)`
    `void` | `updateImage(org.eclipse.swt.graphics.Image image)` Updates the image

    - ### 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, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList`

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

      `computeTrim, getBorderWidth, 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, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, 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, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update`

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

      `addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, 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`

- - ### Constructor Detail

    - #### ComponentStatusLabel

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

      Parameters:
        `parent` -
        `style` -

  - ### Method Detail

    - #### computeSize

          public org.eclipse.swt.graphics.Point computeSize(int wHint,
                                                   int hHint,
                                                   boolean changed)

      Overrides:
        `computeSize` in class `org.eclipse.swt.widgets.Composite`

    - #### dispose

          public void dispose()

      Overrides:
        `dispose` in class `org.eclipse.swt.widgets.Widget`

    - #### getAlignment

          public int getAlignment()

      Returns:

    - #### getBottomMargin

          public int getBottomMargin()

      Returns:

    - #### getImage

          public org.eclipse.swt.graphics.Image getImage()

      Returns:

    - #### getLeftMargin

          public int getLeftMargin()

      Returns:

    - #### getRightMargin

          public int getRightMargin()

      Returns:

    - #### getStyle

          public int getStyle()

      Overrides:
        `getStyle` in class `org.eclipse.swt.widgets.Widget`

    - #### getText

          public java.lang.String getText()

      Returns:

    - #### getToolTipText

          public java.lang.String getToolTipText()

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

    - #### getTopMargin

          public int getTopMargin()

      Returns:

    - #### setAlignment

          public void setAlignment(int align)

      Parameters:
        `align` -

    - #### setBackground

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

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

    - #### setBackground

          public void setBackground(org.eclipse.swt.graphics.Color[] colors,
                           int[] percents)

      Parameters:
        `colors` -
        `percents` -

    - #### setBackground

          public void setBackground(org.eclipse.swt.graphics.Color[] colors,
                           int[] percents,
                           boolean vertical)

      Parameters:
        `colors` -
        `percents` -
        `vertical` -

    - #### setBackground

          public void setBackground(org.eclipse.swt.graphics.Image image)

      Parameters:
        `image` -

    - #### setBottomMargin

          public void setBottomMargin(int bottomMargin)

      Parameters:
        `bottomMargin` -

    - #### setFont

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

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

    - #### setGIF

          public void setGIF(java.io.InputStream inputStream)

      Parameters:
        `inputStream` -

    - #### setGIF

          public void setGIF(java.lang.String path)

      Parameters:
        `path` -

    - #### setImage

          public void setImage(org.eclipse.swt.graphics.Image image)

      Parameters:
        `image` -

    - #### setLeftMargin

          public void setLeftMargin(int leftMargin)

      Parameters:
        `leftMargin` -

    - #### setMargins

          public void setMargins(int leftMargin,
                        int topMargin,
                        int rightMargin,
                        int bottomMargin)

      Parameters:
        `leftMargin` -
        `topMargin` -
        `rightMargin` -
        `bottomMargin` -

    - #### setProgressProvider

          public void setProgressProvider(ComponentStatusLabelProgressProvider provider)

      Sets a progress provider, if any
      Parameters:
        `provider` -

    - #### setRightMargin

          public void setRightMargin(int rightMargin)

      Parameters:
        `rightMargin` -

    - #### setText

          public void setText(java.lang.String text)

      Parameters:
        `text` -

    - #### setToolTipText

          public void setToolTipText(java.lang.String string)

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

    - #### setTopMargin

          public void setTopMargin(int topMargin)

      Parameters:
        `topMargin` -

    - #### updateImage

          public void updateImage(org.eclipse.swt.graphics.Image image)

      Updates the image
      Parameters:
        `image` -

    - #### shortenText

          protected java.lang.String shortenText(org.eclipse.swt.graphics.GC gc,
                                     java.lang.String t,
                                     int width)

      Parameters:
        `gc` -
        `t` -
        `width` -
      Returns: