Minor Set default text to the first hint if text field is empty and user is focused...
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Tue, 26 Jul 2016 08:12:03 +0000 (11:12 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Tue, 26 Jul 2016 15:52:59 +0000 (18:52 +0300)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java

index f2a479d2fa1b03bd4306ad3491af080d82d8b416..d257fae4a8a589f0930abcd1b83dff27a6202688 100644 (file)
@@ -50,6 +50,14 @@ public class CCCreateAnswerPlaceholderPanel {
           myHintTextArea.setText("");
         }
       }
+
+      @Override
+      public void focusLost(FocusEvent e) {
+        if (myShownHintNumber == 0 && myHintTextArea.getText().isEmpty()) {
+          myHintTextArea.setForeground(UIUtil.getInactiveTextColor());
+          myHintTextArea.setText(ourFirstHintText);
+        }
+      }
     });
 
     myPlaceholderTextArea.grabFocus();