Пример #1
0
  /**
   * Generate a URL for a reference to a binding.
   *
   * @param nb the referenced binding
   * @param path the path containing the reference, or null if there was an error
   */
  private String toURL(NBinding nb, String path) {
    Def def = nb.getSignatureNode();
    if (def == null) {
      return null;
    }
    if (nb.isBuiltin()) {
      return def.getURL();
    }

    if (def.isModule()) {
      return toModuleUrl(nb);
    }

    String anchor = "#" + nb.getQname();
    if (nb.getFirstFile().equals(path)) {
      return anchor;
    }

    String destPath = def.getFile();
    try {
      String relpath = destPath.substring(rootPath.length());
      return Util.joinPath(outDir.getAbsolutePath(), relpath) + ".html" + anchor;
    } catch (Exception x) {
      System.err.println("path problem:  dest=" + destPath + ", root=" + rootPath + ": " + x);
      return null;
    }
  }
Пример #2
0
 /** Create name anchors for definition sites. */
 private void processDefs(NBinding nb) {
   Def def = nb.getSignatureNode();
   if (def == null || def.isURL()) {
     return;
   }
   StyleRun style = new StyleRun(StyleRun.Type.ANCHOR, def.start(), def.length());
   style.message = nb.getQname();
   style.url = nb.getQname();
   addFileStyle(def.getFile(), style);
 }
Пример #3
0
 private void addSemanticStyle(Def def, StyleRun.Type type) {
   String path = def.getFile();
   if (path != null) {
     addFileStyle(path, new StyleRun(type, def.start(), def.length()));
   }
 }