EDU-671 Replace placeholder default text with "type here"
authorliana.bakradze <liana.bakradze@jetbrains.com>
Sat, 16 Jul 2016 08:37:48 +0000 (11:37 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Sat, 16 Jul 2016 08:37:48 +0000 (11:37 +0300)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCAddAnswerPlaceholder.java

index 9944ca2b9fab23bfcbdd8e346508fcc1272dbf72..0c947436e54b07d913f7fca697b6689b29715856 100644 (file)
@@ -58,7 +58,8 @@ public class CCAddAnswerPlaceholder extends CCAnswerPlaceholderAction {
     answerPlaceholder.setOffset(offset);
     answerPlaceholder.setUseLength(false);
 
-    answerPlaceholder.setPossibleAnswer(model.hasSelection() ? model.getSelectedText() : EduNames.PLACEHOLDER);
+    String defaultPlaceholderText = "type here";
+    answerPlaceholder.setPossibleAnswer(model.hasSelection() ? model.getSelectedText() : defaultPlaceholderText);
 
     CCCreateAnswerPlaceholderDialog dlg = new CCCreateAnswerPlaceholderDialog(project, answerPlaceholder);
     dlg.show();
@@ -67,7 +68,7 @@ public class CCAddAnswerPlaceholder extends CCAnswerPlaceholderAction {
     }
 
     if (!model.hasSelection()) {
-      DocumentUtil.writeInRunUndoTransparentAction(() -> document.insertString(offset, EduNames.PLACEHOLDER));
+      DocumentUtil.writeInRunUndoTransparentAction(() -> document.insertString(offset, defaultPlaceholderText));
     }
 
     TaskFile taskFile = state.getTaskFile();
@@ -77,7 +78,7 @@ public class CCAddAnswerPlaceholder extends CCAnswerPlaceholderAction {
     answerPlaceholder.setTaskFile(taskFile);
     taskFile.sortAnswerPlaceholders();
 
-    answerPlaceholder.setPossibleAnswer(model.hasSelection() ? model.getSelectedText() : EduNames.PLACEHOLDER);
+    answerPlaceholder.setPossibleAnswer(model.hasSelection() ? model.getSelectedText() : defaultPlaceholderText);
     EduAnswerPlaceholderPainter.drawAnswerPlaceholder(editor, answerPlaceholder, JBColor.BLUE);
     EduAnswerPlaceholderPainter.createGuardedBlocks(editor, answerPlaceholder);
   }