Exemplo n.º 1
0
 /**
  * Returns the doc in HTML format.
  *
  * @param result the Script elements for which to get the Javadoc
  * @return a string with the Javadoc in HTML format.
  */
 private String getScriptdocHtml(String result) {
   StringBuffer buffer = new StringBuffer();
   try {
     Reader reader = ScriptDocumentationAccess.getHTMLContentReader(getNature(), result);
     if (reader != null) {
       HTMLPrinter.addParagraph(buffer, reader);
     }
   } catch (ModelException ex) {
     DLTKUIPlugin.log(ex);
     return null;
   }
   if (buffer.length() > 0) {
     HTMLPrinter.insertPageProlog(buffer, 0, fgStyleSheet);
     HTMLPrinter.addPageEpilog(buffer);
     return buffer.toString();
   }
   return null;
 }
Exemplo n.º 2
0
 /**
  * Returns the Javadoc in HTML format.
  *
  * @param result the Script elements for which to get the Javadoc
  * @return a string with the Javadoc in HTML format.
  */
 private String getScriptdocHtml(IModelElement curr) {
   StringBuffer buffer = new StringBuffer();
   if (curr instanceof IMember) {
     IMember member = (IMember) curr;
     // HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
     try {
       Reader reader =
           ScriptDocumentationAccess.getHTMLContentReader(getNature(), member, true, true);
       if (reader != null) {
         HTMLPrinter.addParagraph(buffer, reader);
       } else {
         // Provide hint why there's no Javadoc
         HTMLPrinter.addParagraph(buffer, InfoViewMessages.ScriptdocView_noAttachedInformation);
       }
     } catch (ModelException ex) {
       DLTKUIPlugin.log(ex);
       return null;
     }
   }
   return addPrologeEpilog(buffer);
 }
Exemplo n.º 3
0
 /**
  * Returns the Javadoc in HTML format.
  *
  * @param result the Script elements for which to get the Javadoc
  * @return a string with the Javadoc in HTML format.
  */
 private String getScriptdocHtmlDetailed(IModelElement[] result) {
   final StringBuffer buffer = new StringBuffer();
   final List nodocs = new ArrayList();
   for (int i = 0; i < result.length; i++) {
     final IModelElement curr = result[i];
     if (curr instanceof IMember) {
       final IMember member = (IMember) curr;
       try {
         Reader reader =
             ScriptDocumentationAccess.getHTMLContentReader(getNature(), member, true, true);
         if (reader != null) {
           buffer.append("<b>"); // $NON-NLS-1$
           buffer.append(getInfoText(member));
           buffer.append("</b>"); // $NON-NLS-1$
           HTMLPrinter.addParagraph(buffer, reader);
         } else {
           nodocs.add(
               ScriptElementLabels.getDefault()
                   .getElementLabel(member, LABEL_FLAGS | ScriptElementLabels.APPEND_FILE));
         }
       } catch (ModelException ex) {
         DLTKUIPlugin.log(ex);
         return null;
       }
     }
   }
   if (!nodocs.isEmpty()) {
     Collections.sort(nodocs);
     HTMLPrinter.addParagraph(buffer, InfoViewMessages.ScriptdocView_noAttachedInformationHeader);
     HTMLPrinter.startBulletList(buffer);
     for (Iterator i = nodocs.iterator(); i.hasNext(); ) {
       HTMLPrinter.addBullet(buffer, (String) i.next());
     }
     HTMLPrinter.endBulletList(buffer);
   }
   return addPrologeEpilog(buffer);
 }