Package ui.repl
Class TableManager
- java.lang.Object
-
- ui.repl.TableManager
-
final class TableManager extends java.lang.ObjectThe TableManager class is used manage the TableView representing the Symbols contained within the SymbolTable.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTableManager.SymbolElementThe SymbolElement class is used store Symbols as rows within a TableView
-
Constructor Summary
Constructors Constructor Description TableManager(javafx.scene.control.TableView<TableManager.SymbolElement> table, SymbolTable symbolTable)Constructs a TableManager object for storing a TableView and SymbolTable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(javafx.scene.control.TableColumn<TableManager.SymbolElement,java.lang.String> column, java.lang.String fieldName)Adds a column to be displayed in the table.voidclear()Clears the TableView, removing all TableColumn objects.voidrefresh()Refreshes the table to reflect the contents of the SymbolTable.
-
-
-
Constructor Detail
-
TableManager
public TableManager(javafx.scene.control.TableView<TableManager.SymbolElement> table, SymbolTable symbolTable)
Constructs a TableManager object for storing a TableView and SymbolTable.The TableView is used to store each SymbolElement object as rows, whilst the SymbolTable is used to retrieve the Symbols.
- Parameters:
table- The TableView for storing the SymbolssymbolTable- The SymbolTable for retrieving the Symbols
-
-
Method Detail
-
addColumn
public void addColumn(javafx.scene.control.TableColumn<TableManager.SymbolElement,java.lang.String> column, java.lang.String fieldName)
Adds a column to be displayed in the table.Each TableColumn must accept a SymbolElement and a String, and also provide a name for the column.
- Parameters:
column- A TableColumn The TableColumn to be added to the tablefieldName- The name of the column
-
refresh
public void refresh()
Refreshes the table to reflect the contents of the SymbolTable.This method is called every time the SymbolTable is updated in some way, whether a Symbol is added, removed, or updated.
-
clear
public void clear()
Clears the TableView, removing all TableColumn objects.
-
-