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

public class LabelProperties extends Object
A builder class for configuring properties of SWT Label controls. Provides fluent interface methods to set various label properties including text, dimensions, colors, fonts, images.
Author:
Ionov Ivan
  • Method Details

    • getWidth

      public int getWidth()
      Returns the width setting for the label.
      Returns:
      the width in pixels, or -1 for default width
    • width

      public LabelProperties width(int width)
      Sets the width of the label.
      Parameters:
      width - the width in pixels, or -1 for default width
      Returns:
      this LabelProperties instance for method chaining
    • getStyle

      public int getStyle()
      Returns the SWT style bits for the label.
      Returns:
      the SWT style bits
    • style

      public LabelProperties style(int style)
      Sets the SWT style bits for the label.
      Parameters:
      style - the SWT style bits to apply
      Returns:
      this LabelProperties instance for method chaining
    • getFont

      public org.eclipse.swt.graphics.Font getFont()
      Returns the font for the label.
      Returns:
      the font, or null if using default font
    • font

      public LabelProperties font(org.eclipse.swt.graphics.Font font)
      Sets the font for the label.
      Parameters:
      font - the font to use, or null for default font
      Returns:
      this LabelProperties instance for method chaining
    • getType

      public LabelProperties.LabelType getType()
      Returns the label type.
      Returns:
      the LabelType enum value
    • label

      public static LabelProperties label()
      Creates a standard label configuration.
      Returns:
      a new LabelProperties instance configured as a standard label
    • separator

      public static LabelProperties separator()
      Creates a separator line configuration.
      Returns:
      a new LabelProperties instance configured as a separator
    • fillLine

      public static LabelProperties fillLine()
      Creates a full-width label configuration.
      Returns:
      a new LabelProperties instance configured as a full-width label
    • getImage

      public org.eclipse.swt.graphics.Image getImage()
      Returns the image for image-type labels.
      Returns:
      the image, or null if no image is set
    • image

      public static LabelProperties image(org.eclipse.swt.graphics.Image image)
      Creates an image label configuration with the specified image.
      Parameters:
      image - the image to display
      Returns:
      a new LabelProperties instance configured as an image label
    • imageWithContainer

      public static LabelProperties imageWithContainer()
      Creates an image label with container configuration.
      Returns:
      a new LabelProperties instance configured as an image with container
    • copyFrom

      public void copyFrom(LabelProperties labelProperties)
      Copies properties from another LabelProperties instance.
      Parameters:
      labelProperties - the source properties to copy from
    • getText

      public Supplier<String> getText()
      Returns the text supplier for the label.
      Returns:
      a Supplier that provides the label text
    • text

      public LabelProperties text(Supplier<String> text)
      Sets a dynamic text supplier for the label.
      Parameters:
      text - a Supplier that provides the label text
      Returns:
      this LabelProperties instance for method chaining
    • text

      public LabelProperties text(String text)
      Sets static text for the label.
      Parameters:
      text - the static text to display
      Returns:
      this LabelProperties instance for method chaining
    • getHeight

      public int getHeight()
      Returns the height setting for the label.
      Returns:
      the height in pixels
    • height

      public LabelProperties height(int height)
      Sets the height of the label.
      Parameters:
      height - the height in pixels
      Returns:
      this LabelProperties instance for method chaining
    • getBackground

      public org.eclipse.swt.graphics.Color getBackground()
      Returns the background color for the label.
      Returns:
      the background color
    • background

      public LabelProperties background(org.eclipse.swt.graphics.Color background)
      Sets the background color for the label.
      Parameters:
      background - the background color to use
      Returns:
      this LabelProperties instance for method chaining
    • getForeground

      public org.eclipse.swt.graphics.Color getForeground()
      Returns the foreground color for the label.
      Returns:
      the foreground color
    • foreground

      public LabelProperties foreground(org.eclipse.swt.graphics.Color foreground)
      Sets the foreground color for the label.
      Parameters:
      foreground - the foreground color to use
      Returns:
      this LabelProperties instance for method chaining
    • getTooltip

      public Supplier<String> getTooltip()
      Returns the tooltip text for the label.
      Returns:
      the tooltip text, or null if no tooltip is set
    • tooltip

      public LabelProperties tooltip(String tooltip)
      Sets the tooltip text for the label.
      Parameters:
      tooltip - the tooltip text to display
      Returns:
      this LabelProperties instance for method chaining
    • tooltip

      public LabelProperties tooltip(Supplier<String> tooltip)
    • isSkipCalculatingWidth

      public boolean isSkipCalculatingWidth()
      Returns whether width calculation should be skipped for this label.
      Returns:
      true if width calculation should be skipped, false otherwise
    • skipCalculatingWidth

      public LabelProperties skipCalculatingWidth(boolean skipCalculatingWidth)
      Sets whether width calculation should be skipped for this label.
      Parameters:
      skipCalculatingWidth - true to skip width calculation, false to enable it
      Returns:
      this LabelProperties instance for method chaining
    • isEnable

      public boolean isEnable()
    • enable

      public LabelProperties enable(boolean enable)
    • tooltip

      public void tooltip(ToolTipProperties toolTipProperties)
    • getToolTipProperties

      public ToolTipProperties getToolTipProperties()