* 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();
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);
if (!wrapTag) {
return shortcut;
}
- return "<shortcut>" + shortcut + "</shortcut>";
+ return SHORTCUT_TAG + shortcut + SHORTCUT_CLOSING_TAG;
}
}