@Override public String getStyledText() { if (context instanceof IContext2) { return ((IContext2)context).getStyledText(); } return context.getText(); }
/** * Make sure to support the Help system bold tag. Help systen returns a * regular string for getText(). Use internal apis for now to get bold. * * @param context * @return */ private String decodeContextBoldTags(IContext context) { String styledText; if (context instanceof IContext2) { styledText = ((IContext2) context).getStyledText(); if (styledText == null) { styledText = context.getText(); } } else { styledText = context.getText(); } if (styledText == null) { return Messages.ContextHelpPart_noDescription; } String decodedString = styledText.replaceAll("<@#\\$b>", "<b>"); //$NON-NLS-1$ //$NON-NLS-2$ decodedString = decodedString.replaceAll("</@#\\$b>", "</b>"); //$NON-NLS-1$ //$NON-NLS-2$ decodedString = parent.escapeSpecialChars(decodedString, true); decodedString = decodedString.replaceAll("\r\n|\n|\r", "<br/>"); //$NON-NLS-1$ //$NON-NLS-2$ return decodedString; }
styledText = ((IContext2) context).getStyledText();