mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-31 20:52:13 +01:00
Boards Manager: update UI after an install/remove
This commit is contained in:
parent
1361bce6bc
commit
a81772afc6
@ -47,9 +47,17 @@ public class ContributionIndexTableModel
|
||||
private final List<ContributedPlatformReleases> contributions = new ArrayList<>();
|
||||
private final String[] columnNames = { "Description" };
|
||||
private final Class<?>[] columnTypes = { ContributedPlatform.class };
|
||||
private Predicate<ContributedPlatform> filter;
|
||||
private String[] filters;
|
||||
|
||||
public void updateIndexFilter(String[] filters,
|
||||
Predicate<ContributedPlatform> filter) {
|
||||
this.filter = filter;
|
||||
this.filters = filters;
|
||||
updateContributions();
|
||||
}
|
||||
|
||||
private void updateContributions() {
|
||||
contributions.clear();
|
||||
for (ContributedPackage pack : BaseNoGui.indexer.getPackages()) {
|
||||
for (ContributedPlatform platform : pack.getPlatforms()) {
|
||||
@ -146,6 +154,7 @@ public class ContributionIndexTableModel
|
||||
}
|
||||
|
||||
public void update() {
|
||||
updateContributions();
|
||||
fireTableDataChanged();
|
||||
}
|
||||
|
||||
|
@ -144,6 +144,10 @@ public class ContributionManagerUI extends InstallerJDialog {
|
||||
.updateIndex(this::setProgress);
|
||||
installer.deleteUnknownFiles(downloadedPackageIndexFiles);
|
||||
onIndexesUpdated();
|
||||
if (contribTable.getCellEditor() != null) {
|
||||
contribTable.getCellEditor().stopCellEditing();
|
||||
}
|
||||
getContribModel().update();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
@ -169,6 +173,10 @@ public class ContributionManagerUI extends InstallerJDialog {
|
||||
}
|
||||
errors.addAll(installer.install(platformToInstall, this::setProgress));
|
||||
onIndexesUpdated();
|
||||
if (contribTable.getCellEditor() != null) {
|
||||
contribTable.getCellEditor().stopCellEditing();
|
||||
}
|
||||
getContribModel().update();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
@ -207,6 +215,10 @@ public class ContributionManagerUI extends InstallerJDialog {
|
||||
setProgressVisible(true, tr("Removing..."));
|
||||
installer.remove(platform);
|
||||
onIndexesUpdated();
|
||||
if (contribTable.getCellEditor() != null) {
|
||||
contribTable.getCellEditor().stopCellEditing();
|
||||
}
|
||||
getContribModel().update();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
|
Loading…
x
Reference in New Issue
Block a user