本文整理汇总了Java中org.apache.poi.hwpf.usermodel.Bookmark类的典型用法代码示例。如果您正苦于以下问题:Java Bookmark类的具体用法?Java Bookmark怎么用?Java Bookmark使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Bookmark类属于org.apache.poi.hwpf.usermodel包,在下文中一共展示了Bookmark类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processBookmarks
import org.apache.poi.hwpf.usermodel.Bookmark; //导入依赖的package包/类
@Override
protected void processBookmarks( HWPFDocumentCore wordDocument,
Element currentBlock, Range range, int currentTableLevel,
List<Bookmark> rangeBookmarks )
{
Element parent = currentBlock;
for ( Bookmark bookmark : rangeBookmarks )
{
Element bookmarkElement = foDocumentFacade.createInline();
final String idName = "bookmark_" + bookmark.getName();
// make sure ID used once
if ( setId( bookmarkElement, idName ) )
{
/*
* if it just empty fo:inline without "id" attribute doesn't
* making sense to add it to DOM
*/
parent.appendChild( bookmarkElement );
parent = bookmarkElement;
}
}
if ( range != null )
processCharacters( wordDocument, currentTableLevel, range, parent );
}
示例2: processBookmarks
import org.apache.poi.hwpf.usermodel.Bookmark; //导入依赖的package包/类
@Override
protected void processBookmarks( HWPFDocumentCore wordDocument,
Element currentBlock, Range range, int currentTableLevel,
List<Bookmark> rangeBookmarks )
{
Element parent = currentBlock;
for ( Bookmark bookmark : rangeBookmarks )
{
Element bookmarkElement = htmlDocumentFacade
.createBookmark( bookmark.getName() );
parent.appendChild( bookmarkElement );
parent = bookmarkElement;
}
if ( range != null )
processCharacters( wordDocument, currentTableLevel, range, parent );
}
示例3: dumpBookmarks
import org.apache.poi.hwpf.usermodel.Bookmark; //导入依赖的package包/类
private void dumpBookmarks()
{
if ( !( _doc instanceof HWPFDocument ) )
{
System.out.println( "Word 95 not supported so far" );
return;
}
HWPFDocument document = (HWPFDocument) _doc;
Bookmarks bookmarks = document.getBookmarks();
for ( int b = 0; b < bookmarks.getBookmarksCount(); b++ )
{
Bookmark bookmark = bookmarks.getBookmark( b );
System.out.println( "[" + bookmark.getStart() + "; "
+ bookmark.getEnd() + "): " + bookmark.getName() );
}
}
示例4: printInfo
import org.apache.poi.hwpf.usermodel.Bookmark; //导入依赖的package包/类
/**
* 输出书签信息
*
* @param bookmarks
*/
private void printInfo(Bookmarks bookmarks) {
int count = bookmarks.getBookmarksCount();
System.out.println("书签数量:" + count);
Bookmark bookmark;
for (int i = 0; i < count; i++) {
bookmark = bookmarks.getBookmark(i);
System.out.println("书签" + (i + 1) + "的名称是:" + bookmark.getName());
System.out.println("开始位置:" + bookmark.getStart());
System.out.println("结束位置:" + bookmark.getEnd());
}
}
示例5: processBookmarks
import org.apache.poi.hwpf.usermodel.Bookmark; //导入依赖的package包/类
@Override
protected void processBookmarks( HWPFDocumentCore wordDocument,
Element currentBlock, Range range, int currentTableLevel,
List<Bookmark> rangeBookmarks )
{
processCharacters( wordDocument, currentTableLevel, range, currentBlock );
}
示例6: Structure
import org.apache.poi.hwpf.usermodel.Bookmark; //导入依赖的package包/类
Structure( Bookmark bookmark )
{
this.start = bookmark.getStart();
this.end = bookmark.getEnd();
this.structure = bookmark;
}
示例7: processBookmarks
import org.apache.poi.hwpf.usermodel.Bookmark; //导入依赖的package包/类
/**
* Wrap range into bookmark(s) and process it. All bookmarks have starts
* equal to range start and ends equal to range end. Usually it's only one
* bookmark.
*/
protected abstract void processBookmarks( HWPFDocumentCore wordDocument,
Element currentBlock, Range range, int currentTableLevel,
List<Bookmark> rangeBookmarks );