Class MainStatusBar.CLabelPadding

  • All Implemented Interfaces:
    java.util.EventListener, org.eclipse.swt.events.PaintListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.internal.SWTEventListener
    Direct Known Subclasses:
    MainStatusBar.UpdateableCLabel
    Enclosing class:
    MainStatusBar

    public class MainStatusBar.CLabelPadding
    extends org.eclipse.swt.widgets.Canvas
    implements org.eclipse.swt.events.PaintListener
    CLabel that shrinks to fit text after a specific period of time. Makes textual changes less jumpy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.swt.graphics.Image bgImage  
      private boolean hovering  
      private org.eclipse.swt.graphics.Image image  
      private static int KEEPWIDTHFOR_MS  
      private int lastWidth  
      private java.lang.String text  
      private java.lang.String tooltip_text  
      private long widthSetOn  
      • Fields inherited from class org.eclipse.swt.widgets.Composite

        embeddedHandle
      • Fields inherited from class org.eclipse.swt.widgets.Widget

        handle
    • Constructor Summary

      Constructors 
      Constructor Description
      CLabelPadding​(org.eclipse.swt.widgets.Composite parent, int style)
      Default Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.swt.graphics.Point computeSize​(int wHint, int hHint)  
      org.eclipse.swt.graphics.Point computeSize​(int wHint, int hHint, boolean changed)  
      org.eclipse.swt.graphics.Point computeSize​(int wHint, int hHint, boolean changed, boolean realWidth)  
      org.eclipse.swt.graphics.Image getBackgroundImage()  
      org.eclipse.swt.graphics.Image getImage()  
      java.lang.String getText()  
      java.lang.String getToolTipText()  
      void layoutNow()  
      void paintControl​(org.eclipse.swt.events.PaintEvent e)  
      void reset()  
      void setBackgroundImage​(org.eclipse.swt.graphics.Image image)  
      void setImage​(org.eclipse.swt.graphics.Image image)  
      void setText​(java.lang.String text)  
      void setToolTipText​(java.lang.String str)  
      • Methods inherited from class org.eclipse.swt.widgets.Canvas

        drawBackground, getCaret, getIME, scroll, setCaret, setFont, 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, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, 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, setBackground, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, 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
    • Field Detail

      • lastWidth

        private int lastWidth
      • widthSetOn

        private long widthSetOn
      • text

        private java.lang.String text
      • tooltip_text

        private java.lang.String tooltip_text
      • hovering

        private boolean hovering
      • image

        private org.eclipse.swt.graphics.Image image
      • bgImage

        private org.eclipse.swt.graphics.Image bgImage
    • Constructor Detail

      • CLabelPadding

        public CLabelPadding​(org.eclipse.swt.widgets.Composite parent,
                             int style)
        Default Constructor
        Parameters:
        parent -
        style -
    • Method Detail

      • setToolTipText

        public void setToolTipText​(java.lang.String str)
        Overrides:
        setToolTipText in class org.eclipse.swt.widgets.Control
      • getToolTipText

        public java.lang.String getToolTipText()
        Overrides:
        getToolTipText in class org.eclipse.swt.widgets.Control
      • paintControl

        public void paintControl​(org.eclipse.swt.events.PaintEvent e)
        Specified by:
        paintControl in interface org.eclipse.swt.events.PaintListener
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(int wHint,
                                                          int hHint)
        Overrides:
        computeSize in class org.eclipse.swt.widgets.Control
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(int wHint,
                                                          int hHint,
                                                          boolean changed)
        Overrides:
        computeSize in class org.eclipse.swt.widgets.Control
      • computeSize

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

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

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

        public void setBackgroundImage​(org.eclipse.swt.graphics.Image image)
        Overrides:
        setBackgroundImage in class org.eclipse.swt.widgets.Control
      • getBackgroundImage

        public org.eclipse.swt.graphics.Image getBackgroundImage()
        Overrides:
        getBackgroundImage in class org.eclipse.swt.widgets.Control
      • getText

        public java.lang.String getText()
      • setText

        public void setText​(java.lang.String text)
      • reset

        public void reset()
      • layoutNow

        public void layoutNow()