Class CheckBoxPainter

    • Constructor Detail

      • CheckBoxPainter

        public CheckBoxPainter()
        Create a new CheckBoxPainter with the default images.
      • CheckBoxPainter

        public CheckBoxPainter​(boolean paintBg)
        Create a new CheckBoxPainter with the default images.
        Parameters:
        paintBg - true if this painter should itself paint the background, false if background painting should be skipped.
        Since:
        1.4
      • CheckBoxPainter

        public CheckBoxPainter​(boolean paintBg,
                               boolean invertIcons)
        Create a new CheckBoxPainter with the default images.
        Parameters:
        paintBg - true if this painter should itself paint the background, false if background painting should be skipped.
        invertIcons - Specify whether the default icons should be used (black check mark) or if inverted icons should be used (white check mark).
        Since:
        2.0
      • CheckBoxPainter

        public CheckBoxPainter​(org.eclipse.swt.graphics.Image checkedImg,
                               org.eclipse.swt.graphics.Image uncheckedImg)
        Create a new CheckBoxPainter with the given images for rendering a checked/unchecked state.
        Parameters:
        checkedImg - The image to render the checked state (true).
        uncheckedImg - The image to render the unchecked state (false)
      • CheckBoxPainter

        public CheckBoxPainter​(org.eclipse.swt.graphics.Image checkedImg,
                               org.eclipse.swt.graphics.Image uncheckedImg,
                               boolean paintBg)
        Create a new CheckBoxPainter with the given images for rendering a checked/unchecked state.
        Parameters:
        checkedImg - The image to render the checked state (true).
        uncheckedImg - The image to render the unchecked state (false)
        paintBg - true if this painter should itself paint the background, false if background painting should be skipped.
        Since:
        1.4
    • Method Detail

      • getPreferredWidth

        public int getPreferredWidth​(boolean checked)
      • getPreferredHeight

        public int getPreferredHeight​(boolean checked)
      • paintIconImage

        public void paintIconImage​(org.eclipse.swt.graphics.GC gc,
                                   org.eclipse.swt.graphics.Rectangle rectangle,
                                   int yOffset,
                                   boolean checked)
      • getImage

        public org.eclipse.swt.graphics.Image getImage​(boolean checked)