1 17 18 19 20 package org.apache.fop.area; 21 22 import java.util.List ; 24 import java.io.Serializable ; 25 26 import org.apache.fop.area.Trait; 28 import org.apache.fop.area.Resolvable; 29 import org.apache.fop.area.PageViewport; 30 import org.apache.fop.area.Area; 31 32 35 public class LinkResolver implements Resolvable, Serializable { 36 private boolean resolved = false; 37 private String idRef; 38 private Area area; 39 40 46 public LinkResolver(String id, Area a) { 47 idRef = id; 48 area = a; 49 } 50 51 54 public boolean isResolved() { 55 return resolved; 56 } 57 58 63 public String [] getIDRefs() { 64 return new String [] {idRef}; 65 } 66 67 72 public void resolveIDRef(String id, List pages) { 73 if (idRef.equals(id) && pages != null) { 74 resolved = true; 75 PageViewport page = (PageViewport)pages.get(0); 76 area.addTrait(Trait.INTERNAL_LINK, page.getKey()); 77 } 78 } 79 } 80 | Popular Tags |