本文整理了Java中com.lowagie.text.Anchor.setReference()
方法的一些代码示例,展示了Anchor.setReference()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Anchor.setReference()
方法的具体详情如下:
包路径:com.lowagie.text.Anchor
类名称:Anchor
方法名:setReference
[英]Sets the reference of this Anchor
.
[中]设置此Anchor
的引用。
代码示例来源:origin: javamelody/javamelody
private void addPsCommandReference() throws DocumentException {
final Anchor psAnchor = new Anchor("ps command reference", PdfFonts.BLUE.getFont());
psAnchor.setName("ps command reference");
psAnchor.setReference("http://en.wikipedia.org/wiki/Ps_(Unix)");
psAnchor.setFont(PdfFonts.BLUE.getFont());
final Paragraph psParagraph = new Paragraph();
psParagraph.add(psAnchor);
psParagraph.setAlignment(Element.ALIGN_RIGHT);
addToDocument(psParagraph);
}
代码示例来源:origin: javamelody/javamelody
private void addConfigurationReference() throws DocumentException {
final Anchor quartzAnchor = new Anchor("Configuration reference", PdfFonts.BLUE.getFont());
quartzAnchor.setName("Quartz configuration reference");
quartzAnchor.setReference("http://www.quartz-scheduler.org/docs/index.html");
quartzAnchor.setFont(PdfFonts.BLUE.getFont());
final Paragraph quartzParagraph = new Paragraph();
quartzParagraph.add(quartzAnchor);
quartzParagraph.setAlignment(Element.ALIGN_RIGHT);
addToDocument(quartzParagraph);
}
代码示例来源:origin: javamelody/javamelody
private void addConfigurationReference() throws DocumentException {
final Anchor ehcacheAnchor = new Anchor("Configuration reference", PdfFonts.BLUE.getFont());
ehcacheAnchor.setName("Ehcache configuration reference");
ehcacheAnchor.setReference(
"http://ehcache.sourceforge.net/apidocs/net/sf/ehcache/config/CacheConfiguration.html#field_summary");
ehcacheAnchor.setFont(PdfFonts.BLUE.getFont());
final Paragraph ehcacheParagraph = new Paragraph();
ehcacheParagraph.add(ehcacheAnchor);
ehcacheParagraph.setAlignment(Element.ALIGN_RIGHT);
addToDocument(ehcacheParagraph);
}
代码示例来源:origin: javamelody/javamelody
private void writeDatabaseVersionAndDataSourceDetails(JavaInformations javaInformations) {
if (!noDatabase && javaInformations.getDataBaseVersion() != null) {
addCell(getString("Base_de_donnees") + ':');
addCell(javaInformations.getDataBaseVersion());
}
if (javaInformations.getDataSourceDetails() != null) {
addCell(getString("DataSource_jdbc") + ':');
addCell(javaInformations.getDataSourceDetails());
addCell("");
final Anchor anchor = new Anchor("DataSource reference", PdfFonts.BLUE.getFont());
anchor.setName("DataSource reference");
anchor.setReference(
"http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html");
currentTable.addCell(anchor);
}
}
代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext
/**
* Constructs an <CODE>Anchor</CODE> with a certain <CODE>Phrase</CODE>.
*
* @param phrase a <CODE>Phrase</CODE>
*/
public Anchor(Phrase phrase) {
super(phrase);
if (phrase instanceof Anchor) {
Anchor a = (Anchor) phrase;
setName(a.name);
setReference(a.reference);
}
}
代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae
/**
* Constructs an <CODE>Anchor</CODE> with a certain <CODE>Phrase</CODE>.
*
* @param phrase a <CODE>Phrase</CODE>
*/
public Anchor(Phrase phrase) {
super(phrase);
if (phrase instanceof Anchor) {
Anchor a = (Anchor) phrase;
setName(a.name);
setReference(a.reference);
}
}
代码示例来源:origin: com.github.librepdf/openpdf
/**
* Constructs an <CODE>Anchor</CODE> with a certain <CODE>Phrase</CODE>.
*
* @param phrase a <CODE>Phrase</CODE>
*/
public Anchor(Phrase phrase) {
super(phrase);
if (phrase instanceof Anchor) {
Anchor a = (Anchor) phrase;
setName(a.name);
setReference(a.reference);
}
}
代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-cms
public Object visit(WikiLink node, Object data) {
String[] s = WikiHelper.split(node.image, WikiHelper.LINK_DELIMITER);
Anchor a = new Anchor(s[0], defaultFont_);
a.setReference(s[1]);
return a;
}
代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext
/**
* Creates an Anchor object based on a list of properties.
* @param attributes
* @return an Anchor
*/
public static Anchor getAnchor(Properties attributes) {
Anchor anchor = new Anchor(getPhrase(attributes));
String value;
value = attributes.getProperty(ElementTags.NAME);
if (value != null) {
anchor.setName(value);
}
value = (String) attributes.remove(ElementTags.REFERENCE);
if (value != null) {
anchor.setReference(value);
}
return anchor;
}
代码示例来源:origin: com.github.librepdf/openpdf
/**
* Creates an Anchor object based on a list of properties.
* @param attributes
* @return an Anchor
*/
public static Anchor getAnchor(Properties attributes) {
Anchor anchor = new Anchor(getPhrase(attributes));
String value;
value = attributes.getProperty(ElementTags.NAME);
if (value != null) {
anchor.setName(value);
}
value = (String) attributes.remove(ElementTags.REFERENCE);
if (value != null) {
anchor.setReference(value);
}
return anchor;
}
代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae
/**
* Creates an Anchor object based on a list of properties.
* @param attributes
* @return an Anchor
*/
public static Anchor getAnchor(Properties attributes) {
Anchor anchor = new Anchor(getPhrase(attributes));
String value;
value = attributes.getProperty(ElementTags.NAME);
if (value != null) {
anchor.setName(value);
}
value = (String) attributes.remove(ElementTags.REFERENCE);
if (value != null) {
anchor.setReference(value);
}
return anchor;
}
代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-cms
public Object visit(WikiAlias node, Object data) {
String[] s = WikiHelper.split(node.image, WikiHelper.ALIAS_DELIMITER);
Element e = null;
if (node.islink) { // URL case, same as WikiLink
e = new Anchor(s[0], defaultFont_);
((Anchor) e).setReference(s[1]);
} else {
String[] t = WikiHelper.split(s[1], WikiHelper.ANCHOR_MARK);
try {
if (t[0] == null || t[0].equals("")) {// only anchors, local
// reference
e = new Anchor(s[0], defaultFont_);
((Anchor) e).setReference(WikiHelper.ANCHOR_MARK + t[1]);
} else if (ctx.isPageExist(t[0], request_)) {
URL url = ctx.getURLByName(t[0], request_);
String ref = url.toString();
if (t[1] != null && !t[1].equals(""))
ref += WikiHelper.ANCHOR_MARK + t[1];
e = new Anchor(s[0], defaultFont_);
((Anchor) e).setReference(ref);
} else {
e = new Chunk(s[0], defaultFont_);
}
} catch (TgwSecurityException tse) {
e = new Chunk(s[0], defaultFont_);
}
}
return e;
}
代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-cms
public Object visit(WikiPagename node, Object data) {
String[] s = WikiHelper.split(node.image, WikiHelper.ANCHOR_MARK);
Element e = null;
try {
if (ctx.isPageExist(s[0], request_)) {
URL url = config_.getWikiContext().getURLByName(s[0], request_);
e = new Anchor(s[0], defaultFont_);
String ref = url.toString();
if (s[1] != null && !s[1].equals(""))
ref = ref + WikiHelper.ANCHOR_MARK + s[1];
((Anchor) e).setReference(ref);
}
} catch (TgwSecurityException tse) {
e = new Chunk(s[0], defaultFont_);
}
return e;
}
代码示例来源:origin: org.jboss.seam/jboss-seam-pdf
@Override
public void createITextObject(FacesContext context)
{
anchor = new Anchor();
name = (String) valueBinding(context, "name", name);
if (name != null)
{
anchor.setName(name);
}
reference = (String) valueBinding(context, "reference", reference);
if (reference != null)
{
anchor.setReference(reference);
}
}
代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-cms
((Anchor) e).setReference(node.letter);
URL url = ctx.getURLByName(node.letter, request_);
e = new Anchor(node.letter);
((Anchor) e).setReference(url.toString());
代码示例来源:origin: net.bull.javamelody/javamelody-core
private void addPsCommandReference() throws DocumentException {
final Anchor psAnchor = new Anchor("ps command reference", PdfFonts.BLUE.getFont());
psAnchor.setName("ps command reference");
psAnchor.setReference("http://en.wikipedia.org/wiki/Ps_(Unix)");
psAnchor.setFont(PdfFonts.BLUE.getFont());
final Paragraph psParagraph = new Paragraph();
psParagraph.add(psAnchor);
psParagraph.setAlignment(Element.ALIGN_RIGHT);
addToDocument(psParagraph);
}
代码示例来源:origin: net.bull.javamelody/javamelody-core
private void addConfigurationReference() throws DocumentException {
final Anchor quartzAnchor = new Anchor("Configuration reference", PdfFonts.BLUE.getFont());
quartzAnchor.setName("Quartz configuration reference");
quartzAnchor.setReference("http://www.quartz-scheduler.org/docs/index.html");
quartzAnchor.setFont(PdfFonts.BLUE.getFont());
final Paragraph quartzParagraph = new Paragraph();
quartzParagraph.add(quartzAnchor);
quartzParagraph.setAlignment(Element.ALIGN_RIGHT);
addToDocument(quartzParagraph);
}
代码示例来源:origin: net.bull.javamelody/javamelody-core
private void addConfigurationReference() throws DocumentException {
final Anchor ehcacheAnchor = new Anchor("Configuration reference", PdfFonts.BLUE.getFont());
ehcacheAnchor.setName("Ehcache configuration reference");
ehcacheAnchor.setReference(
"http://ehcache.sourceforge.net/apidocs/net/sf/ehcache/config/CacheConfiguration.html#field_summary");
ehcacheAnchor.setFont(PdfFonts.BLUE.getFont());
final Paragraph ehcacheParagraph = new Paragraph();
ehcacheParagraph.add(ehcacheAnchor);
ehcacheParagraph.setAlignment(Element.ALIGN_RIGHT);
addToDocument(ehcacheParagraph);
}
代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-ext
a.setReference(href);
e = (Element)a;
代码示例来源:origin: net.bull.javamelody/javamelody-core
private void writeDatabaseVersionAndDataSourceDetails(JavaInformations javaInformations) {
if (!noDatabase && javaInformations.getDataBaseVersion() != null) {
addCell(getString("Base_de_donnees") + ':');
addCell(javaInformations.getDataBaseVersion());
}
if (javaInformations.getDataSourceDetails() != null) {
addCell(getString("DataSource_jdbc") + ':');
addCell(javaInformations.getDataSourceDetails());
addCell("");
final Anchor anchor = new Anchor("DataSource reference", PdfFonts.BLUE.getFont());
anchor.setName("DataSource reference");
anchor.setReference(
"http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html");
currentTable.addCell(anchor);
}
}
内容来源于网络,如有侵权,请联系作者删除!