Package net.sf.jpluck.plucker.parsing.html

Source Code of net.sf.jpluck.plucker.parsing.html.DefinitionItemHandler

package net.sf.jpluck.plucker.parsing.html;

import net.sf.jpluck.plucker.Text;
import net.sf.jpluck.plucker.parsing.Element;


public class DefinitionItemHandler implements TagHandler {
    public void start(HTMLSerializer ser, StyledElement elem) {
        Element parent = elem.getParent();
        if (parent.getQName().equals("dl")) {
            Style style = new Style();
            style.setMarginLeft(ser.scaledValue(12));
            elem.setStyle(style);
            ser.addParagraph(0);
        } else {
            Style style = elem.getCascadedStyle();
            ser.addParagraph(0).addMargin(style.getMarginLeft() + 12, style.getMarginRight()).
                    addText(Text.createNonBreakingSpace()).addMargin(style.getMarginLeft(), style.getMarginRight());
        }
    }


    public void end(HTMLSerializer ser, StyledElement elem) {
        ser.addParagraph(0);
    }
}
TOP

Related Classes of net.sf.jpluck.plucker.parsing.html.DefinitionItemHandler

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.