java.lang.Object
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.ToolTipProperties

public class ToolTipProperties extends Object
A builder-style class for configuring tooltip properties including dimensions and content elements. This class follows the fluent interface pattern to allow method chaining for convenient configuration.

Example usage:

 ToolTipProperties properties = ToolTipProperties.newInstance()
     .height(300)
     .width(600)
     .elements(
                HTML.header("Main header", 1),
                        HTML.header("Second header", 2),
                        HTML.textBlock("Text block"),
                        HTML.textBlock( HTML.linkOpenInBrowser("Text link", link)),
                        HTML.image(Image, "Name image")
     );
 
Author:
Ionov Ivan
See Also:
  • Constructor Details

    • ToolTipProperties

      public ToolTipProperties()
  • Method Details

    • newInstance

      public static ToolTipProperties newInstance()
      Creates and returns a new instance of ToolTipProperties with default values. Default values are: height = 200, wight = 500, and an empty elements list.
      Returns:
      a new ToolTipProperties instance with default configuration
    • getHeight

      public int getHeight()
      Returns the current height of the tooltip in pixels.
      Returns:
      the tooltip height in pixels
    • height

      public ToolTipProperties height(int height)
      Sets the height of the tooltip and returns this instance for method chaining.
      Parameters:
      height - the desired tooltip height in pixels
      Returns:
      this ToolTipProperties instance for method chaining
    • getWidth

      public int getWidth()
      Returns the current width of the tooltip in pixels.
      Returns:
      the tooltip width in pixels
    • width

      public ToolTipProperties width(int width)
      Sets the width of the tooltip and returns this instance for method chaining.
      Parameters:
      width - the desired tooltip width in pixels
      Returns:
      this ToolTipProperties instance for method chaining
    • elements

      public ToolTipProperties elements(HTMLConvertable... elements)
      Adds one or more HTMLConvertable elements to the tooltip content and returns this instance for method chaining. The elements will be displayed in the order they are provided.
      Parameters:
      elements - the HTMLConvertable elements to add to the tooltip
      Returns:
      this ToolTipProperties instance for method chaining
      See Also:
    • getElements

      public List<HTMLConvertable> getElements()
      Returns an unmodifiable list of all HTMLConvertable elements currently configured for this tooltip.
      Returns:
      a list of HTMLConvertable elements in the tooltip
      See Also:
    • getBackgroundColor

      public Color getBackgroundColor()
      Returns the background color of the tooltip.
      Returns:
      the current background color, or null if not set
    • backgroundColor

      public ToolTipProperties backgroundColor(Color backgroundColor)
      Sets the background color of the tooltip.
      Parameters:
      backgroundColor - the background color to set
      Returns:
      this ToolTipProperties instance to allow for method chaining
    • getForegroundColor

      public Color getForegroundColor()
      Returns the foreground (text) color of the tooltip.
      Returns:
      the current foreground color, or null if not set
    • foregroundColor

      public ToolTipProperties foregroundColor(Color foregroundColor)
      Sets the foreground (text) color of the tooltip.
      Parameters:
      foregroundColor - the foreground color to set
      Returns:
      this ToolTipProperties instance to allow for method chaining
    • getFont

      public org.eclipse.swt.graphics.Font getFont()
      Returns the font used for the tooltip text.
      Returns:
      the current font, or null if not set
    • font

      public ToolTipProperties font(org.eclipse.swt.graphics.Font font)
      Sets the font for the tooltip text.
      Parameters:
      font - the font to use for the tooltip text
      Returns:
      this ToolTipProperties instance to allow for method chaining
    • getFontWeight

      public String getFontWeight()
      Returns the font weight of the tooltip text.
      Returns:
      the current font weight as a string (e.g., "normal", "bold"), or null if not set
    • fontWeight

      public ToolTipProperties fontWeight(String fontWeight)
      Sets the font weight for the tooltip text.
      Parameters:
      fontWeight - the font weight to set (e.g., "normal", "bold", "lighter", "bolder")
      Returns:
      this ToolTipProperties instance to allow for method chaining
    • getLineHeight

      public double getLineHeight()
    • lineHeight

      public ToolTipProperties lineHeight(double lineHeight)