1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-02 13:24:12 +01:00

[Lib manager] Fix only member being rendered incorrectly if filter active and update/install

This commit is contained in:
Martino Facchin 2018-07-18 14:27:30 +02:00
parent b1b609e610
commit 0ee0fcc018
2 changed files with 7 additions and 12 deletions

View File

@ -200,7 +200,7 @@ public class LibraryManagerUI extends InstallerJDialog<ContributedLibraryRelease
try { try {
setProgressVisible(true, ""); setProgressVisible(true, "");
installer.updateIndex(this::setProgress); installer.updateIndex(this::setProgress);
onIndexesUpdated(); //onIndexesUpdated();
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally { } finally {
@ -218,8 +218,10 @@ public class LibraryManagerUI extends InstallerJDialog<ContributedLibraryRelease
try { try {
setProgressVisible(true, tr("Installing...")); setProgressVisible(true, tr("Installing..."));
installer.install(lib, mayReplaced, this::setProgress); installer.install(lib, mayReplaced, this::setProgress);
onIndexesUpdated();
// TODO: Do a better job in refreshing only the needed element // TODO: Do a better job in refreshing only the needed element
if (contribTable.getCellEditor() != null) {
contribTable.getCellEditor().stopCellEditing();
}
((LibrariesIndexTableModel) contribModel).update(); ((LibrariesIndexTableModel) contribModel).update();
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -247,8 +249,10 @@ public class LibraryManagerUI extends InstallerJDialog<ContributedLibraryRelease
try { try {
setProgressVisible(true, tr("Removing...")); setProgressVisible(true, tr("Removing..."));
installer.remove(lib, this::setProgress); installer.remove(lib, this::setProgress);
onIndexesUpdated();
// TODO: Do a better job in refreshing only the needed element // TODO: Do a better job in refreshing only the needed element
if (contribTable.getCellEditor() != null) {
contribTable.getCellEditor().stopCellEditing();
}
((LibrariesIndexTableModel) contribModel).update(); ((LibrariesIndexTableModel) contribModel).update();
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -260,9 +264,4 @@ public class LibraryManagerUI extends InstallerJDialog<ContributedLibraryRelease
installerThread.setUncaughtExceptionHandler(new InstallerJDialogUncaughtExceptionHandler(this, noConnectionErrorMessage)); installerThread.setUncaughtExceptionHandler(new InstallerJDialogUncaughtExceptionHandler(this, noConnectionErrorMessage));
installerThread.start(); installerThread.start();
} }
protected void onIndexesUpdated() throws Exception {
// Empty
}
} }

View File

@ -127,10 +127,6 @@ public abstract class InstallerJDialog<T> extends JDialog {
contribTable.getCellEditor().stopCellEditing(); contribTable.getCellEditor().stopCellEditing();
} }
updateIndexFilter(filters, categoryFilter); updateIndexFilter(filters, categoryFilter);
if (contribModel.getRowCount() == 1) {
// TODO: understand why it doesn't work
//contribTable.addRowSelectionInterval(0, 0);
}
} }
}; };