1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-11-17 16:09:32 -08:00

Add a list of functions to the controller.

This commit is contained in:
Danila Fedorin 2017-08-07 13:55:13 -07:00
parent 7c3aff7b97
commit 5dc0a97de2
2 changed files with 20 additions and 0 deletions

View File

@ -72,6 +72,8 @@ public class AbacusController implements PluginListener {
@FXML
private Tab settingsTab;
@FXML
private Tab functionListTab;
@FXML
private TableView<HistoryModel> historyTable;
@FXML
private TableColumn<HistoryModel, String> inputColumn;
@ -93,6 +95,8 @@ public class AbacusController implements PluginListener {
private ListView<ToggleablePlugin> enabledPluginView;
@FXML
private TextField computationLimitField;
@FXML
private ListView<String> 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<ToggleablePlugin> enabledPlugins;
/**
* The list of functions that are registered in the calculator.
*/
private ObservableList<String> 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();
}

View File

@ -60,6 +60,14 @@
</FlowPane>
</GridPane>
</Tab>
<Tab fx:id="functionListTab" text="Functions" closable="false">
<VBox>
<padding>
<Insets left="10" right="10" top="10" bottom="10"/>
</padding>
<ListView maxWidth="Infinity" fx:id="functionListView"/>
</VBox>
</Tab>
</TabPane>
</center>