Class LightPopup


  • public class LightPopup
    extends Object
    Provides pop-up window to host the light controls in it.
    • Constructor Summary

      Constructors 
      Constructor Description
      LightPopup​(ILightControl source)
      Instantiates a new light pop-up.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes this pop-up.
      void closeAsync()
      Closes the popup asynchronously to prevent traversal event propagation (SWT bug workaround)
      boolean isFocused()  
      boolean isVisible()
      Checks if this pop-up is visible or not.
      void pack​(boolean horizontal, boolean vertical)
      Adapts the popup size to its content.
      void revealRectangle​(org.eclipse.swt.graphics.Rectangle rectangle)
      Reveals the given rectangle in this pop-up.
      void scrollVertically​(int delta)
      Scrolls this pop-up vertically by the given delta.
      void setBackgroundColor​(org.eclipse.swt.graphics.Color backgroundColor)
      Sets the background color of this pop-up.
      void setBorderColor​(org.eclipse.swt.graphics.Color borderColor)
      Sets the border color of this pop-up.
      void show​(ILightControl control, int maxHeight, org.eclipse.swt.graphics.Rectangle initialVisibleRectangle)
      Shows the pop-up for the given control.
      void show​(ILightControl control, int maxHeight, org.eclipse.swt.graphics.Rectangle initialVisibleRectangle, boolean setFocus)
      Shows the pop-up for the given control.
    • Constructor Detail

      • LightPopup

        public LightPopup​(ILightControl source)
        Instantiates a new light pop-up.
        Parameters:
        source - the control to which the popup will be attached
    • Method Detail

      • show

        public void show​(ILightControl control,
                         int maxHeight,
                         org.eclipse.swt.graphics.Rectangle initialVisibleRectangle)
        Shows the pop-up for the given control.
        Parameters:
        control - the control to display inside the pop-up
        maxHeight - the maximum pop-up height
        initialVisibleRectangle - initial visible rectangle of this pop-up, may be null for default visible rectangle
      • show

        public void show​(ILightControl control,
                         int maxHeight,
                         org.eclipse.swt.graphics.Rectangle initialVisibleRectangle,
                         boolean setFocus)
        Shows the pop-up for the given control.
        Parameters:
        control - the control to display inside the pop-up
        maxHeight - the maximum pop-up height
        initialVisibleRectangle - initial visible rectangle of this pop-up, may be null for default visible rectangle
        setFocus - - true if popup should be focused.
      • pack

        public void pack​(boolean horizontal,
                         boolean vertical)
        Adapts the popup size to its content.
        Parameters:
        horizontal - NOT SUPPORTED yet
        vertical - if true, the height of the popup will be recalculated
      • close

        public void close()
        Closes this pop-up.
      • closeAsync

        public void closeAsync()
        Closes the popup asynchronously to prevent traversal event propagation (SWT bug workaround)
      • setBackgroundColor

        public void setBackgroundColor​(org.eclipse.swt.graphics.Color backgroundColor)
        Sets the background color of this pop-up.
        Parameters:
        backgroundColor - the new background color.
      • setBorderColor

        public void setBorderColor​(org.eclipse.swt.graphics.Color borderColor)
        Sets the border color of this pop-up.
        Parameters:
        borderColor - the new border color.
      • isVisible

        public boolean isVisible()
        Checks if this pop-up is visible or not.
        Returns:
        true if this pop-up is visible, false if not.
      • scrollVertically

        public void scrollVertically​(int delta)
        Scrolls this pop-up vertically by the given delta.
        Parameters:
        delta - the delta to scroll by.
      • revealRectangle

        public void revealRectangle​(org.eclipse.swt.graphics.Rectangle rectangle)
        Reveals the given rectangle in this pop-up.
        Parameters:
        rectangle - the rectangle to reveal.
      • isFocused

        public boolean isFocused()
        Returns:
        true if the popup is focused