javax.swing.JEditorPane.getStream()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中javax.swing.JEditorPane.getStream()方法的一些代码示例,展示了JEditorPane.getStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JEditorPane.getStream()方法的具体详情如下:
包路径:javax.swing.JEditorPane
类名称:JEditorPane
方法名:getStream

JEditorPane.getStream介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-awt

return super.getStream(page);

代码示例来源:origin: org.codehaus.izpack/izpack-panel

protected InputStream getStream(URL urlObj)
      throws IOException
  {                  //get original stream contents:
    final InputStream inStm = super.getStream(urlObj);
    final ByteArrayOutputStream btArrOutStm =
        new ByteArrayOutputStream();
    int b;         //copy contents to output stream:
    final byte[] buff = new byte[2048];
    while ((b = inStm.read(buff, 0, buff.length)) > 0)
    {
      btArrOutStm.write(buff, 0, b);
    }
    //convert to string and parse variables:
    final String parsedStr =
        parseText(btArrOutStm.toString());
    //return input stream to parsed string:
    return new ByteArrayInputStream(
        parsedStr.getBytes());
  }
};

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/**
 * Fetches a stream for the given URL, which is about to
 * be loaded by the <code>setPage</code> method.  
 * This method is expected to have the the side effect of
 * establishing the content type, and therefore setting the
 * appropriate <code>EditorKit</code> to use for loading the stream.
 * <p>
 * If debugger is not running returns super implementation.
 * <p>
 * If debugger runs it will set content type to text/html.
 * Forwarding is not supported is that case.
 * <p>Control using sysprop org.openide.awt.SwingBrowserImpl.do-not-block-awt=true.
 *
 * @param page  the URL of the page
 */
protected InputStream getStream (URL page) throws IOException {
  SwingUtilities.invokeLater (SwingBrowserImpl.this);
  // XXX debugger ought to set this temporarily
  if (Boolean.getBoolean("org.openide.awt.SwingBrowserImpl.do-not-block-awt")) {
    // try to set contentType quickly and return (don't block AWT Thread)
    setContentType ("text/html"); // NOI18N
    return new FilteredInputStream (page.openConnection(), 
      SwingBrowserImpl.this);
  } else {
    return super.getStream (page);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/**
 * Fetches a stream for the given URL, which is about to
 * be loaded by the <code>setPage</code> method.  
 * This method is expected to have the the side effect of
 * establishing the content type, and therefore setting the
 * appropriate <code>EditorKit</code> to use for loading the stream.
 * <p>
 * If debugger is not running returns super implementation.
 * <p>
 * If debugger runs it will set content type to text/html.
 * Forwarding is not supported is that case.
 * <p>Control using sysprop org.openide.awt.SwingBrowserImpl.do-not-block-awt=true.
 *
 * @param page  the URL of the page
 */
protected InputStream getStream (URL page) throws IOException {
  SwingUtilities.invokeLater (SwingBrowserImpl.this);
  // XXX debugger ought to set this temporarily
  if (Boolean.getBoolean("org.openide.awt.SwingBrowserImpl.do-not-block-awt")) {
    // try to set contentType quickly and return (don't block AWT Thread)
    setContentType ("text/html"); // NOI18N
    return new FilteredInputStream (page.openConnection(), 
      SwingBrowserImpl.this);
  } else {
    return super.getStream (page);
  }
}

相关文章

JEditorPane类方法