langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
changeset 17558 eee4ccf66cfd
parent 15034 b7c791bc4526
child 17559 87c28ee29329
equal deleted inserted replaced
17557:9c6ace1881fe 17558:eee4ccf66cfd
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   141      * @param member the member to be documented
   141      * @param member the member to be documented
   142      * @param tdSummary the content tree to which the link will be added
   142      * @param tdSummary the content tree to which the link will be added
   143      */
   143      */
   144     protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member,
   144     protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member,
   145             Content tdSummary) {
   145             Content tdSummary) {
   146         addSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member, tdSummary);
   146         addSummaryLink(LinkInfoImpl.Kind.MEMBER, cd, member, tdSummary);
   147     }
   147     }
   148 
   148 
   149     /**
   149     /**
   150      * Add the summary link for the member.
   150      * Add the summary link for the member.
   151      *
   151      *
   152      * @param context the id of the context where the link will be printed
   152      * @param context the id of the context where the link will be printed
   153      * @param cd the class doc to be documented
   153      * @param cd the class doc to be documented
   154      * @param member the member to be documented
   154      * @param member the member to be documented
   155      * @param tdSummary the content tree to which the summary link will be added
   155      * @param tdSummary the content tree to which the summary link will be added
   156      */
   156      */
   157     protected abstract void addSummaryLink(int context,
   157     protected abstract void addSummaryLink(LinkInfoImpl.Kind context,
   158             ClassDoc cd, ProgramElementDoc member, Content tdSummary);
   158             ClassDoc cd, ProgramElementDoc member, Content tdSummary);
   159 
   159 
   160     /**
   160     /**
   161      * Add the inherited summary link for the member.
   161      * Add the inherited summary link for the member.
   162      *
   162      *
   292                 if (displayLength > 10) {
   292                 if (displayLength > 10) {
   293                     code.addContent(new HtmlTree(HtmlTag.BR));
   293                     code.addContent(new HtmlTree(HtmlTag.BR));
   294                 }
   294                 }
   295                 code.addContent(new RawHtml(
   295                 code.addContent(new RawHtml(
   296                         writer.getLink(new LinkInfoImpl(configuration,
   296                         writer.getLink(new LinkInfoImpl(configuration,
   297                         LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type))));
   297                         LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))));
   298             } else {
   298             } else {
   299                 code.addContent(new RawHtml(
   299                 code.addContent(new RawHtml(
   300                         writer.getLink(new LinkInfoImpl(configuration,
   300                         writer.getLink(new LinkInfoImpl(configuration,
   301                         LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type))));
   301                         LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))));
   302             }
   302             }
   303 
   303 
   304         }
   304         }
   305         tdSummaryType.addContent(code);
   305         tdSummaryType.addContent(code);
   306     }
   306     }
   481                     name.addStyle(HtmlStyle.strong);
   481                     name.addStyle(HtmlStyle.strong);
   482                     name.addContent(cd.name() + ".");
   482                     name.addContent(cd.name() + ".");
   483                     tdLast.addContent(name);
   483                     tdLast.addContent(name);
   484                 }
   484                 }
   485                 addSummaryLink(pgmdoc instanceof ClassDoc ?
   485                 addSummaryLink(pgmdoc instanceof ClassDoc ?
   486                     LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER,
   486                     LinkInfoImpl.Kind.CLASS_USE : LinkInfoImpl.Kind.MEMBER,
   487                     cd, pgmdoc, tdLast);
   487                     cd, pgmdoc, tdLast);
   488                 writer.addSummaryLinkComment(this, pgmdoc, tdLast);
   488                 writer.addSummaryLinkComment(this, pgmdoc, tdLast);
   489                 tr.addContent(tdLast);
   489                 tr.addContent(tdLast);
   490                 tbody.addContent(tr);
   490                 tbody.addContent(tr);
   491             }
   491             }