EDU-387 Missing highlighting for some shortcut prompts at the main window
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Fri, 21 Aug 2015 11:01:17 +0000 (14:01 +0300)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Fri, 21 Aug 2015 11:01:17 +0000 (14:01 +0300)
python/educational/interactive-learning/src/com/jetbrains/edu/learning/StudyInstructionPainter.java

index bbe944d26f271b2c557fcebe8466adca9caba06f..577c2762ab9e3fcdce072290dca9f32a5ce2ced9 100644 (file)
@@ -21,6 +21,10 @@ import java.awt.*;
  * data: 7/29/14.
  */
 public class StudyInstructionPainter extends EditorEmptyTextPainter {
+
+  public static final String SHORTCUT_TAG = "<shortcut>";
+  public static final String SHORTCUT_CLOSING_TAG = "</shortcut>";
+
   @Override
   public void paintEmptyText(final JComponent splitters, Graphics g) {
     boolean isDarkBackground = UIUtil.isUnderDarcula();
@@ -35,12 +39,12 @@ public class StudyInstructionPainter extends EditorEmptyTextPainter {
     addAction(painter, "Navigate to the next answer placeholder", StudyNextWindowAction.ACTION_ID, StudyNextWindowAction.SHORTCUT2, true);
     String shortcut1 = getShortcutText(StudyPrevWindowAction.ACTION_ID, StudyPrevWindowAction.SHORTCUT, false, false);
     String shortcut2 = getShortcutText(StudyNextWindowAction.ACTION_ID, StudyNextWindowAction.SHORTCUT, false, false);
-    String text = "Navigate between answer placeholders with " + shortcut1 +
-                  " and " + shortcut2;
+    String text = "Navigate between answer placeholders with " + SHORTCUT_TAG + shortcut1 +
+                  "/" + shortcut2 + SHORTCUT_CLOSING_TAG;
     painter.appendLine(text).smaller().withBullet();
     shortcut1 = getShortcutText(StudyPreviousStudyTaskAction.ACTION_ID, StudyPreviousStudyTaskAction.SHORTCUT, false, false);
     shortcut2 = getShortcutText(StudyNextStudyTaskAction.ACTION_ID, StudyNextStudyTaskAction.SHORTCUT, false, false);
-    painter.appendLine("Navigate between tasks with " + shortcut1 + " and " + shortcut2).smaller().withBullet();
+    painter.appendLine("Navigate between tasks with " +SHORTCUT_TAG + shortcut1 + "/" + shortcut2 + SHORTCUT_CLOSING_TAG).smaller().withBullet();
     addAction(painter, "Reset current task file", StudyRefreshTaskFileAction.ACTION_ID, StudyRefreshTaskFileAction.SHORTCUT, false);
     addAction(painter, "Check task", StudyCheckAction.ACTION_ID, StudyCheckAction.SHORTCUT, false);
     addAction(painter, "Get hint for the answer placeholder", StudyShowHintAction.ACTION_ID, StudyShowHintAction.SHORTCUT, false);
@@ -72,6 +76,6 @@ public class StudyInstructionPainter extends EditorEmptyTextPainter {
     if (!wrapTag) {
       return shortcut;
     }
-    return "<shortcut>" + shortcut + "</shortcut>";
+    return SHORTCUT_TAG + shortcut + SHORTCUT_CLOSING_TAG;
   }
 }