protected Reader createReader(String hoverInfo, TextPresentation presentation) { return new HTML2TextReader(new StringReader(hoverInfo), presentation); }
private String processEntity() throws IOException { StringBuffer buf= new StringBuffer(); int ch= nextChar(); while (Character.isLetterOrDigit((char)ch) || ch == '#') { buf.append((char) ch); ch= nextChar(); } if (ch == ';') return entity2Text(buf.toString()); buf.insert(0, '&'); if (ch != -1) buf.append((char) ch); return buf.toString(); } }
do { ch= nextChar(); ch= nextChar(); if (ch == '"'){ buf.append(Character.toLowerCase((char) ch)); ch= nextChar(); while (ch != -1 && ch != '"'){ buf.append(Character.toLowerCase((char) ch)); ch= nextChar(); if (ch == '<' && !isInComment(buf)) { unread(ch); return '<' + buf.toString(); return null; if (!isInComment(buf) || isCommentEnd(buf)) { break; } while (true); return html2Text(buf.toString());
@Override protected String computeSubstitution(int c) throws IOException { if (c == '<') return processHTMLTag(); else if (fIgnore) return EMPTY_STRING; else if (c == '&') return processEntity(); return null; }
try (HTML2TextReader reader= new HTML2TextReader(new StringReader(fInput.getHtml()), presentation)) { text= reader.getString(); } catch (IOException e) { text= ""; //$NON-NLS-1$
private void unread(int ch) throws IOException { ((PushbackReader) getReader()).unread(ch); }
try (HTML2TextReader reader= new HTML2TextReader(new StringReader(fInput.getHtml()), presentation)) { text= reader.getString(); } catch (IOException e) { text= ""; //$NON-NLS-1$
@Override protected String computeSubstitution(int c) throws IOException { if (c == '<') return processHTMLTag(); else if (fIgnore) return EMPTY_STRING; else if (c == '&') return processEntity(); return null; }
private void unread(int ch) throws IOException { ((PushbackReader) getReader()).unread(ch); }
do { ch= nextChar(); ch= nextChar(); if (ch == '"'){ buf.append(Character.toLowerCase((char) ch)); ch= nextChar(); while (ch != -1 && ch != '"'){ buf.append(Character.toLowerCase((char) ch)); ch= nextChar(); if (ch == '<' && !isInComment(buf)) { unread(ch); return '<' + buf.toString(); return null; if (!isInComment(buf) || isCommentEnd(buf)) { break; } while (true); return html2Text(buf.toString());
protected Reader createReader(String hoverInfo, TextPresentation presentation) { return new HTML2TextReader(new StringReader(hoverInfo), presentation); }
private String processEntity() throws IOException { StringBuilder buf= new StringBuilder(); int ch= nextChar(); while (Character.isLetterOrDigit((char)ch) || ch == '#') { buf.append((char) ch); ch= nextChar(); } if (ch == ';') return entity2Text(buf.toString()); buf.insert(0, '&'); if (ch != -1) buf.append((char) ch); return buf.toString(); } }
private String retrieveText(IJavaElement elem) throws JavaModelException { if (elem instanceof IMember) { Reader reader= JavadocContentAccess.getHTMLContentReader((IMember)elem, true, true); if (reader != null) reader= new HTML2TextReader(reader, null); if (reader != null) { String str= getString(reader); BreakIterator breakIterator= BreakIterator.getSentenceInstance(); breakIterator.setText(str); return str.substring(0, breakIterator.next()); } } return ""; //$NON-NLS-1$ }
private String retrieveText(IJavaElement elem) throws JavaModelException { if (elem instanceof IMember) { Reader reader= JavadocContentAccess.getHTMLContentReader((IMember)elem, true, true); if (reader != null) reader= new HTML2TextReader(reader, null); if (reader != null) { String str= getString(reader); BreakIterator breakIterator= BreakIterator.getSentenceInstance(); breakIterator.setText(str); return str.substring(0, breakIterator.next()); } } return ""; //$NON-NLS-1$ }
private String retrieveText(IJavaElement elem) throws JavaModelException { if (elem instanceof IMember) { Reader reader= JavadocContentAccess.getHTMLContentReader((IMember)elem, true, true); if (reader != null) reader= new HTML2TextReader(reader, null); if (reader != null) { String str= getString(reader); BreakIterator breakIterator= BreakIterator.getSentenceInstance(); breakIterator.setText(str); return str.substring(0, breakIterator.next()); } } return ""; //$NON-NLS-1$ }