try {
// set progress bar
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final CheckStyleToolWindowPanel toolWindowPanel = toolWindowPanel();
if (toolWindowPanel != null) {
toolWindowPanel.displayInProgress(getFiles().size());
}
}
});
this.processFilesForModuleInfoAndScan();
// invoke Swing fun in Swing thread.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final CheckStyleToolWindowPanel toolWindowPanel = toolWindowPanel();
if (toolWindowPanel != null) {
switch (getConfigurationLocationStatus()) {
case NOT_PRESENT:
toolWindowPanel.displayWarningResult("plugin.results.no-rules-file");
break;
case BLACKLISTED:
toolWindowPanel.displayWarningResult("plugin.results.rules-blacklist");
break;
default:
toolWindowPanel.displayResults(getFileResults());
}
}
markThreadComplete();
}
});
} catch (final Throwable e) {
final CheckStylePluginException processedError = CheckStylePlugin.processError(
"An error occurred during a file scan.", e);
if (processedError != null) {
LOG.error("An error occurred while scanning a file.", processedError);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final CheckStyleToolWindowPanel toolWindowPanel = toolWindowPanel();
if (toolWindowPanel != null) {
toolWindowPanel.displayErrorResult(processedError);
}
markThreadComplete();
}
});
}