Package javax.swing.text

Examples of javax.swing.text.ElementIterator$StackItem


        return threshold;
    }

    public Element getElement(final Element e, final Object attribute,
                              final Object value) {
        final ElementIterator it = new ElementIterator(e);
        while (it.next() != null) {
            final Element current = it.current();
            if (current.getAttributes().containsAttribute(attribute, value)) {
                return current;
            }
        }
        return null;
View Full Code Here


                setOuterHTML(parent, "<frame src=\"" + src + "\">");
            } catch (BadLocationException e) {
            } catch (IOException e) {
            }
        } else {
            final ElementIterator frameIterator = new ElementIterator(getDefaultRootElement());
            if (frameIterator != null) {
                while (frameIterator.next() != null) {
                    final Element element = frameIterator.current();
                    if (Tag.FRAME.equals(element.getName())
                        && element.getAttributes().containsAttribute(HTML.Attribute.NAME, target)) {
                       
                        processTarget(element, src);
                    }
View Full Code Here

    HTMLDocument htmlDoc = (HTMLDocument) htmlKit.createDefaultDocument();
    HTMLEditorKit.Parser parser = new ParserDelegator();
    HTMLEditorKit.ParserCallback callback = htmlDoc.getReader(0);
    parser.parse(br, callback, true);

    ElementIterator iterator = new ElementIterator(htmlDoc);
    Element element;
    while ((element = iterator.next()) != null)
      {
        AttributeSet attributes = element.getAttributes();
        Object name = attributes.getAttribute(StyleConstants.NameAttribute);
        h.check((name instanceof HTML.Tag),
                true,
View Full Code Here

                setOuterHTML(parent, "<frame src=\"" + src + "\">");
            } catch (BadLocationException e) {
            } catch (IOException e) {
            }
        } else {
            final ElementIterator frameIterator = new ElementIterator(getDefaultRootElement());
            if (frameIterator != null) {
                while (frameIterator.next() != null) {
                    final Element element = frameIterator.current();
                    if (Tag.FRAME.equals(element.getName())
                        && element.getAttributes().containsAttribute(HTML.Attribute.NAME, target)) {
                       
                        processTarget(element, src);
                    }
View Full Code Here

    public void write() throws IOException, BadLocationException {
        if (elemsStack == null) {
            elemsStack = new Stack();
        }
        ElementIterator it = getElementIterator();

        Element e;
        while ((e = it.next()) != null) {
            if (!elemsStack.isEmpty()) {
                while (!elemsStack.isEmpty()
                        && elemsStack.peek() != e.getParentElement()) {
                    if (!synthesizedElement((Element)elemsStack.peek())) {
                        decrIndent();
View Full Code Here

      HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument();
      doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
      Reader HTMLReader = new InputStreamReader(url.openConnection().getInputStream());
      kit.read(HTMLReader, doc, 0);
      //  Get an iterator for all HTML tags.
      ElementIterator it = new ElementIterator(doc);
      Element elem;      
      while( (elem = it.next()) != null  )
      {
        if( elem.getName().equals"img") )
        {
          String s = (String) elem.getAttributes().getAttribute(HTML.Attribute.SRC);
          String ww = (String) elem.getAttributes().getAttribute(HTML.Attribute.WIDTH);
View Full Code Here

      this.element = getStandAloneElement(element);
    }

    @Override
    protected ElementIterator getElementIterator() {
      return new ElementIterator(element);
    }
View Full Code Here

        return threshold;
    }

    public Element getElement(final Element e, final Object attribute,
                              final Object value) {
        final ElementIterator it = new ElementIterator(e);
        while (it.next() != null) {
            final Element current = it.current();
            if (current.getAttributes().containsAttribute(attribute, value)) {
                return current;
            }
        }
        return null;
View Full Code Here

                setOuterHTML(parent, "<frame src=\"" + src + "\">");
            } catch (BadLocationException e) {
            } catch (IOException e) {
            }
        } else {
            final ElementIterator frameIterator = new ElementIterator(getDefaultRootElement());
            if (frameIterator != null) {
                while (frameIterator.next() != null) {
                    final Element element = frameIterator.current();
                    if (Tag.FRAME.equals(element.getName())
                        && element.getAttributes().containsAttribute(HTML.Attribute.NAME, target)) {
                       
                        processTarget(element, src);
                    }
View Full Code Here

    private final ElementIterator it;
    private Element current;

    public TagIterator(final Tag tag, final Document document) {
        this.tag = tag;
        it = new ElementIterator(document);
        next();
    }
View Full Code Here

TOP

Related Classes of javax.swing.text.ElementIterator$StackItem

Copyright © 2018 www.massapicom. 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.