Package org.eclipse.help

Examples of org.eclipse.help.ITocContribution


    this.docBundleContributes = docBundleContributes;

    // create sub toc's topic.
    for (Iterator<ITocContribution> it = docBundleContributes.iterator(); it
        .hasNext();) {
      ITocContribution con = it.next();
      IToc toc = con.getToc();
      if (toc instanceof Toc) {
        TocWrapperTopic topic = new TocWrapperTopic((Toc) toc);
        tocTopics.add(topic);
      }
View Full Code Here


      }
      return UNHANDLED;
    }
   
    private String normalize(String href, String id) {
      ITocContribution contribution = getContribution(id);
      if (contribution != null) {
        String pluginId = contribution.getContributorId();
        return HrefUtil.normalizeHref(pluginId, href);
      }
      else {
        int index = id.indexOf('/', 1);
        if (index != -1) {
View Full Code Here

  public synchronized Toc getOwningToc(String href) {
    if (tocsByTopic == null) {
      tocsByTopic = new HashMap();
      Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL());
      for (int i=0;i<tocs.length;++i) {
        ITocContribution contribution = tocs[i].getTocContribution();
        String[] extraDocuments = contribution.getExtraDocuments();
        for (int j=0;j<extraDocuments.length;++j) {
          tocsByTopic.put(extraDocuments[j], tocs[i]);
        }
      }
    }
View Full Code Here

   */
  private Map categorizeTocs(List tocs, List tocOrder) {
    Map categorized = new HashMap();
    Iterator iter = tocs.iterator();
    while (iter.hasNext()) {
      ITocContribution toc = (ITocContribution)iter.next();
      String categoryId;
      try {
        categoryId = toc.getCategoryId();
      }
      catch (Throwable t) {
        // log and skip
        String msg = "Error retrieving categoryId from " + ITocContribution.class.getName() + ": " + toc.getClass().getName(); //$NON-NLS-1$ //$NON-NLS-2$
        HelpPlugin.logError(msg, t);
        continue;
      }
      if (categoryId != null) {
        // it has a category, add it to the appropriate TocCategory
        TocCategory category = (TocCategory)categorized.get(categoryId);
        if (category == null) {
          // create categories as needed
          category = new TocCategory(categoryId);
          categorized.put(categoryId, category);
          tocOrder.add(categoryId);
        }
        category.add(toc);
      }
      else {
        // doesn't have a category; insert the TOC directly
        String id;
        try {
          id = toc.getId();
        }
        catch (Throwable t) {
          // log and skip
          String msg = "Error retrieving id from " + ITocContribution.class.getName() + ": " + toc.getClass().getName(); //$NON-NLS-1$ //$NON-NLS-2$
          HelpPlugin.logError(msg, t);
          continue;
        }
        categorized.put(id, toc);
        tocOrder.add(id);
View Full Code Here

    List contributions = new ArrayList();
    TocFile[] tocFiles = getTocFiles(locale);
    TocFileParser parser = new TocFileParser();
    for (int i=0;i<tocFiles.length;++i) {
      try {
        ITocContribution toc = parser.parse(tocFiles[i]);
        contributions.add(toc);
      }
      catch (Throwable t) {
        String msg = "Error reading help table of contents file /\"" + tocFiles[i].getPluginId() + '/' + tocFiles[i].getFile() + "\" (skipping file)"; //$NON-NLS-1$ //$NON-NLS-2$
        HelpPlugin.logError(msg, t);
View Full Code Here

TOP

Related Classes of org.eclipse.help.ITocContribution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.