/[classpath]/gjdoc/src/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by julian, Fri Dec 17 16:14:51 2004 UTC revision 1.27 by julian, Fri Dec 17 17:54:20 2004 UTC
# Line 97  public class HtmlDoclet Line 97  public class HtmlDoclet
97    
98           boolean overviewLevel = ("overview".equals(currentPage)           boolean overviewLevel = ("overview".equals(currentPage)
99                                    || "full-tree".equals(currentPage)                                    || "full-tree".equals(currentPage)
100                                    || "index".equals(currentPage));                                    || "index".equals(currentPage)
101                                      || "serialized".equals(currentPage));
102    
103           if ("overview".equals(currentPage)) {           if ("overview".equals(currentPage)) {
104              output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE);              output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE);
# Line 1658  public class HtmlDoclet Line 1659  public class HtmlDoclet
1659              output.endDiv(CssClass.CLASS_ENCLOSINGCLASS);              output.endDiv(CssClass.CLASS_ENCLOSINGCLASS);
1660           }           }
1661    
1662           Set implementedInterfaces = new TreeSet();           Set implementedInterfaces = getImplementedInterfaces(classDoc);
   
          for (ClassDoc cd = classDoc; cd != null; cd = cd.superclass()) {  
             ClassDoc[] interfaces = cd.interfaces();  
             for (int i=0; i<interfaces.length; ++i) {  
                implementedInterfaces.add(interfaces[i]);  
                InterfaceRelation relation  
                   = (InterfaceRelation)getInterfaceRelations().get(interfaces[i]);  
                if (null != relation) {  
                   implementedInterfaces.addAll(relation.superInterfaces);  
                }  
                else {  
                   System.err.println("no relation for interface " + interfaces[i]);  
                }  
             }  
          }  
1663    
1664           printCommaSeparatedTypes(output,           printCommaSeparatedTypes(output,
1665                                    implementedInterfaces,                                    implementedInterfaces,
# Line 1754  public class HtmlDoclet Line 1740  public class HtmlDoclet
1740    
1741           printTaglets(output, classDoc.tags(), new HtmlTagletContext(classDoc, output, false));           printTaglets(output, classDoc.tags(), new HtmlTagletContext(classDoc, output, false));
1742        }        }
1743    
1744    
1745          Set implementedInterfaces = getImplementedInterfaces(classDoc);
1746    
1747          boolean haveInheritedFields = false;
1748          boolean haveInheritedMethods = false;
1749          boolean haveInheritedClasses = false;
1750          {
1751             Iterator it = implementedInterfaces.iterator();
1752             while (it.hasNext() && !haveInheritedClasses) {
1753                ClassDoc implementedInterface
1754                   = (ClassDoc)it.next();
1755                if (!"java.io.Serializable".equals(implementedInterface.qualifiedName())
1756                    && !"java.io.Externalizable".equals(implementedInterface.qualifiedName())) {
1757                   haveInheritedClasses = true;
1758                }
1759             }
1760    
1761             ClassDoc superClassDoc = classDoc.superclass();
1762             while (null != superClassDoc
1763                    && (!haveInheritedFields
1764                        || !haveInheritedMethods
1765                        || !haveInheritedClasses)) {
1766                if (superClassDoc.fields().length > 0) {
1767                   haveInheritedFields = true;
1768                }
1769                if (superClassDoc.methods().length > 0) {
1770                   haveInheritedMethods = true;
1771                }
1772                if (superClassDoc.innerClasses().length > 0) {
1773                   haveInheritedClasses = true;
1774                }
1775                superClassDoc = superClassDoc.superclass();
1776             }
1777          }
1778                
1779        printProgramElementDocs(output, getSortedInnerClasses(classDoc),        printProgramElementDocs(output, getSortedInnerClasses(classDoc),
1780                                "Nested Class Summary");                                "Nested Class Summary", haveInheritedClasses);
1781    
1782          {
1783             ClassDoc superClassDoc = classDoc.superclass();
1784             while (null != superClassDoc) {
1785                printInheritedMembers(output, getSortedInnerClasses(superClassDoc),
1786                                      "Nested classes/interfaces inherited from class " + superClassDoc.qualifiedName());
1787                superClassDoc = superClassDoc.superclass();
1788             }
1789          }
1790    
1791        printProgramElementDocs(output, getSortedFields(classDoc),        printProgramElementDocs(output, getSortedFields(classDoc),
1792                                "Field Summary");                                "Field Summary", haveInheritedFields);
1793    
1794          {
1795             ClassDoc superClassDoc = classDoc.superclass();
1796             while (null != superClassDoc) {
1797                printInheritedMembers(output, getSortedFields(superClassDoc),
1798                                      "Fields inherited from class " + superClassDoc.qualifiedName());
1799                superClassDoc = superClassDoc.superclass();
1800             }
1801          }
1802    
1803          {
1804             Iterator it = implementedInterfaces.iterator();
1805             while (it.hasNext()) {
1806                ClassDoc implementedInterface
1807                   = (ClassDoc)it.next();
1808                if (!"java.io.Serializable".equals(implementedInterface.qualifiedName())
1809                    && !"java.io.Externalizable".equals(implementedInterface.qualifiedName())) {
1810                   printInheritedMembers(output, getSortedFields(implementedInterface),
1811                                         "Fields inherited from interface " + implementedInterface.qualifiedName());
1812                }
1813             }
1814          }
1815    
1816        printProgramElementDocs(output, getSortedConstructors(classDoc),        printProgramElementDocs(output, getSortedConstructors(classDoc),
1817                                "Constructor Summary");                                "Constructor Summary", false);
1818        printProgramElementDocs(output, getSortedMethods(classDoc),        printProgramElementDocs(output, getSortedMethods(classDoc),
1819                                "Method Summary");                                "Method Summary", haveInheritedMethods);
1820    
1821        if (classDoc.isInterface()) {        if (classDoc.isInterface()) {
1822           InterfaceRelation relation           InterfaceRelation relation
# Line 1771  public class HtmlDoclet Line 1825  public class HtmlDoclet
1825           while (it.hasNext()) {           while (it.hasNext()) {
1826              ClassDoc superClassDoc = (ClassDoc)it.next();              ClassDoc superClassDoc = (ClassDoc)it.next();
1827              printInheritedMembers(output, getSortedMethods(superClassDoc),              printInheritedMembers(output, getSortedMethods(superClassDoc),
1828                                    "Methods inherited from " + superClassDoc.qualifiedName());                                    "Methods inherited from interface " + superClassDoc.qualifiedName());
1829           }           }
1830        }        }
1831        else {        else {
1832           ClassDoc superClassDoc = classDoc.superclass();           ClassDoc superClassDoc = classDoc.superclass();
1833           while (null != superClassDoc) {           while (null != superClassDoc) {
1834              printInheritedMembers(output, getSortedMethods(superClassDoc),              printInheritedMembers(output, getSortedMethods(superClassDoc),
1835                                    "Methods inherited from " + superClassDoc.qualifiedName());                                    "Methods inherited from class " + superClassDoc.qualifiedName());
1836              superClassDoc = superClassDoc.superclass();              superClassDoc = superClassDoc.superclass();
1837           }           }
1838        }        }
# Line 1804  public class HtmlDoclet Line 1858  public class HtmlDoclet
1858    
1859           output.beginDiv(CssClass.TABLE_CONTAINER);           output.beginDiv(CssClass.TABLE_CONTAINER);
1860           output.beginTable(CssClass.CLASS_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" });           output.beginTable(CssClass.CLASS_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" });
1861           output.rowDiv(CssClass.TABLE_HEADER, header);           output.rowDiv(CssClass.TABLE_SUB_HEADER, header);
1862    
1863           output.beginRow();           output.beginRow();
1864           output.beginCell(CssClass.CLASS_SUMMARY_INHERITED);           output.beginCell(CssClass.CLASS_SUMMARY_INHERITED);
# Line 2128  public class HtmlDoclet Line 2182  public class HtmlDoclet
2182     }     }
2183    
2184     private void printProgramElementDocs(HtmlPage output,     private void printProgramElementDocs(HtmlPage output,
2185                                          ProgramElementDoc[] memberDocs, String header)                                          ProgramElementDoc[] memberDocs,
2186                                            String header,
2187                                            boolean forceOutputHeader)
2188     {     {
2189        if (memberDocs.length > 0) {        if (memberDocs.length > 0 || forceOutputHeader) {
2190           output.beginDiv(CssClass.TABLE_CONTAINER);           output.beginDiv(CssClass.TABLE_CONTAINER);
2191           output.beginTable(CssClass.CLASS_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" });           output.beginTable(CssClass.CLASS_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" });
2192           output.rowDiv(CssClass.TABLE_HEADER, header);           output.rowDiv(CssClass.TABLE_HEADER, header);
# Line 2149  public class HtmlDoclet Line 2205  public class HtmlDoclet
2205                 else if (memberDoc.isField()) {                 else if (memberDoc.isField()) {
2206                    printType(output, ((FieldDoc)memberDoc).type());                    printType(output, ((FieldDoc)memberDoc).type());
2207                 }                 }
2208                   else if (memberDoc.isInterface()) {
2209                      output.print(" interface");
2210                   }
2211                   else if (memberDoc.isClass()) {
2212                      output.print(" class");
2213                   }
2214                 output.endDiv(CssClass.CLASS_SUMMARY_LEFT_SYNOPSIS);                 output.endDiv(CssClass.CLASS_SUMMARY_LEFT_SYNOPSIS);
2215                 output.endCell();                 output.endCell();
2216              }              }

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26