Get link for generated class index.

@return a content tree for the link
771250
protected Content getNavLinkIndex() {
        Content linkContent = getHyperLink(pathToRoot.resolve(
                (configuration.splitindex
                    ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1))
                    : DocPaths.INDEX_ALL)),
            indexLabel, "", "");
        Content li = HtmlTree.LI(linkContent);
        return li;
    }
1254968
public String getTree() {

        StringBuffer result = new StringBuffer(2048);

        List<String> targetFolderList = new ArrayList<String>();
        if (getTargetFolder() != null) {
            // check if there is more than one folder to update (e.g. move operation)
            StringTokenizer T = new StringTokenizer(getTargetFolder(), "|");
            while (T.hasMoreTokens()) {
                String currentFolder = T.nextToken().trim();
                //                if (OpenCms.getSiteManager().startsWithShared(currentFolder)) {
                //                    currentFolder = OpenCms.getSiteManager().cutShared(currentFolder);
                //                }
                targetFolderList.add(currentFolder);
            }
        } else {
            targetFolderList.add(null);
        }

        String storedSiteRoot = null;
        try {
            CmsFolder folder = null;
            List<CmsResource> resources = new ArrayList<CmsResource>();
            String oldSiteRoot = getCms().getRequestContext().getSiteRoot();

            Iterator<String> targets = targetFolderList.iterator();
            while (targets.hasNext()) {
                // iterate over all given target folders
                String currentTargetFolder = targets.next();

                if (getSettings().getTreeSite(getTreeType()) != null) {
                    // change the site root for popup window with site selector
                    storedSiteRoot = getCms().getRequestContext().getSiteRoot();
                    if (newTree() && (currentTargetFolder == null)) {
                        currentTargetFolder = "/";
                    }
                    getCms().getRequestContext().setSiteRoot(getSettings().getTreeSite(getTreeType()));
                    try {
                        // check presence of target folder
                        getCms().readFolder(currentTargetFolder, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
                    } catch (CmsException e) {
                        // target folder not found, set it to "/"
                        if (LOG.isInfoEnabled()) {
                            LOG.info(e);
                        }
                        currentTargetFolder = "/";
                    }
                }

                // read the selected folder
                try {
                    folder = getCms().readFolder(currentTargetFolder, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
                } catch (CmsException e) {
                    // return with error
                    return printError(e);
                }

                String startFolder = getStartFolder();
                String rcSite = getCms().getRequestContext().getSiteRoot();
                if (OpenCms.getSiteManager().startsWithShared(currentTargetFolder)
                    && OpenCms.getSiteManager().startsWithShared(rcSite)) {
                    currentTargetFolder = currentTargetFolder.substring(
                        OpenCms.getSiteManager().getSharedFolder().length() - 1);
                }
                if ((startFolder == null) || (!currentTargetFolder.startsWith(startFolder))) {
                    // no (valid) start folder given, just load current folder
                    try {
                        if (includeFiles()) {
                            resources.addAll(getCms().getResourcesInFolder(
                                currentTargetFolder,
                                CmsResourceFilter.ONLY_VISIBLE_NO_DELETED));
                        } else {
                            resources.addAll(
                                getCms().getSubFolders(currentTargetFolder, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED));
                        }
                    } catch (CmsException e) {
                        // return with error
                        return printError(e);
                    }
                } else {
                    // valid start folder given, load all folders between start and current folder
                    try {
                        if (includeFiles()) {
                            resources.addAll(
                                getCms().getResourcesInFolder(startFolder, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED));
                        } else {
                            resources.addAll(
                                getCms().getSubFolders(startFolder, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED));
                        }
                        StringTokenizer tok = new StringTokenizer(
                            currentTargetFolder.substring(startFolder.length()),
                            "/");
                        while (tok.hasMoreTokens()) {
                            startFolder += tok.nextToken() + "/";
                            if (includeFiles()) {
                                resources.addAll(getCms().getResourcesInFolder(
                                    startFolder,
                                    CmsResourceFilter.ONLY_VISIBLE_NO_DELETED));
                            } else {
                                resources.addAll(
                                    getCms().getSubFolders(startFolder, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED));
                            }
                        }
                    } catch (CmsException e) {
                        // return with error
                        return printError(e);
                    }
                }
            }

            result.append("function init() {\n");

            if (newTree()) {
                // new tree must be reloaded
                result.append("parent.initTree();\n");
                result.append(getRootNode());
            }

            // read the list of project resource to select which resource is "inside" or "outside"
            List<String> projectResources = new ArrayList<String>();
            if (isProjectAware()) {
                try {
                    projectResources = getCms().readProjectResources(getCms().getRequestContext().getCurrentProject());
                } catch (CmsException e) {
                    // use an empty list (all resources are "outside")
                    if (LOG.isInfoEnabled()) {
                        LOG.info(e);
                    }
                }
            }

            // now output all the tree nodes
            Iterator<CmsResource> i = resources.iterator();
            while (i.hasNext()) {
                CmsResource resource = i.next();
                boolean grey = false;
                if (isProjectAware()) {
                    grey = !CmsProject.isInsideProject(projectResources, resource);
                }
                if (!grey) {
                    try {
                        OpenCms.getResourceManager().getResourceType(resource.getTypeId());
                    } catch (CmsLoaderException e) {
                        // if resource type is not found
                        grey = true;
                    }
                }

                result.append(
                    getNode(
                        resource.getRootPath(),
                        resource.getName(),
                        resource.getTypeId(),
                        resource.isFolder(),
                        resource.getState(),
                        grey));
            }

            if (includeFiles()) {
                result.append("parent.setIncludeFiles(true);\n");
            }
            result.append("parent.setProjectAware(").append(isProjectAware()).append(");\n");
            if (getTreeType() != null) {
                // this is a popup window tree
                result.append("parent.setTreeType(\"");
                result.append(getTreeType());
                result.append("\");\n");
                String curSite = getSettings().getTreeSite(getTreeType());
                if (curSite != null) {
                    // add the current site as prefix if present
                    result.append("parent.setSitePrefix(\"");
                    result.append(getSitePrefix(curSite, oldSiteRoot));
                    result.append("\");\n");
                }
            }
            // set the root folder in javascript
            result.append("parent.setRootFolder(\"");
            result.append(getRootFolder());
            result.append("\");\n");

            if (folder != null) {
                if (newTree()) {
                    // new tree
                    result.append("parent.showTree(parent.tree_display.document, \"");
                    result.append(folder.getRootPath().hashCode());
                    result.append("\");\n");
                } else {
                    // update the current tree with the children of the selected node
                    if (resources.size() == 0) {
                        // the node had no children
                        result.append("parent.setNoChilds(\"");
                        result.append(folder.getRootPath().hashCode());
                        result.append("\");\n");
                    }
                    result.append("parent.showLoadedNodes(parent.tree_display.document,\"");
                    result.append(folder.getRootPath().hashCode());
                    result.append("\");\n");
                }
            }

            result.append("}\n");
        } finally {
            if (storedSiteRoot != null) {
                getCms().getRequestContext().setSiteRoot(storedSiteRoot);
            }
        }
        return result.toString();
    }
964336
public Content getNavLinkNext() {
        Content li;
        if (next != null) {
            Content nextLink = getLink(new LinkInfoImpl(configuration,
                    LinkInfoImpl.Kind.CLASS, next)
                    .label(nextclassLabel).strong(true));
            li = HtmlTree.LI(nextLink);
        }
        else
            li = HtmlTree.LI(nextclassLabel);
        return li;
    }
589575
public com.google.rpc.Help.LinkOrBuilder getLinksOrBuilder(
      int index) {
    return links_.get(index);
  }
688779
public Content getQualifiedClassLink(LinkInfoImpl.Kind context, Element element) {
        LinkInfoImpl linkInfoImpl = new LinkInfoImpl(configuration, context, (TypeElement)element);
        return getLink(linkInfoImpl.label(utils.getFullyQualifiedName(element)));
    }
1087147
public java.util.List<? extends com.google.rpc.Help.LinkOrBuilder> 
      getLinksOrBuilderList() {
    return links_;
  }
60393
protected Content getNavLinkTree() {
        Content linkContent = utils.isEnclosingPackageIncluded(typeElement)
                ? getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel)
                : getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel);
        Content li = HtmlTree.LI(linkContent);
        return li;
    }
244789
protected Content getNavLinkNext() {
        if (next == null) {
            return getNavLinkNext(null);
        } else {
            DocPath path = DocPath.relativePath(packagedoc, next);
            return getNavLinkNext(path.resolve(DocPaths.PACKAGE_TREE));
        }
    }
1161478
public Content getNavLinkNext() {
        Content nextletterLabel = getResource("doclet.Next_Letter");
        if (next == -1) {
            return HtmlTree.LI(nextletterLabel);
        }
        else {
            Content nextLink = getHyperLink(DocPaths.indexN(next),
                    nextletterLabel);
            return HtmlTree.LI(nextLink);
        }
    }
534476
protected Content getNavLinkHelp() {
        String helpfile = configuration.helpfile;
        DocPath helpfilenm;
        if (helpfile.isEmpty()) {
            helpfilenm = DocPaths.HELP_DOC;
        } else {
            DocFile file = DocFile.createFileForInput(configuration, helpfile);
            helpfilenm = DocPath.create(file.getName());
        }
        Content linkContent = getHyperLink(pathToRoot.resolve(helpfilenm),
                helpLabel, "", "");
        Content li = HtmlTree.LI(linkContent);
        return li;
    }
619382
public Content getClassHeader(ClassDoc classDoc) {
        Content classLink = (classDoc.isPublic() || classDoc.isProtected()) ?
            getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, classDoc)
            .label(configuration.getClassName(classDoc))) :
            new StringContent(classDoc.qualifiedName());
        Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(
                classDoc.qualifiedName()));
        Content superClassLink =
            classDoc.superclassType() != null ?
                getLink(new LinkInfoImpl(configuration,
                        LinkInfoImpl.Kind.SERIALIZED_FORM,
                        classDoc.superclassType())) :
                null;

        //Print the heading.
        Content className = superClassLink == null ?
            configuration.getResource(
            "doclet.Class_0_implements_serializable", classLink) :
            configuration.getResource(
            "doclet.Class_0_extends_implements_serializable", classLink,
            superClassLink);
        li.addContent(HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
                className));
        return li;
    }
100450
protected Content getNavLinkContents() {
        Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.overviewSummary(configuration.frames)),
                contents.overviewLabel, "", "");
        Content li = HtmlTree.LI(linkContent);
        return li;
    }
525072
private Content getTreeForClassHelper(TypeMirror type) {
        Content li = new HtmlTree(HtmlTag.LI);
        if (type.equals(typeElement.asType())) {
            Content typeParameters = getTypeParameterLinks(
                    new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
                    typeElement));
            if (configuration.shouldExcludeQualifier(utils.containingPackage(typeElement).toString())) {
                li.addContent(utils.asTypeElement(type).getSimpleName());
                li.addContent(typeParameters);
            } else {
                li.addContent(utils.asTypeElement(type).getQualifiedName());
                li.addContent(typeParameters);
            }
        } else {
            Content link = getLink(new LinkInfoImpl(configuration,
                    LinkInfoImpl.Kind.CLASS_TREE_PARENT, type)
                    .label(configuration.getClassName(utils.asTypeElement(type))));
            li.addContent(link);
        }
        return li;
    }
1066575
protected Content getNavLinkDeprecated() {
        Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
                contents.deprecatedLabel, "", "");
        Content li = HtmlTree.LI(linkContent);
        return li;
    }
727187
public Link getLink() {
        final String link = headers.getFirst(LINK);
        if (link != null) {
            return Link.valueOf(link);
        }
        return null;
    }
1369618
public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) {
        return getLink(new LinkInfoImpl(configuration, context, cd)
                .label(configuration.getClassName(cd)));
    }
93721
public List<Node> link() {
        List<Module> dependencies;
        Module module;
        Module resolved;
        StringBuilder problems;
        List<Node> result;

        problems = new StringBuilder();
        for (Map.Entry<Module, List<String>> entry : notLinked.entrySet()) {
            module = entry.getKey();
            dependencies = module.dependencies();
            for (String name : entry.getValue()) {
                resolved = lookup(name);
                if (resolved == null) {
                    problems.append("module '" + module.getName() + "': cannot resolve dependency '" + name + "'\n");
                } else {
                    dependencies.add(resolved);
                }
            }
        }
        if (problems.length() > 0) {
            throw new IllegalArgumentException(problems.toString());
        }
        result = reloadFiles;
        notLinked = null;
        reloadFiles = null;
        return result;
    }