rename (fix for IDEA-CR-14348)
authorLiana.Bakradze <liana.bakradze@jetbrains.com>
Wed, 26 Oct 2016 17:05:42 +0000 (20:05 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Thu, 17 Nov 2016 14:08:35 +0000 (17:08 +0300)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCHideFromStudent.java
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/placeholder/CCAddAnswerPlaceholder.java
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/placeholder/CCChangePlaceholderVisibility.java
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/placeholder/CCDeleteAllAnswerPlaceholdersAction.java
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/placeholder/CCSubtaskPlaceholderAction.java
python/educational-core/course-creator/testSrc/com/jetbrains/edu/coursecreator/CCTestCase.java
python/educational-core/student/src/com/jetbrains/edu/learning/StudyUtils.java
python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyRefreshTaskFileAction.java
python/educational-core/student/src/com/jetbrains/edu/learning/checker/StudyCheckUtils.java
python/educational-core/student/src/com/jetbrains/edu/learning/core/EduUtils.java
python/educational-core/student/src/com/jetbrains/edu/learning/editor/StudyEditorFactoryListener.java

index 8d3100240063c2266e93f76cdd8511b7f69a6848..b183eeda7b38c533460d988f429fa6eab2ca0bf9 100644 (file)
@@ -64,7 +64,7 @@ public class CCHideFromStudent extends CCTaskFileActionBase {
         for (FileEditor fileEditor : FileEditorManager.getInstance(myProject).getEditors(myFile)) {
           if (fileEditor instanceof TextEditor) {
             Editor editor = ((TextEditor)fileEditor).getEditor();
-            StudyUtils.drawAllWindows(editor, myTaskFile);
+            StudyUtils.drawAllAnswerPlaceholders(editor, myTaskFile);
           }
         }
       }
index d36c5983a03f9b831ad2b5a971b414fe4cc82a6f..b4ca4accdc8b2b1911e370f57f4a73c410705e27 100644 (file)
@@ -101,7 +101,7 @@ public class CCAddAnswerPlaceholder extends CCAnswerPlaceholderAction {
       if (answerPlaceholders.contains(myPlaceholder)) {
         answerPlaceholders.remove(myPlaceholder);
         myEditor.getMarkupModel().removeAllHighlighters();
-        StudyUtils.drawAllWindows(myEditor, myTaskFile);
+        StudyUtils.drawAllAnswerPlaceholders(myEditor, myTaskFile);
         EduAnswerPlaceholderPainter.createGuardedBlocks(myEditor, myTaskFile);
       }
     }
index e8a038bb4b6e433dafcdafaf2b58d0dafc3a4b39..9c56d0bd432c5555c87cf4b3ef1cc97cf451fd9f 100644 (file)
@@ -46,7 +46,7 @@ public abstract class CCChangePlaceholderVisibility extends CCAnswerPlaceholderA
     int length = isVisible() ? placeholder.getTaskText().length() : 0;
     placeholder.setLength(length);
     saveIndent(placeholder, state, !visible);
-    StudyUtils.drawAllWindows(state.getEditor(), state.getTaskFile());
+    StudyUtils.drawAllAnswerPlaceholders(state.getEditor(), state.getTaskFile());
   }
 
   private static void saveIndent(AnswerPlaceholder placeholder, CCState state, boolean visible) {
index 0fa8c6b2bcc201b711d897b7f80b0cbca018b613..7decdd46bd42fbea9b4f7963e135e26d6a2c30da 100644 (file)
@@ -65,7 +65,7 @@ public class CCDeleteAllAnswerPlaceholdersAction extends DumbAwareAction {
   private static void updateView(@NotNull final Editor editor,
                                  @NotNull final TaskFile taskFile) {
     editor.getMarkupModel().removeAllHighlighters();
-    StudyUtils.drawAllWindows(editor, taskFile);
+    StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
   }
 
   @Override
index 9604658154fd6453df0f100c8d90b68d64445fc6..77d6aa13ee8ee4f57af7086840835fff80ee7d34 100644 (file)
@@ -36,13 +36,13 @@ public abstract class CCSubtaskPlaceholderAction extends CCAnswerPlaceholderActi
       @Override
       public void undo() throws UnexpectedUndoException {
         undoAction(existingPlaceholder, subtaskIndex, info);
-        StudyUtils.drawAllWindows(editor, taskFile);
+        StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
       }
 
       @Override
       public void redo() throws UnexpectedUndoException {
         redoAction(existingPlaceholder, subtaskIndex, info);
-        StudyUtils.drawAllWindows(editor, taskFile);
+        StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
       }
     });
   }
index 0ee7e1d272427e84e5cab6bfd74773d47e4f0a3e..902a09ebc9f8ba4f309232b1dd6adbf6ceb7ae9a 100644 (file)
@@ -123,7 +123,7 @@ public abstract class CCTestCase extends CodeInsightFixtureTestCase {
       taskFile.addAnswerPlaceholder(placeholder);
     }
     taskFile.sortAnswerPlaceholders();
-    StudyUtils.drawAllWindows(myFixture.getEditor(), taskFile);
+    StudyUtils.drawAllAnswerPlaceholders(myFixture.getEditor(), taskFile);
     CCUtils.createResourceFile(file, StudyTaskManager.getInstance(getProject()).getCourse(), file.getParent());
     return file;
   }
index 2026a25e401fe23f4c0143d575d204071ce7bf62..9505f6d63eabb5c0b8fe244d6a3c586ab3c2a139 100644 (file)
@@ -348,7 +348,7 @@ public class StudyUtils {
     return null;
   }
 
-  public static void drawAllWindows(Editor editor, TaskFile taskFile) {
+  public static void drawAllAnswerPlaceholders(Editor editor, TaskFile taskFile) {
     editor.getMarkupModel().removeAllHighlighters();
     final Project project = editor.getProject();
     if (project == null) return;
index 1949b84bb6b296a88fe3cfd0dd24d738f6eeaede..08bd1056b968ce36d9da92fe51060a857e61246a 100644 (file)
@@ -74,7 +74,7 @@ public class StudyRefreshTaskFileAction extends StudyActionWithShortcut {
     }
     WolfTheProblemSolver.getInstance(project).clearProblems(studyState.getVirtualFile());
     taskFile.setHighlightErrors(false);
-    StudyUtils.drawAllWindows(editor, taskFile);
+    StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
     EduAnswerPlaceholderPainter.createGuardedBlocks(editor, taskFile);
     ApplicationManager.getApplication().invokeLater(
       () -> IdeFocusManager.getInstance(project).requestFocus(editor.getContentComponent(), true));
index 5569e2fd2e898f258c2842c3b948bbb7256b554a..2f5ac54c64a018881d572a6c3f42c0a244a525ab 100644 (file)
@@ -59,7 +59,7 @@ public class StudyCheckUtils {
       FileEditor fileEditor = FileEditorManager.getInstance(project).getSelectedEditor(virtualFile);
       if (fileEditor instanceof StudyEditor) {
         StudyEditor studyEditor = (StudyEditor)fileEditor;
-        StudyUtils.drawAllWindows(studyEditor.getEditor(), taskFile);
+        StudyUtils.drawAllAnswerPlaceholders(studyEditor.getEditor(), taskFile);
       }
     }
   }
index 64b5572fbfe12a04b62184dc915969250341dba3..499b25f1349283f6c69d155e1b48b12eb8419571 100644 (file)
@@ -141,7 +141,7 @@ public class EduUtils {
                                                               VirtualFile answerFile,
                                                               VirtualFile parentDir,
                                                               @Nullable Task task,
-                                                              int toSubtaskIndex) {
+                                                              int targetSubtaskIndex) {
 
     VirtualFile studentFile = copyFile(requestor, parentDir, answerFile);
     if (studentFile == null) {
@@ -167,10 +167,10 @@ public class EduUtils {
     taskFile.setTrackLengths(false);
     for (AnswerPlaceholder placeholder : taskFile.getAnswerPlaceholders()) {
       int fromSubtask = task.getActiveSubtaskIndex();
-      placeholder.switchSubtask(project, studentDocument, fromSubtask, toSubtaskIndex);
+      placeholder.switchSubtask(project, studentDocument, fromSubtask, targetSubtaskIndex);
     }
     for (AnswerPlaceholder placeholder : taskFile.getAnswerPlaceholders()) {
-      replaceWithTaskText(project, studentDocument, placeholder, toSubtaskIndex);
+      replaceWithTaskText(project, studentDocument, placeholder, targetSubtaskIndex);
     }
     taskFile.setTrackChanges(true);
     studentDocument.removeDocumentListener(listener);
index 73133964ff33a848ec0999e1ab8aa56647a5bc8e..288bc157b012bdf7b0926112345f96f5d262b33f 100644 (file)
@@ -81,7 +81,7 @@ public class StudyEditorFactoryListener implements EditorFactoryListener {
         if (!taskFile.getAnswerPlaceholders().isEmpty()) {
           StudyNavigator.navigateToFirstAnswerPlaceholder(editor, taskFile);
           boolean isStudyProject = EduNames.STUDY.equals(course.getCourseMode());
-          StudyUtils.drawAllWindows(editor, taskFile);
+          StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
           if (isStudyProject) {
             editor.addEditorMouseListener(new WindowSelectionListener(taskFile));
           }