EDU-387 Missing highlighting for some shortcut prompts at the main window

This commit is contained in:
Liana Bakradze
2015-08-21 14:01:17 +03:00
parent cf84f62e3d
commit 85b535e925
@@ -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;
}
}