1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-06-30 06:40:58 -07: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 c9e0d4f8d3
commit 7a0863380a
2 changed files with 20 additions and 0 deletions

View File

@ -72,6 +72,8 @@ public class AbacusController implements PluginListener {
@FXML @FXML
private Tab settingsTab; private Tab settingsTab;
@FXML @FXML
private Tab functionListTab;
@FXML
private TableView<HistoryModel> historyTable; private TableView<HistoryModel> historyTable;
@FXML @FXML
private TableColumn<HistoryModel, String> inputColumn; private TableColumn<HistoryModel, String> inputColumn;
@ -93,6 +95,8 @@ public class AbacusController implements PluginListener {
private ListView<ToggleablePlugin> enabledPluginView; private ListView<ToggleablePlugin> enabledPluginView;
@FXML @FXML
private TextField computationLimitField; private TextField computationLimitField;
@FXML
private ListView<String> functionListView;
/** /**
* The list of history entries, created by the users. * 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. * and, when reloaded, get added to the plugin manager's black list.
*/ */
private ObservableList<ToggleablePlugin> enabledPlugins; 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. * 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(); historyData = FXCollections.observableArrayList();
historyTable.setItems(historyData); historyTable.setItems(historyData);
numberImplementationOptions = FXCollections.observableArrayList(); numberImplementationOptions = FXCollections.observableArrayList();
@ -327,10 +337,12 @@ public class AbacusController implements PluginListener {
plugin.enabledProperty().addListener(e -> changesMade = true); plugin.enabledProperty().addListener(e -> changesMade = true);
enabledPlugins.add(plugin); enabledPlugins.add(plugin);
} }
functionList.addAll(manager.getAllFunctions());
} }
@Override @Override
public void onUnload(PluginManager manager) { public void onUnload(PluginManager manager) {
functionList.clear();
enabledPlugins.clear(); enabledPlugins.clear();
numberImplementationOptions.clear(); numberImplementationOptions.clear();
} }

View File

@ -60,6 +60,14 @@
</FlowPane> </FlowPane>
</GridPane> </GridPane>
</Tab> </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> </TabPane>
</center> </center>