EDU-659 Hide Course Creator action group for educational projects
[idea/community.git] / python / educational-core / course-creator / src / com / jetbrains / edu / coursecreator / CCUtils.java
index cc30ce5e77e16141ecb586a51cef412b1e29fccd..ba987b2b0b5871cf26d707000909204283eb1296 100644 (file)
@@ -4,6 +4,8 @@ import com.google.common.base.Predicate;
 import com.google.common.collect.Collections2;
 import com.intellij.ide.projectView.actions.MarkRootActionBase;
 import com.intellij.lang.Language;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.Presentation;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.module.Module;
@@ -245,4 +247,10 @@ public class CCUtils {
       });
     }
   }
+
+  public static void updateActionGroup(AnActionEvent e) {
+    Presentation presentation = e.getPresentation();
+    Project project = e.getProject();
+    presentation.setEnabledAndVisible(project != null && isCourseCreator(project));
+  }
 }