import be.nikiroo.utils.compat.ListCellRenderer6;
import be.nikiroo.utils.ui.DelayWorker;
import be.nikiroo.utils.ui.ListModel;
+import be.nikiroo.utils.ui.ListSnapshot;
import be.nikiroo.utils.ui.ListModel.Predicate;
import be.nikiroo.utils.ui.ListenerPanel;
+import be.nikiroo.utils.ui.TreeSnapshot;
import be.nikiroo.utils.ui.UIUtils;
public class BooksPanel extends ListenerPanel {
}.execute();
}
- public void loadData(final BookInfo.Type type, final String value) {
+ // TODO
+ private void loadData(final BookInfo.Type type, final String value) {
synchronized (lastLoad) {
lastLoad[0] = "type";
lastLoad[1] = type;
// TODO todo todo
}
- public void loadData(List<BookInfo> bookInfos) {
- synchronized (lastLoad) {
- lastLoad[0] = "bookinfos";
- lastLoad[1] = bookInfos;
- }
+ // TODO
+ private void loadData(List<BookInfo> bookInfos) {
+ // synchronized (lastLoad) {
+ // lastLoad[0] = "bookInfos";
+ // lastLoad[1] = bookInfos;
+ // }
data.clearItems();
data.addAllItems(bookInfos);
return; // nothing was loaded yet
}
+ ListSnapshot snapshot = new ListSnapshot(list);
+
if (lastLoad[0].toString().equals("sources, authors, tags")) {
loadData((List<String>) lastLoad[1], (List<String>) lastLoad[2],
(List<String>) lastLoad[3]);
Instance.getInstance().getTraceHandler()
.error("Unknown last load type: " + lastLoad[0]);
}
+
+ snapshot.apply();
}
// is UI!
addSeparator();
add(createMenuItemExport());
if (status.isWritable()) {
+ // TODO: create a dedicated method to refresh those lists
+ // TODO: call it when adding/removing things
+ // TODO: call it deferred so not to slow startup
add(createMenuItemMoveTo());
add(createMenuItemSetCoverForSource());
add(createMenuItemSetCoverForAuthor());