mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-22 07:20:09 -08:00
Rescan the plugins folder.
This commit is contained in:
parent
b99ad5a09a
commit
5e3daaed43
|
@ -255,13 +255,7 @@ public class AbacusController implements PluginListener {
|
|||
abacus = new Abacus(new Configuration(CONFIG_FILE));
|
||||
PluginManager abacusPluginManager = abacus.getPluginManager();
|
||||
abacusPluginManager.addListener(this);
|
||||
abacusPluginManager.addInstantiated(new StandardPlugin(abacus.getPluginManager()));
|
||||
try {
|
||||
ClassFinder.loadJars("plugins").forEach(abacusPluginManager::addClass);
|
||||
} catch (IOException | ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
abacusPluginManager.reload();
|
||||
performScan();
|
||||
|
||||
computationLimitField.setText(Double.toString(abacus.getConfiguration().getComputationDelay()));
|
||||
computationLimitField.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||
|
@ -311,6 +305,19 @@ public class AbacusController implements PluginListener {
|
|||
reloadAlertShown = false;
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void performScan(){
|
||||
PluginManager abacusPluginManager = abacus.getPluginManager();
|
||||
abacusPluginManager.removeAll();
|
||||
abacusPluginManager.addInstantiated(new StandardPlugin(abacus.getPluginManager()));
|
||||
try {
|
||||
ClassFinder.loadJars("plugins").forEach(abacusPluginManager::addClass);
|
||||
} catch (IOException | ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
abacusPluginManager.reload();
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void performReload() {
|
||||
alertIfApplyNeeded(true);
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
<Button text="Apply" onAction="#performSave"/>
|
||||
<Button text="Reload Plugins" onAction="#performReload"/>
|
||||
<Button text="Apply and Reload" onAction="#performSaveAndReload"/>
|
||||
<Button text="Scan Plugins" onAction="#performScan"/>
|
||||
</FlowPane>
|
||||
</GridPane>
|
||||
</Tab>
|
||||
|
|
Loading…
Reference in New Issue
Block a user