Merge branch 'liana/edu'
authorliana.bakradze <liana.bakradze@jetbrains.com>
Mon, 14 Mar 2016 11:59:30 +0000 (14:59 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Mon, 14 Mar 2016 11:59:30 +0000 (14:59 +0300)
# Conflicts:
# python/educational-core/student/src/com/jetbrains/edu/learning/StudyProjectComponent.java
# python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyCheckAction.java

15 files changed:
1  2 
python/educational-core/student/resources/META-INF/plugin.xml
python/educational-core/student/src/com/jetbrains/edu/learning/StudyProjectComponent.java
python/educational-core/student/src/com/jetbrains/edu/learning/StudyUtils.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyNextStudyTaskAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyNextWindowAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyPrevWindowAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyPreviousStudyTaskAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyRefreshTaskFileAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyShowHintAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyTaskNavigationAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyWindowNavigationAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java
python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyToolWindowFactory.java
python/educational-python/student-python/resources/META-INF/plugin.xml
python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyCheckAction.java

index 6a5747fa526e0d11dbcd85ab4a11a2431f262920,c14b74c4c3a62f807b00349b0ee57a05c1e19401..9b0d2aea6a8c0ceafca3a42764924525747c6864
@@@ -25,16 -25,15 +25,16 @@@ import com.intellij.openapi.wm.ToolWind
  import com.intellij.openapi.wm.ToolWindowAnchor;
  import com.intellij.openapi.wm.ToolWindowManager;
  import com.intellij.util.containers.hash.HashMap;
- import com.jetbrains.edu.EduNames;
- import com.jetbrains.edu.EduUtils;
- import com.jetbrains.edu.courseFormat.Course;
- import com.jetbrains.edu.courseFormat.Lesson;
- import com.jetbrains.edu.courseFormat.Task;
- import com.jetbrains.edu.courseFormat.TaskFile;
- import com.jetbrains.edu.learning.actions.StudyToolbarAction;
+ import com.jetbrains.edu.learning.core.EduNames;
+ import com.jetbrains.edu.learning.core.EduUtils;
+ import com.jetbrains.edu.learning.courseFormat.Course;
+ import com.jetbrains.edu.learning.courseFormat.Lesson;
+ import com.jetbrains.edu.learning.courseFormat.Task;
+ import com.jetbrains.edu.learning.courseFormat.TaskFile;
+ import com.jetbrains.edu.learning.actions.*;
  import com.jetbrains.edu.learning.editor.StudyEditorFactoryListener;
  import com.jetbrains.edu.learning.ui.StudyProgressToolWindowFactory;
 +import com.jetbrains.edu.learning.ui.StudyToolWindow;
  import com.jetbrains.edu.learning.ui.StudyToolWindowFactory;
  import javafx.application.Platform;
  import org.jetbrains.annotations.NotNull;
index 880830fabcd6a32272e2737b52df31f7bf737f2c,0cd803e5a763e3f92cf2fa9e7bf17236bebab218..50be6069aa361bed9148259c6c05b7cce03c5c7e
@@@ -4,11 -4,11 +4,11 @@@ import com.intellij.openapi.actionSyste
  import com.intellij.openapi.editor.Editor;
  import com.intellij.openapi.editor.LogicalPosition;
  import com.intellij.openapi.fileEditor.FileDocumentManager;
 -import com.intellij.openapi.project.DumbAwareAction;
 +import com.intellij.openapi.project.DumbAware;
  import com.intellij.openapi.project.Project;
  import com.intellij.openapi.vfs.VirtualFile;
- import com.jetbrains.edu.courseFormat.AnswerPlaceholder;
- import com.jetbrains.edu.courseFormat.TaskFile;
+ import com.jetbrains.edu.learning.courseFormat.AnswerPlaceholder;
+ import com.jetbrains.edu.learning.courseFormat.TaskFile;
  import com.jetbrains.edu.learning.StudyUtils;
  import com.jetbrains.edu.learning.navigation.StudyNavigator;
  import org.jetbrains.annotations.NotNull;
index f898b7bc8bc34dbea1fcf6cb70d36c11de3d9564,0ea7f7c30dcd497103a2a7373414efb527d6f1fd..db026cea6bade69ce3ef2c401943fd3803f3ff85
@@@ -7,9 -7,10 +7,9 @@@ import com.intellij.openapi.wm.ToolWind
  import com.intellij.openapi.wm.ToolWindowFactory;
  import com.intellij.ui.content.Content;
  import com.intellij.ui.content.ContentManager;
- import com.jetbrains.edu.courseFormat.Course;
+ import com.jetbrains.edu.learning.courseFormat.Course;
  import com.jetbrains.edu.learning.StudyProjectComponent;
  import com.jetbrains.edu.learning.StudyTaskManager;
 -import com.jetbrains.edu.learning.StudyUtils;
  import icons.InteractiveLearningIcons;
  import org.jetbrains.annotations.NotNull;
  
index 9ce243e6aa5c43c622083c35995e9861eab77d9a,95f8b9a3b2433c6b1ffc976b3db534973a7aa6e6..b1320a50abcb29f2edd74847506e22199a228ffd
@@@ -8,56 -5,30 +8,55 @@@ import com.intellij.openapi.actionSyste
  import com.intellij.openapi.application.ApplicationManager;
  import com.intellij.openapi.command.CommandProcessor;
  import com.intellij.openapi.diagnostic.Logger;
 +import com.intellij.openapi.keymap.KeymapUtil;
  import com.intellij.openapi.progress.ProgressManager;
 +import com.intellij.openapi.project.DumbService;
  import com.intellij.openapi.project.Project;
  import com.intellij.openapi.ui.MessageType;
 +import com.intellij.openapi.util.Ref;
  import com.intellij.openapi.vfs.VirtualFile;
  import com.intellij.openapi.wm.IdeFocusManager;
- import com.jetbrains.edu.courseFormat.StudyStatus;
- import com.jetbrains.edu.courseFormat.Task;
- import com.jetbrains.edu.courseFormat.TaskFile;
+ import com.jetbrains.edu.learning.courseFormat.StudyStatus;
+ import com.jetbrains.edu.learning.courseFormat.Task;
+ import com.jetbrains.edu.learning.courseFormat.TaskFile;
+ import com.jetbrains.edu.learning.actions.StudyCheckAction;
  import com.jetbrains.edu.learning.actions.StudyRunAction;
- import com.jetbrains.edu.learning.actions.StudyToolbarAction;
  import com.jetbrains.edu.learning.checker.StudyCheckTask;
  import com.jetbrains.edu.learning.checker.StudyCheckUtils;
- import com.jetbrains.edu.learning.checker.StudyTestRunner;
  import com.jetbrains.edu.learning.checker.StudyTestsOutputParser;
  import com.jetbrains.edu.learning.editor.StudyEditor;
 -import com.jetbrains.edu.learning.checker.StudyTestRunner;
 +import icons.InteractiveLearningIcons;
  import org.jetbrains.annotations.NotNull;
  import org.jetbrains.annotations.Nullable;
  
 +import javax.swing.*;
  import java.util.Map;
  
 -public class PyStudyCheckAction extends StudyCheckAction {
 +public class PyStudyCheckAction extends StudyToolbarAction {
    private static final Logger LOG = Logger.getInstance(PyStudyCheckAction.class);
  
 +  public static final String ACTION_ID = "PyCheckAction";
 +  public static final String SHORTCUT = "ctrl alt pressed ENTER";
 +
 +  protected Ref<Boolean> myCheckInProgress = new Ref<>(false);
 +
 +  public PyStudyCheckAction() {
 +    super("Check Task (" + KeymapUtil.getShortcutText(new KeyboardShortcut(KeyStroke.getKeyStroke(SHORTCUT), null)) + ")", "Check current task", InteractiveLearningIcons.Resolve);
 +  }
 +
    @Override
-   
 +  public void actionPerformed(@NotNull AnActionEvent e) {
 +    Project project = e.getProject();
 +    if (project == null) {
 +      return;
 +    }
 +    if (DumbService.isDumb(project)) {
 +      StudyCheckUtils.showTestResultPopUp("Checking is not available while indexing is in progress", MessageType.WARNING.getPopupBackground(), project);
 +      return;
 +    }
 +    check(project);
 +  }
++
    protected void check(@NotNull Project project) {
      ApplicationManager.getApplication().runWriteAction(() -> {
        CommandProcessor.getInstance().runUndoTransparentAction(() -> {