mirror of
https://github.com/DanilaFe/abacus
synced 2024-11-04 18:08:31 -08:00
Add a list of functions to the controller.
This commit is contained in:
parent
c9e0d4f8d3
commit
7a0863380a
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user