1 /* |
1 /* |
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2017, 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 |
25 |
25 |
26 package jdk.javadoc.internal.doclets.formats.html; |
26 package jdk.javadoc.internal.doclets.formats.html; |
27 |
27 |
28 import java.util.List; |
28 import java.util.List; |
29 |
29 |
|
30 import javax.lang.model.element.ModuleElement; |
30 import javax.lang.model.element.PackageElement; |
31 import javax.lang.model.element.PackageElement; |
31 import javax.lang.model.element.TypeElement; |
32 import javax.lang.model.element.TypeElement; |
32 import javax.lang.model.type.TypeMirror; |
33 import javax.lang.model.type.TypeMirror; |
33 |
34 |
34 import com.sun.source.doctree.DocTree; |
35 import com.sun.source.doctree.DocTree; |
189 bodyTree.addContent(htmlTree); |
190 bodyTree.addContent(htmlTree); |
190 } |
191 } |
191 bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); |
192 bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); |
192 HtmlTree div = new HtmlTree(HtmlTag.DIV); |
193 HtmlTree div = new HtmlTree(HtmlTag.DIV); |
193 div.addStyle(HtmlStyle.header); |
194 div.addStyle(HtmlStyle.header); |
|
195 if (configuration.showModules) { |
|
196 ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(annotationType); |
|
197 Content typeModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel); |
|
198 Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typeModuleLabel); |
|
199 moduleNameDiv.addContent(Contents.SPACE); |
|
200 moduleNameDiv.addContent(getModuleLink(mdle, new StringContent(mdle.getQualifiedName()))); |
|
201 div.addContent(moduleNameDiv); |
|
202 } |
194 PackageElement pkg = utils.containingPackage(annotationType); |
203 PackageElement pkg = utils.containingPackage(annotationType); |
195 if (!pkg.isUnnamed()) { |
204 if (!pkg.isUnnamed()) { |
196 Content pkgNameContent = new StringContent(utils.getPackageName(pkg)); |
205 Content typePackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel); |
197 Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); |
206 Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typePackageLabel); |
|
207 pkgNameDiv.addContent(Contents.SPACE); |
|
208 Content pkgNameContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))); |
|
209 pkgNameDiv.addContent(pkgNameContent); |
198 div.addContent(pkgNameDiv); |
210 div.addContent(pkgNameDiv); |
199 } |
211 } |
200 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, |
212 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, |
201 LinkInfoImpl.Kind.CLASS_HEADER, annotationType); |
213 LinkInfoImpl.Kind.CLASS_HEADER, annotationType); |
202 Content headerContent = new StringContent(header); |
214 Content headerContent = new StringContent(header); |