= project.getComponent(CheckStylePlugin.class);
if (checkStylePlugin == null) {
throw new IllegalStateException("Couldn't get checkstyle plugin");
}
final ProjectRootManager projectRootManager
= ProjectRootManager.getInstance(project);
final VirtualFile[] sourceRoots
= projectRootManager.getContentSourceRoots();
// disable if no files are selected
if (sourceRoots == null || sourceRoots.length == 0) {
presentation.setEnabled(false);