本文整理匯總了Java中com.lowagie.text.Element.ANCHOR屬性的典型用法代碼示例。如果您正苦於以下問題:Java Element.ANCHOR屬性的具體用法?Java Element.ANCHOR怎麽用?Java Element.ANCHOR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.lowagie.text.Element
的用法示例。
在下文中一共展示了Element.ANCHOR屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processActions
/**
* Processes all actions contained in the cell.
* @param element an element in the cell
* @param action an action that should be coupled to the cell
* @param allActions
*/
protected void processActions(Element element, PdfAction action, ArrayList allActions) {
if (element.type() == Element.ANCHOR) {
String url = ((Anchor) element).getReference();
if (url != null) {
action = new PdfAction(url);
}
}
Iterator i;
switch (element.type()) {
case Element.PHRASE:
case Element.SECTION:
case Element.ANCHOR:
case Element.CHAPTER:
case Element.LISTITEM:
case Element.PARAGRAPH:
for (i = ((ArrayList) element).iterator(); i.hasNext();) {
processActions((Element) i.next(), action, allActions);
}
break;
case Element.CHUNK:
allActions.add(action);
break;
case Element.LIST:
for (i = ((List) element).getItems().iterator(); i.hasNext();) {
processActions((Element) i.next(), action, allActions);
}
break;
default:
int n = element.getChunks().size();
while (n-- > 0)
allActions.add(action);
break;
}
}