Package org.eclipse.help

Examples of org.eclipse.help.ITopic


      return UrlUtil.getHelpURL(topicHref);
    else
    if (selectedToc == -1)
      return null;
    IToc toc = tocs[selectedToc];
    ITopic tocDescription = toc.getTopic(null);
    if (tocDescription != null)
      return UrlUtil.getHelpURL(tocDescription.getHref());
    return UrlUtil.getHelpURL(null);
  }
View Full Code Here


      }
    } else {
      // try obtaining the TOC from the topic
      selectedToc = findTocContainingTopic(topicHref);

      ITopic topic = findTopic();
      if (topic != null
          && topic instanceof org.eclipse.help.internal.toc.Topic) {
        topicPath = ((org.eclipse.help.internal.toc.Topic) topic)
            .getPathInToc(tocs[selectedToc]);
      }
View Full Code Here

    }

    public void generateLinks(Writer out) {
        for (int i = 0; i < tocs.length; i++) {
            IToc toc = tocs[i];
            ITopic tocTopic = toc.getTopic(null);
            generateTopicLinks(tocTopic, out, 0);
            ITopic[] topics = toc.getTopics();
            for (int t = 0; t < topics.length; t++) {
                generateTopicLinks(topics[t], out, 1);
            }
View Full Code Here

  private void writeElements(IUAElement[] children,
      StringBuilder helpContextBuilder, StringBuilder newJavaFileBuilder,
      int tocLevel) {
    for (IUAElement child : children) {
      if (child instanceof ITopic) {
        ITopic topic = ((ITopic) child);
        String href = topic.getHref();
        String label = topic.getLabel();
        // Remove any special markings from the label
        String labelAsKey = cleanLabel(label).toLowerCase();
        String labelAsModifier = labelAsKey;
        if (Character.isDigit(labelAsModifier.charAt(0))) {
          labelAsModifier = '_' + labelAsModifier;
        }
        if (topics.contains(labelAsModifier)) {
          // append the parent topic name to this label
          ITopic parent = (ITopic) ((Topic) topic).getParentElement();
          String parentLabel = cleanLabel(parent.getLabel())
              .toLowerCase();
          if (Character.isDigit(parentLabel.charAt(0))) {
            parentLabel = '_' + parentLabel;
          }
          labelAsModifier = parentLabel + labelAsModifier;
View Full Code Here

  public Toc(IToc src) {
    super(NAME, src);
    setHref(src.getHref());
    setLabel(src.getLabel());
    ITopic topic = src.getTopic(null);
    if (topic != null) {
      setTopic(topic.getHref());
    }
    appendChildren(src.getChildren());
  }
View Full Code Here

  }
 
  public ITopic getTopic(String href) {
    if (href == null) {
      if (topic == null) {
        topic = new ITopic() {
          public String getHref() {
            return getTopic();
          }
          public String getLabel() {
            return Toc.this.getLabel();
View Full Code Here

     */
    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());
View Full Code Here

TOP

Related Classes of org.eclipse.help.ITopic

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.