protected void setHyperlinkCell(JRPrintHyperlink hyperlink)
{
String href = null;
Hyperlink link = null;
JRHyperlinkProducer customHandler = getHyperlinkProducer(hyperlink);
if (customHandler == null)
{
switch (hyperlink.getHyperlinkTypeValue())
{
case REFERENCE:
{
href = hyperlink.getHyperlinkReference();
if (href != null)
{
link = createHelper.createHyperlink(Hyperlink.LINK_URL);
link.setAddress(href);
}
break;
}
case LOCAL_ANCHOR :
{
href = hyperlink.getHyperlinkAnchor();
if (href != null)
{
link = createHelper.createHyperlink(Hyperlink.LINK_DOCUMENT);
if(anchorLinks.containsKey(href))
{
((List)anchorLinks.get(href)).add(link);
}
else
{
List hrefList = new ArrayList();
hrefList.add(link);
anchorLinks.put(href, hrefList);
}
}
break;
}
case LOCAL_PAGE :
{
Integer hrefPage = hyperlink.getHyperlinkPage();
if (hrefPage != null)
{
link = createHelper.createHyperlink(Hyperlink.LINK_DOCUMENT);
if(pageLinks.containsKey(hrefPage))
{
((List)pageLinks.get(hrefPage)).add(link);
}
else
{
List hrefList = new ArrayList();
hrefList.add(link);
pageLinks.put(hrefPage, hrefList);
}
}
break;
}
case REMOTE_ANCHOR :
{
href = hyperlink.getHyperlinkReference();
if (href != null && hyperlink.getHyperlinkAnchor() != null)
{
href = href + "#" + hyperlink.getHyperlinkAnchor();
link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
link.setAddress(href);
}
break;
}
case REMOTE_PAGE :
{
href = hyperlink.getHyperlinkReference();
if (href != null && hyperlink.getHyperlinkPage() != null)
{
href = href + "#JR_PAGE_ANCHOR_0_" + hyperlink.getHyperlinkPage().toString();
link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
link.setAddress(href);
}
break;
}