diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java b/app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java index f143e33172a..7472c62479b 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java @@ -47,9 +47,17 @@ public class ContributionIndexTableModel private final List contributions = new ArrayList<>(); private final String[] columnNames = { "Description" }; private final Class[] columnTypes = { ContributedPlatform.class }; + private Predicate filter; + private String[] filters; public void updateIndexFilter(String[] filters, Predicate 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 ContributedPlatform getSelectedRelease(int row) { } public void update() { + updateContributions(); fireTableDataChanged(); } diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributionManagerUI.java b/app/src/cc/arduino/contributions/packages/ui/ContributionManagerUI.java index 48fbca5d889..0c949fe1cd3 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributionManagerUI.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributionManagerUI.java @@ -144,6 +144,10 @@ public void onUpdatePressed() { .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 void onInstallPressed(final ContributedPlatform platformToInstall, } 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 void onRemovePressed(final ContributedPlatform platform, 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 {