From 5dc0a97de27d03c4c9b4ab4bbb5b2b8740284da6 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 7 Aug 2017 13:55:13 -0700 Subject: [PATCH] Add a list of functions to the controller. --- .../java/org/nwapw/abacus/fx/AbacusController.java | 12 ++++++++++++ src/main/resources/abacus.fxml | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/src/main/java/org/nwapw/abacus/fx/AbacusController.java b/src/main/java/org/nwapw/abacus/fx/AbacusController.java index 2bdb5ef..f513529 100644 --- a/src/main/java/org/nwapw/abacus/fx/AbacusController.java +++ b/src/main/java/org/nwapw/abacus/fx/AbacusController.java @@ -72,6 +72,8 @@ public class AbacusController implements PluginListener { @FXML private Tab settingsTab; @FXML + private Tab functionListTab; + @FXML private TableView historyTable; @FXML private TableColumn inputColumn; @@ -93,6 +95,8 @@ public class AbacusController implements PluginListener { private ListView enabledPluginView; @FXML private TextField computationLimitField; + @FXML + private ListView functionListView; /** * The list of history entries, created by the users. @@ -110,6 +114,10 @@ public class AbacusController implements PluginListener { * and, when reloaded, get added to the plugin manager's black list. */ private ObservableList enabledPlugins; + /** + * The list of functions that are registered in the calculator. + */ + private ObservableList functionList; /** * The abacus instance used for changing the plugin configuration. @@ -213,6 +221,8 @@ public class AbacusController implements PluginListener { } }); + functionList = FXCollections.observableArrayList(); + functionListView.setItems(functionList); historyData = FXCollections.observableArrayList(); historyTable.setItems(historyData); numberImplementationOptions = FXCollections.observableArrayList(); @@ -327,10 +337,12 @@ public class AbacusController implements PluginListener { plugin.enabledProperty().addListener(e -> changesMade = true); enabledPlugins.add(plugin); } + functionList.addAll(manager.getAllFunctions()); } @Override public void onUnload(PluginManager manager) { + functionList.clear(); enabledPlugins.clear(); numberImplementationOptions.clear(); } diff --git a/src/main/resources/abacus.fxml b/src/main/resources/abacus.fxml index 495187c..547e485 100644 --- a/src/main/resources/abacus.fxml +++ b/src/main/resources/abacus.fxml @@ -60,6 +60,14 @@ + + + + + + + +