Package org.xhtmlrenderer.simple.xhtml

Examples of org.xhtmlrenderer.simple.xhtml.XhtmlNamespaceHandler


        ReplacedElement re = super.createReplacedElement(c, box, uac, cssWidth,
            cssHeight);
        if (re == null
                && c.getNamespaceHandler() instanceof XhtmlNamespaceHandler
                && !c.isPrint()) {
            XhtmlNamespaceHandler nsh = (XhtmlNamespaceHandler) c
                .getNamespaceHandler();
            Element e = box.getElement();
            if (e == null) {
                return null;
            }

            // form controls
            // first check if the control already exists
            if (_controls != null) {
                re = (ReplacedElement) _controls.get(e);
            }
            if (re != null) {
                if (re instanceof FormControlReplacementElement) {
                    // update the size
                    ((FormControlReplacementElement) re).calculateSize(c, box
                        .getStyle(), cssWidth, cssHeight);
                }
                return re;
            }

            // not found, try to create one
            Element parentForm = getParentForm(e, c);
            // parentForm may be null, this is not a problem
            XhtmlForm form = (XhtmlForm) _forms.get(parentForm);
            if (form == null) {
                form = nsh.createForm(parentForm);
                _forms.put(parentForm, form);
            }

            FormControl control = form.createControl(e);
            if (control == null) {
View Full Code Here


    /**
     * @param e
     */
    protected Element getParentForm(Element e, LayoutContext context) {
        Node node = e;
        XhtmlNamespaceHandler nsh = (XhtmlNamespaceHandler) context
            .getNamespaceHandler();

        do {
            node = node.getParentNode();
        } while (node.getNodeType() == Node.ELEMENT_NODE
                && !nsh.isFormElement((Element) node));

        if (node.getNodeType() != Node.ELEMENT_NODE) {
            return null;
        }

View Full Code Here

     *
     * @param doc The new document value
     * @param url The new document value
     */
    public void setDocument(Document doc, String url) {
        super.setDocument(doc, url, new XhtmlNamespaceHandler());
    }
View Full Code Here

     *
     * @param stream The stream to read the Document from.
     * @param url The URL used to resolve relative path references.
     */
    public void setDocument(InputStream stream, String url) {
        super.setDocument(stream, url, new XhtmlNamespaceHandler());
    }
View Full Code Here

TOP

Related Classes of org.xhtmlrenderer.simple.xhtml.XhtmlNamespaceHandler

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.