Class ImageButtonControl<S extends ThemeSkin>

All Implemented Interfaces:
ILightControl, IReadOnlyControl, IRoundedRectangleControl, IViewControl<S>
Direct Known Subclasses:
CheckboxViewControl, RadioButtonViewControl, SwitcherViewControl

public class ImageButtonControl<S extends ThemeSkin> extends ImageControl<S>
  • Constructor Details

    • ImageButtonControl

      public ImageButtonControl(String imageId, String compactImageId, String disabledImageId, String compactDisabledImageId, String hotImageId, String compactHotImageId)
      Parameters:
      imageId - cannot be null.
      compactImageId -
      disabledImageId -
      compactDisabledImageId -
      hotImageId -
      compactHotImageId -
    • ImageButtonControl

      public ImageButtonControl(String imageId, String disabledImageId)
  • Method Details

    • setCompactMode

      public void setCompactMode(boolean compactMode)
    • isCompactMode

      public boolean isCompactMode()
    • getHighlightColor

      public org.eclipse.swt.graphics.Color getHighlightColor()
    • setHighlightColor

      public void setHighlightColor(org.eclipse.swt.graphics.Color highlightColor)
    • isUseHighlight

      public boolean isUseHighlight()
    • setUseHighlight

      public void setUseHighlight(boolean useHighlight)
    • getHotImage

      public org.eclipse.swt.graphics.Image getHotImage()
    • setHotImage

      public void setHotImage(org.eclipse.swt.graphics.Image hotImage, org.eclipse.swt.graphics.Image compactHotImage)
    • setImage

      public void setImage(org.eclipse.swt.graphics.Image image)
      Description copied from class: ImageControl
      Sets the image to display.
      Overrides:
      setImage in class ImageControl<S extends ThemeSkin>
      Parameters:
      image - the new image.
    • getImage

      public org.eclipse.swt.graphics.Image getImage()
      Description copied from class: ImageControl
      Gets the displayed image.
      Overrides:
      getImage in class ImageControl<S extends ThemeSkin>
      Returns:
      the image or null if no image assigned.
    • getDisabledImage

      public org.eclipse.swt.graphics.Image getDisabledImage()
      Overrides:
      getDisabledImage in class ImageControl<S extends ThemeSkin>
      Returns:
      the disabledImage
    • setImage

      public void setImage(org.eclipse.swt.graphics.Image image, org.eclipse.swt.graphics.Image compactImage)
    • setDisabledImage

      public void setDisabledImage(org.eclipse.swt.graphics.Image disabledImage)
      Description copied from class: ImageControl
      Sets the disabled image.
      Overrides:
      setDisabledImage in class ImageControl<S extends ThemeSkin>
      Parameters:
      disabledImage - the new disabled image.
    • setDisabledImage

      public void setDisabledImage(org.eclipse.swt.graphics.Image disabledImage, org.eclipse.swt.graphics.Image compactDisabledImage)
    • dispose

      public void dispose()
      Specified by:
      dispose in interface ILightControl
      Overrides:
      dispose in class ImageControl<S extends ThemeSkin>
    • paint

      public void paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
      Specified by:
      paint in interface ILightControl
      Overrides:
      paint in class ImageControl<S extends ThemeSkin>
    • setTheme

      public void setTheme(IPresentationTheme theme, S skin)
      Specified by:
      setTheme in interface IViewControl<S extends ThemeSkin>
      Overrides:
      setTheme in class AbstractViewControl<S extends ThemeSkin>
    • handleEvent

      public void handleEvent(org.eclipse.swt.widgets.Event event)
      Specified by:
      handleEvent in interface ILightControl
      Overrides:
      handleEvent in class RectangleControl<S extends ThemeSkin>
    • isHot

      protected boolean isHot()
      Returns:
      true if the mouse pointer is under this control.
    • getPaintingImage

      protected org.eclipse.swt.graphics.Image getPaintingImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
      Description copied from class: ImageControl
      Invoked by ImageControl.paint(GC, Rectangle) method to obtain current image to draw.
      Overrides:
      getPaintingImage in class ImageControl<S extends ThemeSkin>
      Returns:
    • getImageRegistry

      protected org.eclipse.jface.resource.ImageRegistry getImageRegistry()