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


Java TOCView类代码示例

本文整理汇总了Java中javax.help.TOCView的典型用法代码示例。如果您正苦于以下问题:Java TOCView类的具体用法?Java TOCView怎么用?Java TOCView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TOCView类属于javax.help包,在下文中一共展示了TOCView类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkHelpSet

import javax.help.TOCView; //导入依赖的package包/类
private void checkHelpSet(File hsfile) throws Exception {
    log("Checking helpset: " + hsfile);
    HelpSet hs = new HelpSet(null, hsfile.toURI().toURL());
    javax.help.Map map = hs.getCombinedMap();
    log("Parsed helpset, checking map IDs in TOC/Index navigators...");
    NavigatorView[] navs = hs.getNavigatorViews();
    for (int i = 0; i < navs.length; i++) {
        String name = navs[i].getName();
        File navfile = new File(hsfile.getParentFile(), (String)navs[i].getParameters().get("data"));
        if (! navfile.exists()) throw new BuildException("Navigator " + name + " not found", new Location(navfile.getAbsolutePath()));
        if (navs[i] instanceof IndexView) {
            log("Checking index navigator " + name, Project.MSG_VERBOSE);
            IndexView.parse(navfile.toURI().toURL(), hs, Locale.getDefault(), new VerifyTIFactory(hs, map, navfile, false));
        } else if (navs[i] instanceof TOCView) {
            log("Checking TOC navigator " + name, Project.MSG_VERBOSE);
            TOCView.parse(navfile.toURI().toURL(), hs, Locale.getDefault(), new VerifyTIFactory(hs, map, navfile, true));
        } else {
            log("Skipping non-TOC/Index view: " + name, Project.MSG_VERBOSE);
        }
    }
    log("Checking for duplicate map IDs...");
    HelpSet.parse(hsfile.toURI().toURL(), null, new VerifyHSFactory());
    log("Checking links from help map and between HTML files...");
    @SuppressWarnings("unchecked")
    Enumeration<javax.help.Map.ID> e = map.getAllIDs();
    Set<URI> okurls = new HashSet<>(1000);
    Set<URI> badurls = new HashSet<>(1000);
    Set<URI> cleanurls = new HashSet<>(1000);
    while (e.hasMoreElements()) {
        javax.help.Map.ID id = e.nextElement();
        URL u = map.getURLFromID(id);
        if (u == null) {
            throw new BuildException("Bogus map ID: " + id.id, new Location(hsfile.getAbsolutePath()));
        }
        log("Checking ID " + id.id, Project.MSG_VERBOSE);
        List<String> errors = new ArrayList<>();
        CheckLinks.scan(this, null, null, id.id, "", 
        u.toURI(), okurls, badurls, cleanurls, false, false, false, 2, 
        Collections.<Mapper>emptyList(), errors);
        for (String error : errors) {
            log(error, Project.MSG_WARN);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:45,代码来源:CheckHelpSets.java


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