コード例 #1
0
ファイル: HTMLIconUtils.java プロジェクト: stevenaz/sveditor
  public static String getImagePath(DocTopic docItem) {
    if (docItem.getTopic() == DocTopicManager.TOPIC_VARIABLE) {
      int attr = docItem.getAttr();
      if ((attr & IFieldItemAttr.FieldAttr_Local) != 0) {
        return FIELD_PRIV_OBJ;
      } else if ((attr & IFieldItemAttr.FieldAttr_Protected) != 0) {
        return FIELD_PROT_OBJ;
      } else {
        return FIELD_PUB_OBJ;
      }
    } else if (docItem.getTopic() == DocTopicManager.TOPIC_TASK) {
      int attr = docItem.getAttr();
      if ((attr & IFieldItemAttr.FieldAttr_Local) != 0) {
        return TASK_PRIV_OBJ;
      } else if ((attr & IFieldItemAttr.FieldAttr_Protected) != 0) {
        return TASK_PROT_OBJ;
      } else {
        return TASK_PUB_OBJ;
      }
    } else {
      String topic = docItem.getTopic();
      if (fImgDescMap.containsKey(topic)) {
        return fImgDescMap.get(topic);
      }
    }

    return null;
  }
コード例 #2
0
ファイル: HTMLIndexFactory.java プロジェクト: vb7484/sveditor
 private String genIndex(String relPathToHTML, DocModel model) {
   DocIndex idxMap = model.getTopicIndexMap(docTopicType.getName().toLowerCase());
   if (idxMap == null) {
     return "";
   }
   String res =
       "<div id=Index>"
           + "<div class=IPageTitle>"
           + fIndexNameCapitalized
           + "</div>"
           + "<div class=INavigationBar>";
   boolean first = true;
   ArrayList<String> sortedIdxKeys = new ArrayList<String>(idxMap.getMap().keySet());
   Collections.sort(sortedIdxKeys);
   for (String idxKey : sortedIdxKeys) {
     if (!first) {
       res += " &middot; ";
     } else {
       first = false;
     }
     if (idxMap.getMap().get(idxKey).size() == 0) {
       res += idxKey;
     } else {
       res += "<a href=\"#" + idxKey.toUpperCase() + "\">" + idxKey.toUpperCase() + "</a>";
     }
   }
   res += "</div>" + "<table class=ITable border=0 cellspacing=0 cellpadding=0>";
   for (String idxKey : sortedIdxKeys) {
     if (idxMap.getMap().get(idxKey).size() == 0) {
       continue;
     }
     res +=
         "<tr>"
             + "<td class=IHeading id=IFirstHeading>"
             + "<a name=\""
             + idxKey
             + "\"></a>"
             + idxKey
             + "</td><td></td>"
             + "</tr>";
     ArrayList<DocTopic> entries = new ArrayList<DocTopic>(idxMap.getMap().get(idxKey));
     Collections.sort(
         entries,
         new Comparator<DocTopic>() {
           public int compare(DocTopic o1, DocTopic o2) {
             return (o1.getTitle() + "::" + o1.getQualifiedName())
                 .compareToIgnoreCase((o2.getTitle() + "::" + o2.getQualifiedName()));
           }
         });
     for (DocTopic entry : entries) {
       String linkID = getNextLinkID();
       String ttID = getNextTTID();
       res +=
           "<tr><td class=ISymbolPrefix id=IOnlySymbolPrefix>&nbsp;</td>"
               + "<td class=IEntry>"
               + "<a href=\""
               + relPathToHTML
               + "/files"
               + entry.getDocFile().getDocPath()
               + ".html"
               + "#"
               + entry.getQualifiedName()
               + "\" "
               + "id="
               + linkID
               + " onMouseOver=\"ShowTip(event, '"
               + ttID
               + "', '"
               + linkID
               + "')\" "
               + "onMouseOut=\"HideTip('"
               + ttID
               + "')\" "
               + "class=ISymbol>"
               + entry.getTitle()
               + "</a>"
               + "</td>"
               + "<td class=IDescription>"
               + entry.getQualifiedName()
               + "</td>"
               + "</tr>";
       ttDescriptions.put(ttID, entry.getSummary());
     }
   }
   res += "</table>";
   res += genToolTips();
   res += "</div><!--Index-->";
   return res;
 }