EDU-163 Move CreateCourseArchive action
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Tue, 14 Oct 2014 09:22:05 +0000 (13:22 +0400)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Tue, 14 Oct 2014 09:22:05 +0000 (13:22 +0400)
python/edu/course-creator/resources/META-INF/plugin.xml
python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/actions/CCCreateCourseArchive.java

index 59c2d2aec50de44a09fdc1d057f03fcda3ba5614..1a9b2e851b4c6badf2ebb41f659c534048f4759b 100644 (file)
@@ -67,6 +67,8 @@
     </action>
     <action id="PackCourse" class="org.jetbrains.plugins.coursecreator.actions.CCCreateCourseArchive">
       <add-to-group group-id="MainToolBar" anchor="last" />
+      <add-to-group group-id="ProjectViewPopupMenu" anchor="before" relative-to-action="CutCopyPasteGroup"/>
+      <add-to-group group-id="FileMenu" relative-to-action="FileMainSettingsGroup" anchor="before"/>
     </action>
     <action id="CCRunTests" class="org.jetbrains.plugins.coursecreator.CCRunTests" text="Run tests" description="Run tests"/>
   </actions>
index 409e5eefb9ee306ae1ca2ccecec35c107ee01ade..28cd7f40ba897fb906eff6bd2926c02427f1a1c0 100644 (file)
@@ -53,11 +53,15 @@ public class CCCreateCourseArchive extends DumbAwareAction {
   }
 
   @Override
-  public void actionPerformed(AnActionEvent e) {
+  public void actionPerformed(@NotNull AnActionEvent e) {
     final Project project = e.getData(CommonDataKeys.PROJECT);
     if (project == null) {
       return;
     }
+    createCourseArchive(project);
+  }
+
+  public void createCourseArchive(final Project project) {
     final CCProjectService service = CCProjectService.getInstance(project);
     final Course course = service.getCourse();
     if (course == null) return;
@@ -212,6 +216,7 @@ public class CCCreateCourseArchive extends DumbAwareAction {
     }
   }
 
+  @SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
   private static void generateJson(@NotNull final Project project) {
     final CCProjectService service = CCProjectService.getInstance(project);
     final Course course = service.getCourse();