/** * Sets the contents of the stream. Optionally, URLs in untagged text can be * converted into hyperlinks. The caller is responsible for closing the * stream. * * @param is * stream to render * @param expandURLs * if <samp>true </samp>, URLs found in untagged text will be * converted into hyperlinks. */ public void setContents(InputStream is, boolean expandURLs) { entered = null; disposeResourceTable(false); model.parseInputStream(is, expandURLs); hookControlSegmentFocus(); layout(); redraw(); }
/** * Sets the contents of the stream. Optionally, URLs in untagged text can be * converted into hyperlinks. The caller is responsible for closing the * stream. * * @param is * stream to render * @param expandURLs * if <samp>true </samp>, URLs found in untagged text will be * converted into hyperlinks. */ public void setContents(InputStream is, boolean expandURLs) { entered = null; disposeResourceTable(false); model.parseInputStream(is, expandURLs); hookControlSegmentFocus(); layout(); redraw(); }
/** * Sets the provided text. Text can be rendered as-is, or by parsing the * formatting tags. Optionally, sections of text starting with http:// will * be converted to hyperlinks. * * @param text * the text to render * @param parseTags * if <samp>true </samp>, formatting tags will be parsed. * Otherwise, text will be rendered as-is. * @param expandURLs * if <samp>true </samp>, URLs found in the untagged text will be * converted into hyperlinks. */ public void setText(String text, boolean parseTags, boolean expandURLs) { disposeResourceTable(false); entered = null; if (parseTags) model.parseTaggedText(text, expandURLs); else model.parseRegularText(text, expandURLs); hookControlSegmentFocus(); layout(); redraw(); }
/** * Sets the provided text. Text can be rendered as-is, or by parsing the * formatting tags. Optionally, sections of text starting with http:// will * be converted to hyperlinks. * * @param text * the text to render * @param parseTags * if <samp>true </samp>, formatting tags will be parsed. * Otherwise, text will be rendered as-is. * @param expandURLs * if <samp>true </samp>, URLs found in the untagged text will be * converted into hyperlinks. */ public void setText(String text, boolean parseTags, boolean expandURLs) { disposeResourceTable(false); entered = null; if (parseTags) model.parseTaggedText(text, expandURLs); else model.parseRegularText(text, expandURLs); hookControlSegmentFocus(); layout(); redraw(); }
addDisposeListener(e -> { model.dispose(); disposeResourceTable(true); }); addPaintListener(e -> paint(e));