From 06fb88cf8d0685fb1ecd39229e03f7c15873d5eb Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 5 Feb 2014 17:54:35 +0400 Subject: [PATCH 1/6] IDEA-120272 New Project wizard: java templates (JavaFX application, Command Line Application) are missing --- .../ide/projectWizard/ProjectCategory.java | 6 ---- .../ide/projectWizard/ProjectTypeStep.java | 11 +++++-- ...mplate.java => TemplateBasedCategory.java} | 29 +++++++++---------- .../templates/TemplateModuleBuilder.java | 5 ++++ .../intellij/platform/ProjectTemplateEP.java | 2 ++ .../src/META-INF/common-javaFX-plugin.xml | 2 +- 6 files changed, 31 insertions(+), 24 deletions(-) rename java/idea-ui/src/com/intellij/ide/projectWizard/{ProjectCategoryTemplate.java => TemplateBasedCategory.java} (60%) diff --git a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectCategory.java b/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectCategory.java index d5c9b09ce19b..43c2eeecaf7b 100644 --- a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectCategory.java +++ b/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectCategory.java @@ -20,7 +20,6 @@ import com.intellij.ide.util.projectWizard.ModuleBuilder; import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -55,11 +54,6 @@ public abstract class ProjectCategory { return createModuleBuilder().getGroupName(); } - @Nullable - public String getParentId() { - return null; - } - public FrameworkRole[] getAcceptableFrameworkRoles() { return new FrameworkRole[] {createModuleBuilder().getDefaultAcceptableRole()}; } diff --git a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTypeStep.java b/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTypeStep.java index 08e89781e0bf..f2eb01981d7a 100644 --- a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTypeStep.java +++ b/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTypeStep.java @@ -473,14 +473,21 @@ public class ProjectTypeStep extends ModuleWizardStep implements Disposable { Disposer.dispose(this); } - private static MultiMap loadLocalTemplates() { + private MultiMap loadLocalTemplates() { ConcurrentMultiMap map = new ConcurrentMultiMap(); ProjectTemplateEP[] extensions = ProjectTemplateEP.EP_NAME.getExtensions(); for (ProjectTemplateEP ep : extensions) { ClassLoader classLoader = ep.getLoaderForClass(); URL url = classLoader.getResource(ep.templatePath); if (url != null) { - map.putValue(ep.projectType, new LocalArchivedTemplate(url, classLoader)); + LocalArchivedTemplate template = new LocalArchivedTemplate(url, classLoader); + if (ep.category) { + TemplateBasedCategory category = new TemplateBasedCategory(template); + myTemplatesMap.putValue(new TemplatesGroup(category), template); + } + else { + map.putValue(ep.projectType, template); + } } } return map; diff --git a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectCategoryTemplate.java b/java/idea-ui/src/com/intellij/ide/projectWizard/TemplateBasedCategory.java similarity index 60% rename from java/idea-ui/src/com/intellij/ide/projectWizard/ProjectCategoryTemplate.java rename to java/idea-ui/src/com/intellij/ide/projectWizard/TemplateBasedCategory.java index b9d02ff997aa..6c0067399142 100644 --- a/java/idea-ui/src/com/intellij/ide/projectWizard/ProjectCategoryTemplate.java +++ b/java/idea-ui/src/com/intellij/ide/projectWizard/TemplateBasedCategory.java @@ -15,42 +15,41 @@ */ package com.intellij.ide.projectWizard; -import com.intellij.platform.templates.BuilderBasedTemplate; +import com.intellij.ide.util.projectWizard.ModuleBuilder; +import com.intellij.platform.templates.ArchivedProjectTemplate; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import javax.swing.*; /** * @author Dmitry Avdeev */ -public class ProjectCategoryTemplate extends BuilderBasedTemplate { +public class TemplateBasedCategory extends ProjectCategory { - private final ProjectCategory myCategory; + private final ArchivedProjectTemplate myTemplate; - public ProjectCategoryTemplate(ProjectCategory category) { - super(category.createModuleBuilder()); - myCategory = category; + public TemplateBasedCategory(ArchivedProjectTemplate template) { + myTemplate = template; } - @NotNull @Override - public String getName() { - return myCategory.getDisplayName(); + public String getDisplayName() { + return myTemplate.getName(); } @Override public Icon getIcon() { - return myCategory.getIcon(); + return myTemplate.getIcon(); } - @Nullable @Override public String getDescription() { - return myCategory.getDescription(); + return myTemplate.getDescription(); } - public ProjectCategory getCategory() { - return myCategory; + @NotNull + @Override + public ModuleBuilder createModuleBuilder() { + return myTemplate.createModuleBuilder(); } } diff --git a/java/idea-ui/src/com/intellij/platform/templates/TemplateModuleBuilder.java b/java/idea-ui/src/com/intellij/platform/templates/TemplateModuleBuilder.java index 33932001f671..5ddafe07443e 100644 --- a/java/idea-ui/src/com/intellij/platform/templates/TemplateModuleBuilder.java +++ b/java/idea-ui/src/com/intellij/platform/templates/TemplateModuleBuilder.java @@ -154,6 +154,11 @@ public class TemplateModuleBuilder extends ModuleBuilder { return myTemplate.getIcon(); } + @Override + public boolean isTemplateBased() { + return true; + } + @NotNull @Override public Module createModule(@NotNull ModifiableModuleModel moduleModel) diff --git a/platform/platform-impl/src/com/intellij/platform/ProjectTemplateEP.java b/platform/platform-impl/src/com/intellij/platform/ProjectTemplateEP.java index b91a09bf336f..314cd74ce871 100644 --- a/platform/platform-impl/src/com/intellij/platform/ProjectTemplateEP.java +++ b/platform/platform-impl/src/com/intellij/platform/ProjectTemplateEP.java @@ -33,4 +33,6 @@ public class ProjectTemplateEP extends AbstractExtensionPointBean { @Attribute("templatePath") public String templatePath; + @Attribute("category") + public boolean category; } diff --git a/plugins/javaFX/src/META-INF/common-javaFX-plugin.xml b/plugins/javaFX/src/META-INF/common-javaFX-plugin.xml index ffb957bff742..cdc1397b5aac 100644 --- a/plugins/javaFX/src/META-INF/common-javaFX-plugin.xml +++ b/plugins/javaFX/src/META-INF/common-javaFX-plugin.xml @@ -51,7 +51,7 @@ - + From bd2fcae8c9ad0bb508a727be8c43b04ffb44126d Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Wed, 5 Feb 2014 18:01:47 +0400 Subject: [PATCH 2/6] CR-IA-226 ImportFilter: make targetFile parameter not null --- .../codeInsight/daemon/impl/quickfix/ImportClassFixBase.java | 2 +- .../src/com/intellij/codeInsight/ImportFilter.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFixBase.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFixBase.java index 957893ffe680..8047486d93ba 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFixBase.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ImportClassFixBase.java @@ -121,7 +121,7 @@ public abstract class ImportClassFixBase EP_NAME = new ExtensionPointName("com.intellij.importFilter"); - public abstract boolean shouldUseFullyQualifiedName(@Nullable PsiFile targetFile, @NotNull String classQualifiedName); + public abstract boolean shouldUseFullyQualifiedName(@NotNull PsiFile targetFile, @NotNull String classQualifiedName); - public static boolean shouldImport(@Nullable PsiFile targetFile, @NotNull String classQualifiedName) { + public static boolean shouldImport(@NotNull PsiFile targetFile, @NotNull String classQualifiedName) { for (ImportFilter filter : EP_NAME.getExtensions()) { if (filter.shouldUseFullyQualifiedName(targetFile, classQualifiedName)) { return false; From 61e3b94bd0e27fec6df6396d6abd97ddebbc4d21 Mon Sep 17 00:00:00 2001 From: "Vladislav.Soroka" Date: Wed, 5 Feb 2014 18:09:33 +0400 Subject: [PATCH 3/6] IDEA-120343 Gradle: custom title for gradle files in editors --- plugins/gradle/src/META-INF/plugin.xml | 1 + .../util/GradleEditorTabTitleProvider.java | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleEditorTabTitleProvider.java diff --git a/plugins/gradle/src/META-INF/plugin.xml b/plugins/gradle/src/META-INF/plugin.xml index 5b349a5b580a..287091125f4d 100644 --- a/plugins/gradle/src/META-INF/plugin.xml +++ b/plugins/gradle/src/META-INF/plugin.xml @@ -63,6 +63,7 @@ key="gradle.name" bundle="i18n.GradleBundle"/> + diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleEditorTabTitleProvider.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleEditorTabTitleProvider.java new file mode 100644 index 000000000000..635d43749382 --- /dev/null +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleEditorTabTitleProvider.java @@ -0,0 +1,43 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.plugins.gradle.util; + +import com.intellij.openapi.fileEditor.impl.EditorTabTitleProvider; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.vfs.VirtualFile; + +/** + * @author Vladislav.Soroka + * @since 2/5/14 + */ +public class GradleEditorTabTitleProvider implements EditorTabTitleProvider { + public String getEditorTabTitle(Project project, VirtualFile file) { + if (GradleConstants.EXTENSION.equals(file.getExtension()) && GradleConstants.DEFAULT_SCRIPT_NAME.equals(file.getName())) { + for (Module module : ModuleManager.getInstance(project).getModules()) { + if (module.isDisposed()) return null; + + final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); + for (VirtualFile virtualFile : moduleRootManager.getContentRoots()) { + if (virtualFile == file.getParent()) return module.getName(); + } + } + } + return null; + } +} From 86b18ce74871a44d30cdc7dcf91d9c7f046370f1 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 5 Feb 2014 18:13:55 +0400 Subject: [PATCH 4/6] IDEA-120272 New Project wizard: java templates (JavaFX application, Command Line Application) are missing --- resources/src/META-INF/IdeaPlugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml index 665130ce8443..5649dc0639ea 100644 --- a/resources/src/META-INF/IdeaPlugin.xml +++ b/resources/src/META-INF/IdeaPlugin.xml @@ -1470,7 +1470,7 @@ - + From 7d228d5b3267994b447d673ef2ba9ea0a4bf6e03 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Wed, 5 Feb 2014 15:52:22 +0100 Subject: [PATCH 5/6] warn when only difference is @Override annotation --- .../RedundantMethodOverrideInspection.java | 57 +++++++++++++--- .../siyeh/ig/psiutils/EquivalenceChecker.java | 68 +------------------ .../RedundantMethodOverride.java | 31 +++++++++ ...RedundantMethodOverrideInspectionTest.java | 31 +++++++++ 4 files changed, 109 insertions(+), 78 deletions(-) create mode 100644 plugins/InspectionGadgets/test/com/siyeh/igtest/inheritance/redundant_method_override/RedundantMethodOverride.java create mode 100644 plugins/InspectionGadgets/testsrc/com/siyeh/ig/inheritance/RedundantMethodOverrideInspectionTest.java diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/RedundantMethodOverrideInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/RedundantMethodOverrideInspection.java index 46ef38b26697..9694d347aff8 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/RedundantMethodOverrideInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/RedundantMethodOverrideInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Bas Leijdekkers + * Copyright 2005-2014 Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,8 @@ import com.siyeh.ig.psiutils.EquivalenceChecker; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.*; + public class RedundantMethodOverrideInspection extends BaseInspection { @Override @@ -107,19 +109,11 @@ public class RedundantMethodOverrideInspection extends BaseInspection { if (superBody == null) { return; } - final PsiModifierList superModifierList = - superMethod.getModifierList(); - final PsiModifierList modifierList = method.getModifierList(); - if (!EquivalenceChecker.modifierListsAreEquivalent( - modifierList, superModifierList)) { + if (!modifierListsAreEquivalent(method.getModifierList(), superMethod.getModifierList())) { return; } final PsiType superReturnType = superMethod.getReturnType(); - if (superReturnType == null) { - return; - } - final PsiType returnType = method.getReturnType(); - if (!superReturnType.equals(returnType)) { + if (superReturnType == null || !superReturnType.equals(method.getReturnType())) { return; } if (!EquivalenceChecker.codeBlocksAreEquivalent(body, superBody)) { @@ -127,5 +121,46 @@ public class RedundantMethodOverrideInspection extends BaseInspection { } registerMethodError(method); } + + private static boolean modifierListsAreEquivalent(@Nullable PsiModifierList list1, @Nullable PsiModifierList list2) { + if (list1 == null) { + return list2 == null; + } + else if (list2 == null) { + return false; + } + final Set annotations1 = new HashSet(); + for (PsiAnnotation annotation : list1.getAnnotations()) { + annotations1.add(annotation.getQualifiedName()); + } + final Set annotations2 = new HashSet(); + for (PsiAnnotation annotation : list2.getAnnotations()) { + annotations2.add(annotation.getQualifiedName()); + } + final Set uniques = disjunction(annotations1, annotations2); + uniques.remove(CommonClassNames.JAVA_LANG_OVERRIDE); + if (!uniques.isEmpty()) { + return false; + } + return list1.hasModifierProperty(PsiModifier.STRICTFP) == list2.hasModifierProperty(PsiModifier.STRICTFP) && + list1.hasModifierProperty(PsiModifier.SYNCHRONIZED) == list2.hasModifierProperty(PsiModifier.SYNCHRONIZED) && + list1.hasModifierProperty(PsiModifier.PUBLIC) == list2.hasModifierProperty(PsiModifier.PUBLIC) && + list1.hasModifierProperty(PsiModifier.PROTECTED) == list2.hasModifierProperty(PsiModifier.PROTECTED); + } + + private static Set disjunction(Collection set1, Collection set2) { + final Set result = new HashSet(); + for (T t : set1) { + if (!set2.contains(t)) { + result.add(t); + } + } + for (T t : set2) { + if (!set1.contains(t)) { + result.add(t); + } + } + return result; + } } } \ No newline at end of file diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/EquivalenceChecker.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/EquivalenceChecker.java index 9ece6a3e212e..e6f88ab42457 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/EquivalenceChecker.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/EquivalenceChecker.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers + * Copyright 2003-2014 Dave Griffith, Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,72 +27,6 @@ public class EquivalenceChecker { private EquivalenceChecker() {} - public static boolean modifierListsAreEquivalent( - @Nullable PsiModifierList list1, @Nullable PsiModifierList list2) { - if (list1 == null) { - return list2 == null; - } - else if (list2 == null) { - return false; - } - final PsiAnnotation[] annotations = list1.getAnnotations(); - for (PsiAnnotation annotation : annotations) { - final String qualifiedName = annotation.getQualifiedName(); - if (qualifiedName == null) { - return false; - } - if (list2.findAnnotation(qualifiedName) == null) { - return false; - } - } - if (list1.hasModifierProperty(PsiModifier.ABSTRACT) && - !list2.hasModifierProperty(PsiModifier.ABSTRACT)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.FINAL) && - !list2.hasModifierProperty(PsiModifier.FINAL)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.NATIVE) && - !list2.hasModifierProperty(PsiModifier.NATIVE)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.PACKAGE_LOCAL) && - !list2.hasModifierProperty(PsiModifier.PACKAGE_LOCAL)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.PRIVATE) && - !list2.hasModifierProperty(PsiModifier.PRIVATE)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.PROTECTED) && - !list2.hasModifierProperty(PsiModifier.PROTECTED)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.PUBLIC) && - !list2.hasModifierProperty(PsiModifier.PUBLIC)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.STATIC) && - !list2.hasModifierProperty(PsiModifier.STATIC)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.STRICTFP) && - !list2.hasModifierProperty(PsiModifier.STRICTFP)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.SYNCHRONIZED) && - !list2.hasModifierProperty(PsiModifier.SYNCHRONIZED)) { - return false; - } - if (list1.hasModifierProperty(PsiModifier.TRANSIENT) && - !list2.hasModifierProperty(PsiModifier.TRANSIENT)) { - return false; - } - return !(list1.hasModifierProperty(PsiModifier.VOLATILE) && - !list2.hasModifierProperty(PsiModifier.VOLATILE)); - } - public static boolean statementsAreEquivalent(@Nullable PsiStatement statement1, @Nullable PsiStatement statement2) { if (statement1 == null) { return statement2 == null; diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/inheritance/redundant_method_override/RedundantMethodOverride.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/inheritance/redundant_method_override/RedundantMethodOverride.java new file mode 100644 index 000000000000..797cab3c9f13 --- /dev/null +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/inheritance/redundant_method_override/RedundantMethodOverride.java @@ -0,0 +1,31 @@ +package redundant_method_override; + +public class RedundantMethodOverride extends S { + + @Override + void foo() { + System.out.println(); + } + + void bar() { + System.out.println(); + } + + public void m() { + System.out.println(); + } +} +class S { + + void foo() { + System.out.println(); + } + + synchronized void bar() { + System.out.println(); + } + + void m() { + System.out.println(); + } +} \ No newline at end of file diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/inheritance/RedundantMethodOverrideInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/inheritance/RedundantMethodOverrideInspectionTest.java new file mode 100644 index 000000000000..47b1d9f63560 --- /dev/null +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/inheritance/RedundantMethodOverrideInspectionTest.java @@ -0,0 +1,31 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.siyeh.ig.inheritance; + +import com.intellij.codeInspection.InspectionProfileEntry; +import com.siyeh.ig.LightInspectionTestCase; + +/** + * @author Bas Leijdekkers + */ +public class RedundantMethodOverrideInspectionTest extends LightInspectionTestCase { + @Override + protected InspectionProfileEntry getInspection() { + return new RedundantMethodOverrideInspection(); + } + + public void testRedundantMethodOverride() { doTest(); } +} From 1132b1954ca42f5d7f44d788dbea2afc1d31d9f1 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 5 Feb 2014 19:37:08 +0400 Subject: [PATCH 6/6] Use correct option for saving files on switching to terminal (IDEA-118846). --- .../src/org/jetbrains/plugins/terminal/JBTerminalPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/JBTerminalPanel.java b/plugins/terminal/src/org/jetbrains/plugins/terminal/JBTerminalPanel.java index 754f5661db5e..0c344441e967 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/JBTerminalPanel.java +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/JBTerminalPanel.java @@ -180,7 +180,7 @@ public class JBTerminalPanel extends TerminalPanel implements FocusListener, Ter @Override public void focusGained(FocusEvent event) { - if (GeneralSettings.getInstance().isAutoSaveIfInactive()) { + if (GeneralSettings.getInstance().isSaveOnFrameDeactivation()) { FileDocumentManager.getInstance().saveAllDocuments(); } }