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 TypeMethodDescriptionvoidcheckBox(boolean checkBox) Sets whether the table should display checkboxes.voidSets the column configuration consumer for the table.voidelementsExtractor(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.voidheight(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.voidstyle(int style) Sets the SWT style bits for the table.voidsyncUpdate(boolean syncUpdate) Sets whether the table should use synchronous updates.voidvirtual(boolean virtual) Sets whether the table should use virtual rendering.voidwidth(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
-
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
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
-
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
-