| java.lang.Object org.netbeans.modules.visualweb.insync.SourceUnit org.netbeans.modules.visualweb.insync.markup.MarkupUnit
Inner Class :public static class XhtmlEntityResolver implements EntityResolver | |
Inner Class :public class LineCountingWriter extends Writer | |
Constructor Summary | |
public | MarkupUnit(FileObject fobj, int flags, boolean supportCss, UndoManager undoManager) |
Method Summary | |
public Element | addElement(Element parent, Node before, String taglibUri, String tagPrefix, String tag) | public void | appendParsedString(Node parent, String xhtml, MarkupDesignBean bean) | public int | computeLine(Element element) Return the buffer start position of a given node. | public void | destroy() | public void | dump(org.w3c.dom.Node node, PrintWriter w, int level) | public void | dumpTo(PrintWriter w) | public void | ensureAttributeExists(Element element, String attr, String defValue) Ensure that a given attribute of a given element exists. | public void | ensureAttributeValue(Element element, String attr, String value) Ensure that a given attribute of a given element is a specific value. | public static Element | ensureElement(Element parent, String tag, Element after) | public static Element | ensureRoot(Document document, String tag) Ensures that there is an element of a given type at the root of the document. | public Element | findHtmlTag(Node root) Locate the <html> tag. | public String | findTaglibUri(String prefix) | public URL | getBase() Returns the location to resolve relative URLs against. | public URI | getBaseURI() | public static Element | getDescendantElementByAttr(Element parent, String tag, String attrName, String attrValue) | public static String | getElementText(Element elem) Get the text body of an element. | public String | getEncoding() | public ParserAnnotation[] | getErrors() Return the list of errors if this unit does not compile. | public static Element | getFirstChildElement(Node parent) | public static Element | getFirstDescendantElement(Element parent, String tag) | public static String | getIanaEncoding(String encoding) | public static MarkupDesignBean | getMarkupDesignBeanForElement(Element element) | public static MarkupUnit | getMarkupUnitForDocument(Document doc) | public String | getNamespacePrefix(String namespaceUri, String suggPrefix) Gets the actual prefix in this document for a given namespace. | public static Element | getNextSiblingElement(Node elem) | public int | getOffset(Element element) Return the buffer start offset of a given node. | public OutputFormat | getOutputFormat() | public Document | getRenderedDom() | public Document | getSourceDom() | public static URL | getUrlForDocument(Document doc) | public void | handleEvent(org.w3c.dom.events.Event e) | public void | indent(PrintWriter w, int level) | public static boolean | isDescendent(Node parent, Node descendent) | public boolean | isHtmlOnly() Return true iff this web page should not be converted to a web form if it's missing a backing
file. | public void | markHtmlOnly() Mark this web form in such a way that in the future, isHtmlOnly will return false. | protected void | read(char[] buf, int len) Read the actual characters from the source document's content and into our DOM source document
object. | public static void | setElementText(Element elem, String text) Set the text body of an element. | public static void | setMarkupDesignBeanForElement(Element element, MarkupDesignBean markupDesignBean) | public static void | setUrlForDocument(Document doc, URL url) | public static String | toURL(String path) Convert the given path to a URL: encode spaces to %20's, use
only forward slashes, etc. | protected void | unregisterDomListeners() | public void | writeTo(Writer w) |
ALLOW_HTML | final public static int ALLOW_HTML(Code) | | |
ALLOW_XML | final public static int ALLOW_XML(Code) | | |
DOM_ATTR_MODIFIED | final public static String DOM_ATTR_MODIFIED(Code) | | |
DOM_CHARACTER_DATA_MODIFIED | final public static String DOM_CHARACTER_DATA_MODIFIED(Code) | | |
DOM_DOCUMENT_REPLACED | final public static String DOM_DOCUMENT_REPLACED(Code) | | Insync extention of MutationEventImpl type (see insyc/MarkupUnit and xerces/MuationEventImpl).
|
DOM_NODE_INSERTED | final public static String DOM_NODE_INSERTED(Code) | | |
DOM_NODE_INSERTED_INTO_DOCUMENT | final public static String DOM_NODE_INSERTED_INTO_DOCUMENT(Code) | | |
DOM_NODE_REMOVED | final public static String DOM_NODE_REMOVED(Code) | | |
DOM_NODE_REMOVED_FROM_DOCUMENT | final public static String DOM_NODE_REMOVED_FROM_DOCUMENT(Code) | | |
DOM_SUBTREE_MODIFIED | final public static String DOM_SUBTREE_MODIFIED(Code) | | |
MarkupUnit | public MarkupUnit(FileObject fobj, int flags, boolean supportCss, UndoManager undoManager)(Code) | | Construct an MarkupUnit with a source doc
|
computeLine | public int computeLine(Element element)(Code) | | Return the buffer start position of a given node. Not currently very efficient or accurate
the char offset of the node, -1 if not found |
destroy | public void destroy()(Code) | | |
ensureAttributeExists | public void ensureAttributeExists(Element element, String attr, String defValue)(Code) | | Ensure that a given attribute of a given element exists. Create it with the default value if
it does not, leave it alone if it is. Handles special case of xmlns definition attributes.
|
ensureAttributeValue | public void ensureAttributeValue(Element element, String attr, String value)(Code) | | Ensure that a given attribute of a given element is a specific value. Update it if it is not,
leave it alone if it is. Handles special case of xmlns definition attributes.
|
ensureRoot | public static Element ensureRoot(Document document, String tag)(Code) | | Ensures that there is an element of a given type at the root of the document.
the found or created element |
findHtmlTag | public Element findHtmlTag(Node root)(Code) | | Locate the <html> tag. In a normal xhtml/html document, it's the same as the root tag
for the DOM, but in our JSF files, it might be nested within <jsp:root>,
<f:view>, etc.
Parameters: root - The root tag The html tag Element |
getBase | public URL getBase()(Code) | | Returns the location to resolve relative URLs against. By default this will be the document's
URL if the document was loaded from a URL. If a base tag is found and can be parsed, it will
be used as the base location.
the base location |
getDescendantElementByAttr | public static Element getDescendantElementByAttr(Element parent, String tag, String attrName, String attrValue)(Code) | | Return the child element with a given value for a given attribute
|
getElementText | public static String getElementText(Element elem)(Code) | | Get the text body of an element. Any markup is ignored.
|
getEncoding | public String getEncoding()(Code) | | the current encoding in IANA form, or null for default (UTF8) |
getErrors | public ParserAnnotation[] getErrors()(Code) | | Return the list of errors if this unit does not compile. If there are no errors it returns an
empty array - never null.
An array of ParserAnnotations. |
getFirstChildElement | public static Element getFirstChildElement(Node parent)(Code) | | Get the first child node that is an element
|
getFirstDescendantElement | public static Element getFirstDescendantElement(Element parent, String tag)(Code) | | Get the first descendant element with a given tag
|
getIanaEncoding | public static String getIanaEncoding(String encoding)(Code) | | Return a Xerces-compatible IANA encoding given a Java or IANA encoding
Parameters: encoding - Java or IANA encoding Xerces-compatible IANA encoding |
getNamespacePrefix | public String getNamespacePrefix(String namespaceUri, String suggPrefix)(Code) | | Gets the actual prefix in this document for a given namespace. Registers the default if it
does not yet exist.
Parameters: namespaceUri - Parameters: suggPrefix - the existing or newly registered prefix |
getNextSiblingElement | public static Element getNextSiblingElement(Node elem)(Code) | | Get the next sibling node that is an element
|
getOffset | public int getOffset(Element element)(Code) | | Return the buffer start offset of a given node. Not currently very efficient or accurate
the char offset of the node, -1 if not found |
getOutputFormat | public OutputFormat getOutputFormat()(Code) | | Get the output format to be used when serializing this buffer
|
isDescendent | public static boolean isDescendent(Node parent, Node descendent)(Code) | | Return the child element with a given value for a given attribute
|
isHtmlOnly | public boolean isHtmlOnly()(Code) | | Return true iff this web page should not be converted to a web form if it's missing a backing
file. Web forms can be marked in this way if the user answers no to the conversion dialog.
|
markHtmlOnly | public void markHtmlOnly()(Code) | | Mark this web form in such a way that in the future, isHtmlOnly will return false. In other
words, if this web page should not be converted to a web form, call this method such that the
conversion dialog is not shown next time this markup document is opened. This method should
NOT be called on a file which already returns isHtmlOnly (it may add additional meta tags,
not look for existing ones first).
|
read | protected void read(char[] buf, int len)(Code) | | Read the actual characters from the source document's content and into our DOM source document
object. Try an XML and/or an HTML parser depending on our flags setting.
|
setElementText | public static void setElementText(Element elem, String text)(Code) | | Set the text body of an element. Any markup is lost.
|
toURL | public static String toURL(String path)(Code) | | Convert the given path to a URL: encode spaces to %20's, use
only forward slashes, etc.
|
unregisterDomListeners | protected void unregisterDomListeners()(Code) | | |
|
|