Java XML Element Get getElementForLine(Document document, int line)

Here you can find the source of getElementForLine(Document document, int line)

Description

get Element For Line

License

Open Source License

Declaration

public static Element getElementForLine(Document document, int line) 

Method Source Code

//package com.java2s;

import javax.swing.text.Document;
import javax.swing.text.Element;

public class Main {
    public static Element getElementForLine(Document document, int line) {
        Element[] roots = document.getRootElements();
        Element root = roots[0];/*from  ww w .j a  v a2s  .com*/
        return root.getElement(line - 1);
    }
}

Related

  1. getElementContent(final Element el)
  2. getElementContent(final Element element)
  3. getElementContent(final Element element, final boolean trim)
  4. getElementContents(Element element, String elementName)
  5. getElementDescendant(Element elem, String ns_uri, String tagName)
  6. getElementId(Element element)
  7. getElementIndex(Element ele)
  8. getElementIndex(Element element)
  9. getElementLanguage(Element elemNode, String defaultLangCode)