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