inspection settings: change set as global to copy as global appcode/163.5705 pycharm/163.5706
authorDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Tue, 4 Oct 2016 18:51:58 +0000 (21:51 +0300)
committerDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Tue, 4 Oct 2016 18:57:38 +0000 (21:57 +0300)
platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java
platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/ManageButton.java
platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/ManageButtonBuilder.java

index 1ec12114154baf9d661814fa2ca8b5cbb2658ba8..fc8ff4abd3e9c22a0289aff7c477af2c15f6b550 100644 (file)
@@ -245,22 +245,12 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable
       }
 
       @Override
-      public void moveToProject() {
+      public void copyToAnotherLevel() {
         final SingleInspectionProfilePanel selectedPanel = getSelectedPanel();
         LOG.assertTrue(selectedPanel != null, "No settings selectedPanel for: " + getSelectedObject());
         copyToNewProfile(getSelectedObject(), getProject(), false, true);
       }
 
-      @Override
-      public void setAsGlobal() {
-        final SingleInspectionProfilePanel selectedPanel = getSelectedPanel();
-        LOG.assertTrue(selectedPanel != null, "No settings selectedPanel for: " + getSelectedObject());
-        selectedPanel.getProfile().setProjectLevel(false);
-        myProfiles.getProfilesComboBox().resort();
-        myProfiles.invalidate();
-        myProfiles.repaint();
-      }
-
       @Override
       public void copy() {
         rename(copyToNewProfile(getSelectedObject(), getProject(), true, false));
index 0252a1cce426e31b8ad0e25ef6ee7c3836dc99a5..4693b308bafe1ff70e76cbbada103b38a944bdb6 100644 (file)
@@ -70,18 +70,13 @@ public class ManageButton extends ComboBoxAction implements DumbAware {
     @Override
     public void update(AnActionEvent e) {
       final boolean isProjectLevel = myBuilder.isProjectLevel();
-      e.getPresentation().setText(isProjectLevel ? "Set as Global" : "Copy to Project");
+      e.getPresentation().setText(isProjectLevel ? "Copy as Global" : "Copy to Project");
       e.getPresentation().setEnabled(myBuilder.canChangeProfileLevel());
     }
 
     @Override
     public void actionPerformed(AnActionEvent e) {
-      if (myBuilder.isProjectLevel()) {
-        myBuilder.setAsGlobal();
-      }
-      else {
-        myBuilder.moveToProject();
-      }
+      myBuilder.copyToAnotherLevel();
     }
   }
 
index 567836c05886552e270cccca1d4d26d7b6d6cdb9..d0c482450ee778157c11276da825bc37cf012f10 100644 (file)
@@ -23,9 +23,7 @@ public interface ManageButtonBuilder {
 
   boolean canChangeProfileLevel();
 
-  void moveToProject();
-
-  void setAsGlobal();
+  void copyToAnotherLevel();
 
   void copy();