IDEA-62859 "Reformat code"/"Optimize imports" aplies on whole project if dialog is disabled.

Added control flow branching for 'reformat' action in case of various target types (file vs directory)
This commit is contained in:
Denis Zhdanov
2010-12-13 13:02:03 +03:00
parent e7cb7f66ce
commit f74b19410c
@@ -168,7 +168,12 @@ public class ReformatCodeAction extends AnAction implements DumbAware {
}
if (optimizeImports && range == null) {
new ReformatAndOptimizeImportsProcessor(project, file).run();
if (file != null || dir == null) {
new ReformatAndOptimizeImportsProcessor(project, file).run();
}
else {
new ReformatAndOptimizeImportsProcessor(project, dir, true).run();
}
}
else {
new ReformatCodeProcessor(project, file, range).run();