if (workingModules.size() > 0) {
this.selectedModule = -1;
for (IPowerModule module : workingModules) {
ModuleSelectionSubFrame frame = getOrCreateCategory(module.getCategory());
ClickableModule moduleClickable = frame.addModule(module);
// Indicate installed modules
if (!module.isAllowed()) {
// If a disallowed module made it to the list, indicate
// it as disallowed
moduleClickable.setAllowed(false);
} else if (ModuleManager.itemHasModule(selectedItem.getItem(), module.getDataName())) {
moduleClickable.setInstalled(true);
}
if (moduleClickable.getModule().equals(this.prevSelection)) {
this.selectedModule = moduleButtons.size();
}
moduleButtons.add(moduleClickable);
}
}