Package org.eclipse.help.internal

Examples of org.eclipse.help.internal.Topic


   * e.g. "path/myfile.html" -> "/my.plugin/path/myfile.html"
   */
  private class NormalizeHandler extends ProcessorHandler {
    public short handle(UAElement element, String id) {
      if (element instanceof Topic) {
        Topic topic = (Topic)element;
        String href = topic.getHref();
        if (href != null) {
          topic.setHref(normalize(href, id));
        }
        return HANDLED_CONTINUE;
      }
      else if (element instanceof Toc) {
        Toc toc = (Toc)element;
View Full Code Here


  }
 
  public synchronized Topic getTopic(String href) {
    Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL());
    for (int i=0;i<tocs.length;++i) {
      Topic topic = (Topic)tocs[i].getTopic(href);
      if (topic != null) {
        return topic;
      }
    }
    int index = href.indexOf('#');
View Full Code Here

    }
    return null;
  }
 
  public synchronized int[] getTopicPath(String href) {
    Topic topic = getTopic(href);
    if (topic != null) {
      List path = new ArrayList();
      UAElement element = topic;
      while (!(element instanceof Toc)) {
        UAElement parent = element.getParentElement();
View Full Code Here

          Document document = description.getOwnerDocument();
          description.appendChild(document.createTextNode(buf.toString()));
        }
      }
      else if (element instanceof Topic) {
        Topic topic = (Topic)element;
        String href = topic.getHref();
        if (href != null) {
          int index = id.indexOf('/', 1);
          if (index != -1) {
            String pluginId = id.substring(1, index);
            topic.setHref(HrefUtil.normalizeHref(pluginId, href));
          }
        }
      }
      // give other handlers an opportunity to process
      return UNHANDLED;
View Full Code Here

      }
    }
    IHelpResource[] topics = src.getRelatedTopics();
    for (int i=0;i<topics.length;++i) {
      if (topics[i] instanceof ITopic) {
        appendChild(new Topic((ITopic)topics[i]));
      }
      else {
        Topic topic = new Topic();
        topic.setHref(topics[i].getHref());
        topic.setLabel(topics[i].getLabel());
        appendChild(topic);
      }
    }
  }
View Full Code Here

   * e.g. "path/myfile.html" -> "/my.plugin/path/myfile.html"
   */
  private class NormalizeHandler extends ProcessorHandler {
    public short handle(UAElement element, String id) {
      if (element instanceof Topic) {
        Topic topic = (Topic)element;
        String href = topic.getHref();
        if (href != null) {
          int index = id.indexOf('/', 1);
          if (index != -1) {
            String pluginId = id.substring(1, index);
            topic.setHref(HrefUtil.normalizeHref(pluginId, href));
          }
        }
      }
      return UNHANDLED;
    }
View Full Code Here

     * Returns the string that will be displayed for the given object,
     * used for sorting.
     */
    private static String getLabel(UAElement element) {
      if (element instanceof Topic) {
        Topic topic = (Topic)element;
        if (topic.getLabel() == null) {
          ITopic topic2 = HelpPlugin.getTocManager().getTopic(topic.getHref());
          if (topic2 != null) {
            topic.setLabel(topic2.getLabel());
          }
          else {
            String msg = "Unable to look up label for help keyword index topic \"" + topic.getHref() + "\" with missing \"" + Topic.ATTRIBUTE_LABEL + "\" attribute (topic does not exist in table of contents; using href as label)"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            HelpPlugin.logError(msg);
            topic.setLabel(topic.getHref());
          }
        }
        return topic.getLabel();
      }
      else if (element instanceof IndexEntry) {
        return ((IndexEntry)element).getKeyword();
      }
      return null;
View Full Code Here

TOP

Related Classes of org.eclipse.help.internal.Topic

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.