private String generateHTML(final RefEntity refEntity, final InspectionTool tool) { final StringBuffer buf = new StringBuffer(); if (refEntity instanceof RefElement) { final Runnable action = new Runnable() { @Override public void run() { tool.getComposer().compose(buf, refEntity); } }; ApplicationManager.getApplication().runReadAction(action); } else { tool.getComposer().compose(buf, refEntity); } uppercaseFirstLetter(buf); if (refEntity instanceof RefElement) { appendSuppressSection(buf); } insertHeaderFooter(buf); return buf.toString(); }