String () { StringBuilder result = new StringBuilder(BookmarkBundle.message("bookmark.text")); if (myMnemonic != 0) { result.append(" ").append(myMnemonic); } String text = nullizeEmptyDescription(); String description = text == null ? null : StringUtil.escapeXmlEntities(text); if (description != null) { result.append(": ").append(description); } StringBuilder shortcutDescription = new StringBuilder(); if (myMnemonic != 0) { String shortcutToToggle = KeymapUtil.getFirstKeyboardShortcutText("ToggleBookmark" + myMnemonic); String shortcutToNavigate = KeymapUtil.getFirstKeyboardShortcutText("GotoBookmark" + myMnemonic); if (!shortcutToToggle.isEmpty()) { shortcutDescription.append(shortcutToNavigate.isEmpty() ? BookmarkBundle.message("bookmark.shortcut.to.toggle", shortcutToToggle) : BookmarkBundle.message("bookmark.shortcut.to.toggle.and.jump", shortcutToToggle, shortcutToNavigate)); } else if (!shortcutToNavigate.isEmpty()){ shortcutDescription.append(BookmarkBundle.message("bookmark.shortcut.to.jump", shortcutToNavigate)); } } if (shortcutDescription.length() == 0) { String shortcutToToggle = KeymapUtil.getFirstKeyboardShortcutText("ToggleBookmark"); if (shortcutToToggle.length() > 0) { shortcutDescription.append(BookmarkBundle.message("bookmark.shortcut.to.toggle", shortcutToToggle)); } } if (shortcutDescription.length() > 0) { result.append(" (").append(shortcutDescription).append(")"); } //noinspection HardCodedStringLiteral return result.toString(); }