for (int i = 0; i < files.length; i++) {
File f = files[i];
log.info("Reading file: " + f);
PanelProvider p = null;
try {
p = loadPanelProvider(f);
p.initialize();
} catch (Exception e) {
log.error("Error loading panel from file " + f, e);
}
if (p != null) {
panels.put(p.getId(), p);
} else {
log.error("File format is not valid: " + f);
}
}
DirectoriesScanner scannerHelp = new DirectoriesScanner("phelp");
File[] helpFiles = scannerHelp.findFiles(fdir);
for (int i = 0; i < helpFiles.length; i++) {
File helpFile = helpFiles[i];
PanelHelp pHelp = null;
try {
pHelp = loadHelpFile(helpFile);
} catch (IOException e) {
log.error("Error loading help file:", e);
} catch (SAXException e) {
log.error("Error loading help file:", e);
}
if (pHelp != null) {
String[] ids = pHelp.getIds();
for (int j = 0; j < ids.length; j++) {
String id = ids[j];
PanelProvider provider = getProvider(id);
if (provider != null) {
provider.setPanelHelp(pHelp);
} else {
log.error("Invalid panel provider id " + id + " in help file: " + helpFile);
}
}
} else {