EDU-232 Cancel task window text editing actually doesn't work
authorliana.bakradze <liana.bakradze@jetbrains.com>
Sat, 25 Oct 2014 18:23:24 +0000 (22:23 +0400)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Sat, 25 Oct 2014 18:23:24 +0000 (22:23 +0400)
python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/actions/CCShowTaskWindowDetails.java
python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/ui/CreateTaskWindowDialog.java
python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/ui/CreateTaskWindowPanel.java

index d865902a8025b6c0eb11820b3e56aef4762c1f7c..e08743fc6941302c84598f55f40cf6c7c3784304 100644 (file)
@@ -5,10 +5,7 @@ import com.intellij.psi.PsiDirectory;
 import com.intellij.psi.PsiFile;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.plugins.coursecreator.CCProjectService;
-import org.jetbrains.plugins.coursecreator.format.Course;
-import org.jetbrains.plugins.coursecreator.format.Lesson;
-import org.jetbrains.plugins.coursecreator.format.Task;
-import org.jetbrains.plugins.coursecreator.format.TaskFile;
+import org.jetbrains.plugins.coursecreator.format.*;
 import org.jetbrains.plugins.coursecreator.ui.CreateTaskWindowDialog;
 
 public class CCShowTaskWindowDetails extends CCTaskWindowAction {
@@ -29,7 +26,8 @@ public class CCShowTaskWindowDetails extends CCTaskWindowAction {
     final Lesson lesson = course.getLesson(lessonDir.getName());
     final Task task = lesson.getTask(taskDir.getName());
     final TaskFile taskFile = state.getTaskFile();
-    CreateTaskWindowDialog dlg = new CreateTaskWindowDialog(project, state.getTaskWindow(), lesson.getIndex(), task.getIndex(),
+    TaskWindow taskWindow = state.getTaskWindow();
+    CreateTaskWindowDialog dlg = new CreateTaskWindowDialog(project, taskWindow, lesson.getIndex(), task.getIndex(),
                                                             file.getVirtualFile().getNameWithoutExtension(),
                                                             taskFile.getTaskWindows().size() + 1);
     dlg.show();
index 2240d58a2846c69d56ba9edddf4fd6c07713371f..213fc55e2cb773140b778080dd6d75476a10c21c 100644 (file)
@@ -95,6 +95,10 @@ public class CreateTaskWindowDialog extends DialogWrapper {
       myTaskWindow.setHint(hintName);
       String hintText = myPanel.getHintText();
       createHint(hintName, hintText);
+    } else {
+      if (myTaskWindow.getHintName() != null) {
+        deleteHint();
+      }
     }
     super.doOKAction();
   }
index 4fc64fa769c6390a99e7a339803e78bda019d425..a09945718aaa902a3efbb67bb6d69b38816c5362 100644 (file)
@@ -32,7 +32,7 @@ public class CreateTaskWindowPanel extends JPanel {
         // 1 for checked
         enableHint(state == 1);
         if (state == 2) {
-          myDialog.deleteHint();
+          resetHint();
         }
       }
     });