}
//TODO handle changes & removals here as well!!!
@Subscribe
public void packChange (PackChangeEvent evt) {
final PackChangeEvent event = evt;
SwingUtilities.invokeLater(new Runnable() {
public void run () {
if (event.getType() == PackChangeEvent.TYPE.ADD) {
boolean doneWork = false;
if (event.getPacks() != null) {
for (ModPack p : event.getPacks()) {
if (filterForTab(p)) {
addPack(p);
//TODO: fix
Logger.logInfo("Adding " + getPaneShortName() + " Pack: " + packPanels.size() + " (" + p.getName() + ")");
doneWork = true;
numberOfPacks++;
}
}
if (doneWork) {
if (!currentPacks.isEmpty()) {
updateDatas();
updatePacks();
} else {
updateDatas();
updatePacks();
}
loaded = true;
}
}
} else if (event.getType() == PackChangeEvent.TYPE.REMOVE) {
filterPacks();
}
}
});
}