本文整理汇总了Java中net.sf.jasperreports.engine.JRPrintHyperlink.getHyperlinkTypeValue方法的典型用法代码示例。如果您正苦于以下问题:Java JRPrintHyperlink.getHyperlinkTypeValue方法的具体用法?Java JRPrintHyperlink.getHyperlinkTypeValue怎么用?Java JRPrintHyperlink.getHyperlinkTypeValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.engine.JRPrintHyperlink
的用法示例。
在下文中一共展示了JRPrintHyperlink.getHyperlinkTypeValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLinkToolTip
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入方法依赖的package包/类
private String getLinkToolTip(JRPrintHyperlink link) {
String tTip = link.getHyperlinkTooltip();
if (tTip == null) {
HyperlinkTypeEnum hType = link.getHyperlinkTypeValue();
if (hType.equals(HyperlinkTypeEnum.REFERENCE))
tTip = link.getHyperlinkReference();
else if (hType.equals(HyperlinkTypeEnum.LOCAL_ANCHOR)) {
if (link.getHyperlinkAnchor() != null)
tTip = "#" + link.getHyperlinkAnchor(); //$NON-NLS-1$
} else if (hType.equals(HyperlinkTypeEnum.LOCAL_PAGE)) {
if (link.getHyperlinkPage() != null)
tTip = "#page " + link.getHyperlinkPage(); //$NON-NLS-1$
} else if (hType.equals(HyperlinkTypeEnum.REMOTE_ANCHOR)) {
if (link.getHyperlinkReference() != null)
tTip = link.getHyperlinkReference();
if (currentLink.getHyperlinkAnchor() != null)
tTip = "#" + currentLink.getHyperlinkAnchor(); //$NON-NLS-1$
} else if (hType.equals(HyperlinkTypeEnum.REMOTE_PAGE)) {
if (link.getHyperlinkReference() != null)
tTip = link.getHyperlinkReference();
if (link.getHyperlinkPage() != null)
tTip = "#page " + link.getHyperlinkPage(); //$NON-NLS-1$
}
}
return tTip;
}
示例2: getHyperlinkURL
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入方法依赖的package包/类
/**
*
*/
protected String getHyperlinkURL(JRPrintHyperlink link, boolean isOnePagePerSheet)
{
String href = null;
JRHyperlinkProducer customHandler = getHyperlinkProducer(link);
if (customHandler == null)
{
switch(link.getHyperlinkTypeValue())
{
case REFERENCE :
{
if (link.getHyperlinkReference() != null)
{
href = link.getHyperlinkReference();
}
break;
}
case LOCAL_ANCHOR :
{
if (link.getHyperlinkAnchor() != null)
{
href = "#" + link.getHyperlinkAnchor();
}
break;
}
case LOCAL_PAGE :
{
if (link.getHyperlinkPage() != null)
{
href = "#" + JR_PAGE_ANCHOR_PREFIX + getReportIndex() + "_" + (isOnePagePerSheet ? link.getHyperlinkPage().toString() : "1");
}
break;
}
case REMOTE_ANCHOR :
{
if (
link.getHyperlinkReference() != null &&
link.getHyperlinkAnchor() != null
)
{
href = link.getHyperlinkReference() + "#" + link.getHyperlinkAnchor();
}
break;
}
case REMOTE_PAGE :
{
if (
link.getHyperlinkReference() != null &&
link.getHyperlinkPage() != null
)
{
href = link.getHyperlinkReference() + "#" + JR_PAGE_ANCHOR_PREFIX + "0_" + link.getHyperlinkPage().toString();
}
break;
}
case NONE :
default :
{
break;
}
}
}
else
{
href = customHandler.getHyperlink(link);
}
return href;
}
示例3: resolveHyperlinkURL
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入方法依赖的package包/类
/**
*
*/
protected String resolveHyperlinkURL(int reportIndex, JRPrintHyperlink link)
{
String href = null;
Boolean ignoreHyperlink = HyperlinkUtil.getIgnoreHyperlink(HtmlReportConfiguration.PROPERTY_IGNORE_HYPERLINK, link);
if (ignoreHyperlink == null)
{
ignoreHyperlink = getCurrentItemConfiguration().isIgnoreHyperlink();
}
if (!ignoreHyperlink)
{
JRHyperlinkProducer customHandler = getHyperlinkProducer(link);
if (customHandler == null)
{
switch(link.getHyperlinkTypeValue())
{
case REFERENCE :
{
if (link.getHyperlinkReference() != null)
{
href = link.getHyperlinkReference();
}
break;
}
case LOCAL_ANCHOR :
{
if (link.getHyperlinkAnchor() != null)
{
href = "#" + link.getHyperlinkAnchor();
}
break;
}
case LOCAL_PAGE :
{
if (link.getHyperlinkPage() != null)
{
href = "#" + HtmlExporter.JR_PAGE_ANCHOR_PREFIX + reportIndex + "_" + link.getHyperlinkPage().toString();
}
break;
}
case REMOTE_ANCHOR :
{
if (
link.getHyperlinkReference() != null &&
link.getHyperlinkAnchor() != null
)
{
href = link.getHyperlinkReference() + "#" + link.getHyperlinkAnchor();
}
break;
}
case REMOTE_PAGE :
{
if (
link.getHyperlinkReference() != null &&
link.getHyperlinkPage() != null
)
{
href = link.getHyperlinkReference() + "#" + HtmlExporter.JR_PAGE_ANCHOR_PREFIX + "0_" + link.getHyperlinkPage().toString();
}
break;
}
case NONE :
default :
{
break;
}
}
}
else
{
href = customHandler.getHyperlink(link);
}
}
return href;
}
示例4: resolveHyperlinkURL
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入方法依赖的package包/类
protected String resolveHyperlinkURL(int reportIndex, JRPrintHyperlink link)
{
String href = null;
Boolean ignoreHyperlink = HyperlinkUtil.getIgnoreHyperlink(HtmlReportConfiguration.PROPERTY_IGNORE_HYPERLINK, link);
if (ignoreHyperlink == null)
{
ignoreHyperlink = getCurrentItemConfiguration().isIgnoreHyperlink();
}
if (!ignoreHyperlink)
{
JRHyperlinkProducer customHandler = getHyperlinkProducer(link);
if (customHandler == null)
{
switch(link.getHyperlinkTypeValue())
{
case REFERENCE :
{
if (link.getHyperlinkReference() != null)
{
href = link.getHyperlinkReference();
}
break;
}
case LOCAL_ANCHOR :
{
if (link.getHyperlinkAnchor() != null)
{
href = "#" + link.getHyperlinkAnchor();
}
break;
}
case LOCAL_PAGE :
{
if (link.getHyperlinkPage() != null)
{
href = "#" + JR_PAGE_ANCHOR_PREFIX + reportIndex + "_" + link.getHyperlinkPage().toString();
}
break;
}
case REMOTE_ANCHOR :
{
if (
link.getHyperlinkReference() != null &&
link.getHyperlinkAnchor() != null
)
{
href = link.getHyperlinkReference() + "#" + link.getHyperlinkAnchor();
}
break;
}
case REMOTE_PAGE :
{
if (
link.getHyperlinkReference() != null &&
link.getHyperlinkPage() != null
)
{
href = link.getHyperlinkReference() + "#" + JR_PAGE_ANCHOR_PREFIX + "0_" + link.getHyperlinkPage().toString();
}
break;
}
case NONE :
default :
{
break;
}
}
}
else
{
href = customHandler.getHyperlink(link);
}
}
return href;
}
示例5: startHyperlink
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入方法依赖的package包/类
protected boolean startHyperlink(JRPrintHyperlink link, boolean isText)
{
String href = getHyperlinkURL(link);
if (href != null)
{
// String id = (String)hyperlinksMap.get(href);
// if (id == null)
// {
// id = "link" + hyperlinksMap.size();
// hyperlinksMap.put(href, id);
// }
//
// docHelper.write("<w:hyperlink r:id=\"" + id + "\"");
//
// String target = getHyperlinkTarget(link);//FIXMETARGET
// if (target != null)
// {
// docHelper.write(" tgtFrame=\"" + target + "\"");
// }
//
// docHelper.write(">\n");
docHelper.write("<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>\n");
String localType = (HyperlinkTypeEnum.LOCAL_ANCHOR == link.getHyperlinkTypeValue() ||
HyperlinkTypeEnum.LOCAL_PAGE == link.getHyperlinkTypeValue()) ? "\\l " : "";
docHelper.write("<w:r><w:instrText xml:space=\"preserve\"> HYPERLINK " + localType +"\"" + JRStringUtil.xmlEncode(href,invalidCharReplacement) + "\"");
String target = getHyperlinkTarget(link);//FIXMETARGET
if (target != null)
{
docHelper.write(" \\t \"" + target + "\"");
}
String tooltip = link.getHyperlinkTooltip();
if (tooltip != null)
{
docHelper.write(" \\o \"" + JRStringUtil.xmlEncode(tooltip, invalidCharReplacement) + "\"");
}
docHelper.write(" </w:instrText></w:r>\n");
docHelper.write("<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>\n");
}
return href != null;
}
示例6: getHyperlinkURL
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入方法依赖的package包/类
protected String getHyperlinkURL(JRPrintHyperlink link)
{
String href = null;
Boolean ignoreHyperlink = HyperlinkUtil.getIgnoreHyperlink(DocxReportConfiguration.PROPERTY_IGNORE_HYPERLINK, link);
if (ignoreHyperlink == null)
{
ignoreHyperlink = getCurrentItemConfiguration().isIgnoreHyperlink();
}
if (!ignoreHyperlink)
{
JRHyperlinkProducer customHandler = getHyperlinkProducer(link);
if (customHandler == null)
{
switch(link.getHyperlinkTypeValue())
{
case REFERENCE :
{
if (link.getHyperlinkReference() != null)
{
href = link.getHyperlinkReference();
}
break;
}
case LOCAL_ANCHOR :
{
if (link.getHyperlinkAnchor() != null)
{
href = link.getHyperlinkAnchor().replaceAll("\\W", "");
}
break;
}
case LOCAL_PAGE :
{
if (link.getHyperlinkPage() != null)
{
href = JR_PAGE_ANCHOR_PREFIX + reportIndex + "_" + link.getHyperlinkPage().toString();
}
break;
}
case REMOTE_ANCHOR :
{
if (
link.getHyperlinkReference() != null &&
link.getHyperlinkAnchor() != null
)
{
href = link.getHyperlinkReference() + "#" + link.getHyperlinkAnchor();
}
break;
}
case REMOTE_PAGE :
{
if (
link.getHyperlinkReference() != null &&
link.getHyperlinkPage() != null
)
{
href = link.getHyperlinkReference() + "#" + JR_PAGE_ANCHOR_PREFIX + reportIndex + "_" + link.getHyperlinkPage().toString();
}
break;
}
case NONE :
default :
{
break;
}
}
}
else
{
href = customHandler.getHyperlink(link);
}
}
return href;
}
示例7: getFallbackTooltip
import net.sf.jasperreports.engine.JRPrintHyperlink; //导入方法依赖的package包/类
protected String getFallbackTooltip(JRPrintHyperlink hyperlink)
{
String toolTip = null;
switch(hyperlink.getHyperlinkTypeValue())
{
case REFERENCE :
{
toolTip = hyperlink.getHyperlinkReference();
break;
}
case LOCAL_ANCHOR :
{
if (hyperlink.getHyperlinkAnchor() != null)
{
toolTip = "#" + hyperlink.getHyperlinkAnchor();
}
break;
}
case LOCAL_PAGE :
{
if (hyperlink.getHyperlinkPage() != null)
{
toolTip = "#page " + hyperlink.getHyperlinkPage();
}
break;
}
case REMOTE_ANCHOR :
{
toolTip = "";
if (hyperlink.getHyperlinkReference() != null)
{
toolTip = toolTip + hyperlink.getHyperlinkReference();
}
if (hyperlink.getHyperlinkAnchor() != null)
{
toolTip = toolTip + "#" + hyperlink.getHyperlinkAnchor();
}
break;
}
case REMOTE_PAGE :
{
toolTip = "";
if (hyperlink.getHyperlinkReference() != null)
{
toolTip = toolTip + hyperlink.getHyperlinkReference();
}
if (hyperlink.getHyperlinkPage() != null)
{
toolTip = toolTip + "#page " + hyperlink.getHyperlinkPage();
}
break;
}
default :
{
break;
}
}
return toolTip;
}