Extract user-visible string constants
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Fri, 29 Jul 2016 13:06:20 +0000 (16:06 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Fri, 29 Jul 2016 15:07:27 +0000 (18:07 +0300)
python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyHint.kt

index 93677f2327f455972e07e5eb69d22684b6505110..cc86dd51596918e4d4b3ac261b7881d6eb8bc568 100644 (file)
@@ -18,6 +18,12 @@ import com.jetbrains.edu.learning.core.EduNames
 import com.jetbrains.edu.learning.courseFormat.AnswerPlaceholder
 
 class StudyHint(private val myPlaceholder: AnswerPlaceholder?, project: Project) {
+  
+  companion object {
+    private val OUR_WARNING_MESSAGE = "Put the caret in the answer placeholder to get hint"
+    private val HINTS_NOT_AVAILABLE = "There is no hint for this answer placeholder"
+  }
+  
   val studyToolWindow: StudyToolWindow
   private var myShownHintNumber = 0
   private var isEditingMode = false
@@ -56,7 +62,7 @@ class StudyHint(private val myPlaceholder: AnswerPlaceholder?, project: Project)
           studyToolWindow.setText(hints[myShownHintNumber])
         }
         else {
-          studyToolWindow.setText("No hints are provided")
+          studyToolWindow.setText(HINTS_NOT_AVAILABLE)
         }
       }
     }
@@ -164,8 +170,4 @@ class StudyHint(private val myPlaceholder: AnswerPlaceholder?, project: Project)
       e.presentation.isEnabled = myPlaceholder != null && myPlaceholder.hints.size > 1 && !isEditingMode
     }
   }
-
-  companion object {
-    private val OUR_WARNING_MESSAGE = "Put the caret in the answer placeholder to get hint"
-  }
 }