Package swingtree.api.model
Class BasicTableModel.Builder<E>
java.lang.Object
swingtree.api.model.BasicTableModel.Builder<E>
- Type Parameters:
- E- Common type for all entry items in the table.
- All Implemented Interfaces:
- Buildable<BasicTableModel>
- Enclosing interface:
- BasicTableModel
The class below is a functional builder for creating a lambda based implementation of the 
BasicTableModel.
  This allows fo a boilerplate free functional API.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Use this to build theBasicTableModelinstance.colClass(BasicTableModel.ColumnClass<E> columnClass) Accepts a lambda which allows theJTableto determine the class of the column at a given index.colClasses(Class<? extends E>... classes) Use this to define a fixed array of column classes.colCount(BasicTableModel.ColumnCount columnCount) Use this to define the lambda which dynamically determines the column count of the table model.colName(BasicTableModel.ColumnName columnName) Use this to define the lambda which allows theJTableto determine the name of the column at a given index.Use this to define a fixed array of column names.getsEntryAt(BasicTableModel.EntryGetter<E> entryGetter) Accepts a lambda allowing theJTableto dynamically determines the value at a given row and column.isEditableIf(BasicTableModel.CellEditable cellEditable) Accepts a lambda allowing theJTableto determine if the cell at a given row and column is editable.rowCount(BasicTableModel.RowCount rowCount) Use this to define the lambda which dynamically determines the row count of the table model.setsEntryAt(BasicTableModel.EntrySetter<E> entrySetter) Accepts a lambda allowing lambda which allows the user of theJTableto set the value at a given row and column.updateOn(sprouts.Observable updateEvent) Use this to define the event which will be fired when the table model is updated.
- 
Constructor Details- 
Builder
 
- 
- 
Method Details- 
rowCountUse this to define the lambda which dynamically determines the row count of the table model.- Parameters:
- rowCount- The lambda which will be used to determine the row count of the table model.
- Returns:
- This builder instance.
 
- 
colCountUse this to define the lambda which dynamically determines the column count of the table model.- Parameters:
- columnCount- The lambda which will be used to determine the column count of the table model.
- Returns:
- This builder instance.
 
- 
getsEntryAtAccepts a lambda allowing theJTableto dynamically determines the value at a given row and column.- Parameters:
- entryGetter- The lambda which will be used to determine the value at a given row and column.
- Returns:
- This builder instance.
 
- 
setsEntryAtAccepts a lambda allowing lambda which allows the user of theJTableto set the value at a given row and column.- Parameters:
- entrySetter- The lambda which will be used to set the value at a given row and column.
- Returns:
- This builder instance.
 
- 
colClassAccepts a lambda which allows theJTableto determine the class of the column at a given index.- Parameters:
- columnClass- The lambda which will be used to determine the class of the column at a given index.
- Returns:
- This builder instance.
 
- 
colClassesUse this to define a fixed array of column classes.- Parameters:
- classes- An array of column classes.
- Returns:
- This builder instance.
 
- 
isEditableIfAccepts a lambda allowing theJTableto determine if the cell at a given row and column is editable.- Parameters:
- cellEditable- The lambda which will be used to determine if the cell at a given row and column is editable.
- Returns:
- This builder instance.
 
- 
colNameUse this to define the lambda which allows theJTableto determine the name of the column at a given index.- Parameters:
- columnName- The lambda which will be used to determine the name of the column at a given index.
- Returns:
- This builder instance.
 
- 
colNamesUse this to define a fixed array of column names.- Parameters:
- names- An array of column names.
- Returns:
- This builder instance.
 
- 
updateOnUse this to define the event which will be fired when the table model is updated.- Parameters:
- updateEvent- The event which will be fired when the table model is updated.
- Returns:
- This builder instance.
 
- 
buildUse this to build theBasicTableModelinstance.- Specified by:
- buildin interface- Buildable<E>
- Returns:
- The BasicTableModelinstance.
 
 
-