当前位置: 首页>>代码示例>>Java>>正文


Java JRPrintHyperlink.getHyperlinkTypeValue方法代码示例

本文整理汇总了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;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:27,代码来源:ViewerCanvas.java

示例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;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:72,代码来源:DocumentBuilder.java

示例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;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:82,代码来源:JsonExporter.java

示例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;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:79,代码来源:HtmlExporter.java

示例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;
	}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:48,代码来源:JRDocxExporter.java

示例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;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:79,代码来源:JRDocxExporter.java

示例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;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:60,代码来源:JRViewerPanel.java


注:本文中的net.sf.jasperreports.engine.JRPrintHyperlink.getHyperlinkTypeValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。