Class LightCheckbox

    • Constructor Detail

      • LightCheckbox

        public LightCheckbox()
        Instantiates a new light checkbox.
    • Method Detail

      • getText

        public String getText()
        Returns checkbox text.
        Returns:
        checkbox text, cannot be null.
      • isChecked

        public boolean isChecked()
        This checkbox check state.
        Returns:
        true if checked, false if unchecked.
      • isGrayed

        public boolean isGrayed()
        This checkbox grayed state.
        Returns:
        true if grayed, false if not.
      • isEditable

        public boolean isEditable()
        Description copied from interface: IEditable
        Returns control editable state.
        Specified by:
        isEditable in interface IEditable
        Returns:
        true if control can be edited.
      • getBorderColor

        public org.eclipse.swt.graphics.Color getBorderColor()
        Returns checkbox border color.
        Returns:
        checkbox border color, can be null.
      • getBackgroundColor

        public org.eclipse.swt.graphics.Color getBackgroundColor()
        Returns checkbox background color.
        Returns:
        checkbox background color, can be null.
      • setText

        public void setText​(String text)
        Sets this checkbox text.
        Parameters:
        text - the text to set.
      • setChecked

        public void setChecked​(boolean checked)
        Sets the check state of this checkbox.
        Parameters:
        checked - true if checked, false if unchecked.
      • setGrayed

        public void setGrayed​(boolean grayed)
        Sets the grayed state of this checkbox.
        Parameters:
        grayed - true if grayed, false if not.
      • setEditable

        public void setEditable​(boolean isEditable)
        Description copied from interface: IEditable
        Sets control editable state.
        Specified by:
        setEditable in interface IEditable
        Parameters:
        isEditable - - true if control can be edited.
      • setBorderColor

        public void setBorderColor​(org.eclipse.swt.graphics.Color borderColor)
        Sets the border color.
        Parameters:
        borderColor - the new border color.
      • setBackgroundColor

        public void setBackgroundColor​(org.eclipse.swt.graphics.Color backgroundColor)
        Sets the background color.
        Parameters:
        backgroundColor - the new background color.
      • addStateChangedListener

        public void addStateChangedListener​(IChangedListener<LightCheckbox,​Boolean> listener)
        Adds the state changed listener.
        Parameters:
        listener - the listener to add.
      • removeStateChangedListener

        public void removeStateChangedListener​(IChangedListener<LightCheckbox,​Boolean> listener)
        Removes the state changed listener.
        Parameters:
        listener - the listener to remove.
      • 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
        Parameters:
        gc - the GC to paint on.
        rectangle - the rectangle to paint.
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.graphics.GC gc,
                                                          int width,
                                                          int height,
                                                          boolean flushCache)
        Description copied from interface: ILightControl
        Computes the size of this control.
        Specified by:
        computeSize in interface ILightControl
        Overrides:
        computeSize in class AbstractLightControl
        Parameters:
        gc - the GC to do measurements with.
        width - the width hint, SWT.DEFAULT to compute the preferred width.
        height - the height hint, SWT.DEFAULT to compute the preferred height.
        flushCache - the flush cache flag, instructs the associated layout to reset all its caches, if any.
        Returns:
        the computed size.
      • getCheckImage

        protected org.eclipse.swt.graphics.Image getCheckImage()
        Returns image to use when checkbox is checked.
        Returns:
        the image to use when checkbox is checked, cannot be null
      • getDisabledCheckImage

        protected org.eclipse.swt.graphics.Image getDisabledCheckImage()
        Returns image to use when checkbox is checked and disabled.
        Returns:
        the image to use when checkbox is checked and disabled, cannot be null
      • getGrayedImage

        protected org.eclipse.swt.graphics.Image getGrayedImage()
        Returns image to use when checkbox is grayed.
        Returns:
        the image to use when checkbox is grayed, cannot be null
      • getDisabledGrayedImage

        protected org.eclipse.swt.graphics.Image getDisabledGrayedImage()
        Returns image to use when checkbox is grayed and disabled.
        Returns:
        the image to use when checkbox is grayed and disabled, cannot be null