Examples of HTMLDocument


Examples of javax.swing.text.html.HTMLDocument

                    if (e instanceof HTMLFrameHyperlinkEvent) {
                        Debug.message("minibrowser",
                                "processing HTMLFrameHyperlinkEvent");
                        HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
                        HTMLDocument doc = (HTMLDocument) pane.getDocument();
                        doc.processHTMLFrameHyperlinkEvent(evt);
                    } else {
                        Debug.message("minibrowser",
                                "processing HyperlinkEvent");
                        try {
                            push(e.getURL());
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

    return true;
  }

  private boolean isInvisible(final javax.swing.text.Element textElement)
  {
    final HTMLDocument htmlDocument = (HTMLDocument) textElement.getDocument();
    final StyleSheet sheet = htmlDocument.getStyleSheet();
    final AttributeSet attr = computeStyle(textElement, sheet);
    final Object o = attr.getAttribute(CSS.Attribute.DISPLAY);
    if ("none".equals(String.valueOf(o)))
    {
      return true;
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

    return false;
  }

  private void configureStyle(final javax.swing.text.Element textElement, final Element result)
  {
    final HTMLDocument htmlDocument = (HTMLDocument) textElement.getDocument();
    final StyleSheet sheet = htmlDocument.getStyleSheet();
    final AttributeSet attr = computeStyle(textElement, sheet);
    parseBorderAndBackgroundStyle(result, sheet, attr);
    parseBoxStyle(result, attr);

    final Font font = sheet.getFont(attr);
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

   * @see javax.swing.event.HyperlinkListener#hyperlinkUpdate(javax.swing.event.HyperlinkEvent)
   */
  public void hyperlinkUpdate (HyperlinkEvent event){
    if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED){
      if (event instanceof HTMLFrameHyperlinkEvent) {
        HTMLDocument doc = (HTMLDocument)viewer.getDocument ();
        doc.processHTMLFrameHyperlinkEvent((HTMLFrameHyperlinkEvent)event);
      }else
        displayPage(event.getURL());
    }
  }
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

     * @see javax.swing.event.HyperlinkListener#hyperlinkUpdate(javax.swing.event.HyperlinkEvent)
     */
    public void hyperlinkUpdate (HyperlinkEvent event){
        if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED){
            if (event instanceof HTMLFrameHyperlinkEvent) {
                HTMLDocument doc = (HTMLDocument)viewer.getDocument ();
                doc.processHTMLFrameHyperlinkEvent((HTMLFrameHyperlinkEvent)event);
            } else

                displayPageEvent(event.getURL());

        }
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

    ss.addStyleSheet(styles);

    ss.addRule("body {font-family:arial;font-size:12pt}");
    ss.addRule("p {font-family:arial;margin:2}");

    HTMLDocument doc = new HTMLDocLinkDetector(ss);

    setEditorKit(htmlkit);

    setDocument(doc);
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

    String obj = sentence.getObjectName();
    tfObject.setText(obj != null ? obj :
      "[" + sentence.getObjectCount() + " objects]");

    HTMLDocument d = initHtml(tpExpressions);

    int unknown = 0;
    for (Expression e : sentence) {
      String style = "";
      ExpressionType t = e.getType();
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

   */
  @Override
  protected void initStylesForTextPane(final JTextPane textPane) {
    textPane.setContentType("text/html");

    final HTMLDocument doc = (HTMLDocument) textPane.getDocument();
    final StyleSheet css = doc.getStyleSheet();

    /*
     * Configure standard styles
     */
    css.addRule("body { font-family: Dialog; font-size: " + (TEXT_SIZE + 1)
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

   *
   * @param text
   *            The HTML text to add.
   */
  protected void appendString(final String text) {
    final HTMLDocument doc = (HTMLDocument) textPane.getDocument();

    try {
      final Element root = doc.getParagraphElement(0);
      doc.insertBeforeEnd(root, text);
    } catch (final BadLocationException e) {
      logger.error(e, e);
    } catch (final IOException e) {
      logger.error(e, e);
    }
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

        URLConnection con = google.openConnection();
        con.setRequestProperty("User-Agent", "");
        InputStream in = con.getInputStream();
        try {
            HTMLEditorKit kit = new HTMLEditorKit();
            HTMLDocument doc = new HTMLDocument();
            doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
            kit.read(new InputStreamReader(in, "UTF-8"), doc, 0);
            HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
            while (it.isValid()) {
                if(it.getAttributes() != null) {
                    String href = (String) it.getAttributes().getAttribute(HTML.Attribute.HREF);
                    if (href != null && href.endsWith("." + currentFiletype)) {
                        URL url = new URL(new URL("http", "www.google.com", "dummy"), href);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.