Class LightImageButton

  • All Implemented Interfaces:
    ILightControl

    public class LightImageButton
    extends LightImage
    Light image button – a button with an image.
    • Constructor Detail

      • LightImageButton

        public LightImageButton()
    • Method Detail

      • setAutoRepeat

        public void setAutoRepeat​(boolean autoRepeat)
        Turns the auto-repeat on or off. If auto-repeat is turned on the button will trigger click events while user holds the mouse button down.
        Parameters:
        autoRepeat - the auto-repeat value to set, true to turn the auto-repeat mode on, false to turn it off.
      • setHighlightMargins

        public void setHighlightMargins​(LightMargins highlightMargins)
        Sets the button highlight margins. Use it to fine-tune this button hover highlight rectangle.
        Parameters:
        highlightMargins - the margins to set, should not be null.
      • getHighlightMargins

        public LightMargins getHighlightMargins()
        Returns the button highlight margins.
        Returns:
        the button highlight margins, cannot be null.
      • addClickListener

        public void addClickListener​(IClickListener<LightImageButton> listener)
        Adds the click listener.
        Parameters:
        listener - the listener.
      • removeClickListener

        public void removeClickListener​(IClickListener<LightImageButton> listener)
        Removes the click listener.
        Parameters:
        listener - the listener.
      • paint

        public void paint​(org.eclipse.swt.graphics.GC gc,
                          org.eclipse.swt.graphics.Rectangle rectangle)
        Description copied from interface: ILightControl
        Paints the given rectangle of this control.
        Specified by:
        paint in interface ILightControl
        Overrides:
        paint in class LightImage
        Parameters:
        gc - the GC to paint on.
        rectangle - the rectangle to paint.