Class TableProperties<T,V,E extends Table<V>>

java.lang.Object
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.TableProperties<T,V,E>
Type Parameters:
T - the type of the container holding table data
V - the type of elements displayed in the table
E - the type of the Table component
Direct Known Subclasses:
EmfTableProperties

public class TableProperties<T,V,E extends Table<V>> extends Object
A builder class for configuring properties of SWT Table controls. Provides methods to set various table properties including data extraction, styling, dimensions. Note: This class is not intended to be used directly by end users. It serves as a base configuration class for internal framework components.
Author:
Ionov Ivan
  • Field Details

    • elementsExtractor

      protected Function<T,List<V>> elementsExtractor
    • style

      protected int style
    • checkBox

      protected boolean checkBox
    • virtual

      protected boolean virtual
    • syncUpdate

      protected boolean syncUpdate
  • Constructor Details

    • TableProperties

      public TableProperties()
  • Method Details

    • getColumns

      public Consumer<E> getColumns()
      Returns the column configuration consumer for the table.
      Returns:
      a Consumer that configures table columns
    • columns

      public TableProperties<T,V,?> columns(Consumer<E> createrColumns)
      Sets the column configuration consumer for the table.
      Parameters:
      createrColumns - a Consumer that configures table columns
      Returns:
      this TableProperties instance for method chaining
    • getHeight

      public int getHeight()
      Returns the custom height setting for the table.
      Returns:
      the height in pixels, or -1 for default height
    • height

      public TableProperties<T,V,?> height(int height)
      Sets a custom height for the table.
      Parameters:
      height - the height in pixels, or -1 for default height
      Returns:
      this TableProperties instance for method chaining
    • getDefaultHeight

      public int getDefaultHeight()
      Returns the default height for the table, adjusted for display scaling.
      Returns:
      the scaled default height in pixels
    • getWidth

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

      public TableProperties<T,V,?> width(int width)
      Sets a custom width for the table.
      Parameters:
      width - the width in pixels, or -1 for default width
      Returns:
      this TableProperties instance for method chaining
    • getElementsExtractor

      public Function<T,List<V>> getElementsExtractor()
      Returns the function that extracts table elements from a container.
      Returns:
      a Function that extracts List from a container of type T
    • elementsExtractor

      public TableProperties<T,V,?> elementsExtractor(Function<T,List<V>> elementsExtractor)
      Sets the function that extracts table elements from a container.
      Parameters:
      elementsExtractor - a Function that extracts List from a container of type T
      Returns:
      this TableProperties instance for method chaining
    • getStyle

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

      public TableProperties<T,V,?> style(int style)
      Sets the SWT style bits for the table.
      Parameters:
      style - the SWT style bits to apply
      Returns:
      this TableProperties instance for method chaining
    • isCheckBox

      public boolean isCheckBox()
      Returns whether the table should display checkboxes.
      Returns:
      true if checkboxes should be displayed, false otherwise
    • checkBox

      public TableProperties<T,V,?> checkBox(boolean checkBox)
      Sets whether the table should display checkboxes.
      Parameters:
      checkBox - true to display checkboxes, false otherwise
      Returns:
      this TableProperties instance for method chaining
    • isVirtual

      public boolean isVirtual()
      Returns whether the table should use virtual rendering.
      Returns:
      true if virtual rendering is enabled, false otherwise
    • virtual

      public TableProperties<T,V,?> virtual(boolean virtual)
      Sets whether the table should use virtual rendering.
      Parameters:
      virtual - true to enable virtual rendering, false otherwise
      Returns:
      this TableProperties instance for method chaining
    • isSyncUpdate

      public boolean isSyncUpdate()
      Returns whether the table should use synchronous updates.
      Returns:
      true if synchronous updates are enabled, false otherwise
    • syncUpdate

      public TableProperties<T,V,?> syncUpdate(boolean syncUpdate)
      Sets whether the table should use synchronous updates.
      Parameters:
      syncUpdate - true to enable synchronous updates, false otherwise
      Returns:
      this TableProperties instance for method chaining