Package org.apache.fop.fo.flow

Examples of org.apache.fop.fo.flow.BasicLink$Maker


     * Detect internal or external link and add it as an area trait
     *
     * @param area the basic-link's area
     */
    private void setupBasicLinkArea(InlineArea area) {
        BasicLink fobj = (BasicLink) this.fobj;
        // internal destinations take precedence:
        TraitSetter.addStructureTreeElement(area, fobj.getStructureTreeElement());
        if (fobj.hasInternalDestination()) {
            String idref = fobj.getInternalDestination();
            PageSequenceLayoutManager pslm = getPSLM();
            // the INTERNAL_LINK trait is added by the LinkResolver
            // if and when the link is resolved:
            LinkResolver res = new LinkResolver(idref, area);
            res.resolveIDRef(idref, pslm.getFirstPVWithID(idref));
            if (!res.isResolved()) {
                pslm.addUnresolvedArea(idref, res);
                if ( area instanceof BasicLinkArea ) {
                    // establish back-pointer from BasicLinkArea to LinkResolver to
                    // handle inline area unflattening during line bidi reordering;
                    // needed to create internal link trait on synthesized basic link area
                    ((BasicLinkArea)area).setResolver(res);
                }
            }
        } else if (fobj.hasExternalDestination()) {
            String url = URISpecification.getURL(fobj.getExternalDestination());
            boolean newWindow = (fobj.getShowDestination() == Constants.EN_NEW);
            if (url.length() > 0) {
                area.addTrait(Trait.EXTERNAL_LINK,
                        new Trait.ExternalLink(url, newWindow));
            }
        }
View Full Code Here


     * Detect internal or external link and add it as an area trait
     *
     * @param area the basic-link's area
     */
    private void setupBasicLinkArea(InlineArea area) {
        BasicLink fobj = (BasicLink) this.fobj;
        // internal destinations take precedence:
        TraitSetter.addPtr(area, fobj.getPtr()); // used for accessibility
        if (fobj.hasInternalDestination()) {
            String idref = fobj.getInternalDestination();
            PageSequenceLayoutManager pslm = getPSLM();
            // the INTERNAL_LINK trait is added by the LinkResolver
            // if and when the link is resolved:
            LinkResolver res = new LinkResolver(idref, area);
            res.resolveIDRef(idref, pslm.getFirstPVWithID(idref));
            if (!res.isResolved()) {
                pslm.addUnresolvedArea(idref, res);
            }
        } else if (fobj.hasExternalDestination()) {
            String url = URISpecification.getURL(fobj.getExternalDestination());
            boolean newWindow = (fobj.getShowDestination() == Constants.EN_NEW);
            if (url.length() > 0) {
                area.addTrait(Trait.EXTERNAL_LINK,
                        new Trait.ExternalLink(url, newWindow));
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.flow.BasicLink$Maker

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.