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 dataV- the type of elements displayed in the tableE- the type of the Table component
- Direct Known Subclasses:
EmfTableProperties
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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected booleanprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTableProperties<T, V, ?> checkBox(boolean checkBox) Sets whether the table should display checkboxes.TableProperties<T, V, ?> Sets the column configuration consumer for the table.TableProperties<T, V, ?> elementsExtractor(Function<T, List<V>> elementsExtractor) Sets the function that extracts table elements from a container.Returns the column configuration consumer for the table.intReturns the default height for the table, adjusted for display scaling.Returns the function that extracts table elements from a container.intReturns the custom height setting for the table.intgetStyle()Returns the SWT style bits for the table.intgetWidth()Returns the custom width setting for the table.TableProperties<T, V, ?> height(int height) Sets a custom height for the table.booleanReturns whether the table should display checkboxes.booleanReturns whether the table should use synchronous updates.booleanReturns whether the table should use virtual rendering.TableProperties<T, V, ?> style(int style) Sets the SWT style bits for the table.TableProperties<T, V, ?> syncUpdate(boolean syncUpdate) Sets whether the table should use synchronous updates.TableProperties<T, V, ?> virtual(boolean virtual) Sets whether the table should use virtual rendering.TableProperties<T, V, ?> width(int width) Sets a custom width for the table.
-
Field Details
-
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
Returns the column configuration consumer for the table.- Returns:
- a Consumer that configures table columns
-
columns
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
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
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
Returns the function that extracts table elements from a container.- Returns:
- a Function that extracts List
from a container of type T
-
elementsExtractor
Sets the function that extracts table elements from a container.- Parameters:
elementsExtractor- a Function that extracts Listfrom 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
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
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
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
Sets whether the table should use synchronous updates.- Parameters:
syncUpdate- true to enable synchronous updates, false otherwise- Returns:
- this TableProperties instance for method chaining
-