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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected Function<T,List<V>>
     
    protected int
     
    protected boolean
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkBox(boolean checkBox)
    Sets whether the table should display checkboxes.
    void
    columns(Consumer<E> createrColumns)
    Sets the column configuration consumer for the table.
    void
    elementsExtractor(Function<T,List<V>> elementsExtractor)
    Sets the function that extracts table elements from a container.
    Returns the column configuration consumer for the table.
    int
    Returns the default height for the table, adjusted for display scaling.
    Returns the function that extracts table elements from a container.
    int
    Returns the custom height setting for the table.
    int
    Returns the SWT style bits for the table.
    int
    Returns the custom width setting for the table.
    void
    height(int height)
    Sets a custom height for the table.
    boolean
    Returns whether the table should display checkboxes.
    boolean
    Returns whether the table should use synchronous updates.
    boolean
    Returns whether the table should use virtual rendering.
    void
    style(int style)
    Sets the SWT style bits for the table.
    void
    syncUpdate(boolean syncUpdate)
    Sets whether the table should use synchronous updates.
    void
    virtual(boolean virtual)
    Sets whether the table should use virtual rendering.
    void
    width(int width)
    Sets a custom width for the table.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 void columns(Consumer<E> createrColumns)
      Sets the column configuration consumer for the table.
      Parameters:
      createrColumns - a Consumer that configures table columns
    • getHeight

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

      public void height(int height)
      Sets a custom height for the table.
      Parameters:
      height - the height in pixels, or -1 for default height
    • 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 void width(int width)
      Sets a custom width for the table.
      Parameters:
      width - the width in pixels, or -1 for default width
    • 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 void 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
    • getStyle

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

      public void style(int style)
      Sets the SWT style bits for the table.
      Parameters:
      style - the SWT style bits to apply
    • isCheckBox

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

      public void checkBox(boolean checkBox)
      Sets whether the table should display checkboxes.
      Parameters:
      checkBox - true to display checkboxes, false otherwise
    • isVirtual

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

      public void virtual(boolean virtual)
      Sets whether the table should use virtual rendering.
      Parameters:
      virtual - true to enable virtual rendering, false otherwise
    • isSyncUpdate

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

      public void syncUpdate(boolean syncUpdate)
      Sets whether the table should use synchronous updates.
      Parameters:
      syncUpdate - true to enable synchronous updates, false otherwise