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:
parent
7c3aff7b97
commit
5dc0a97de2
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user