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


Java Bookmark类代码示例

本文整理汇总了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 );
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:26,代码来源:WordToFoConverter.java

示例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 );
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:18,代码来源:WordToHtmlConverter.java

示例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() );
    }
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:18,代码来源:HWPFLister.java

示例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());
	}
}
 
开发者ID:East196,项目名称:maker,代码行数:17,代码来源:HwpfTest.java

示例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 );
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:8,代码来源:WordToTextConverter.java

示例6: Structure

import org.apache.poi.hwpf.usermodel.Bookmark; //导入依赖的package包/类
Structure( Bookmark bookmark )
{
    this.start = bookmark.getStart();
    this.end = bookmark.getEnd();
    this.structure = bookmark;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:7,代码来源:AbstractWordConverter.java

示例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 );
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:9,代码来源:AbstractWordConverter.java


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