On Fri, 9 Apr 2021 12:20:09 GMT, Hannes Wallnöfer <hann...@openjdk.org> wrote:
> This adds a feature to add sub-navigation links to the package summary page, > but ended up more like a refactoring of the code to generate sub-navigation > links. The reason for this is that generation of these links was highly > idiosyncratic. Every writer class that wanted to create sub-nav links > deposited something of itself in the `Navigation` instance which was then > responsible for generating these links. The new code introduces a > `Navigation.SubNavLinks` interface that allows writers to provide a list of > links into their page content. > > As for the new feature in the package summary page itself, I chose an > approach that is a bit different from the one we use for other types of > pages. Instead of displaying the inactive label instead of the link when a > section is not present on the page, only the active links are displayed. The > reason for this is that the package summary page contains so many potential > summary tables that the sub-nav area gets quite crowded if they are all > shown. Just showing the actually present pieces looked better to me. > > Like in other sub-nav sections, the link labels sometimes use abbreviated > terms such as "RELATED" instead of "RELATED PACKAGES" and "ENUMS" instead of > "ENUM CLASSES". The full list of potential package sub-nav links is as > follows: > > Package: Description | Related | Interfaces | Classes | Enums | Records | > Exceptions | Errors | Annotations > > An important implementation note is that I moved the code to compute package > summary contents from `PackageSummaryBuilder` to `PackageWriterImpl`. The > reason for this is that the contents are required to determine which links to > create, and I didn't want to re-compute this information that was previously > computed on the fly in the builder class. The various summary items are now > stored in collection fields in the writer class. > > I have tried to add all the new properties and constants in a sensible place, > which usually means alphabetic order within the sub-group of related entries. > > I chose to keep the markup structure of the package summary page mostly > unchanged, adding only `id` attributes to the existing `<li>` elements for > each summary table. I decided against adding `class` attributes as well as it > seems very unlikely to me that somebody would want to apply different styles > to the various summary tables. Even without them, it could be done using the > `id`s. This pull request has now been integrated. Changeset: d2b53509 Author: Hannes Wallnöfer <hann...@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/d2b53509c0f6b8c6fd0a34ccdd7ad630af0db93a Stats: 1381 lines in 40 files changed: 529 ins; 677 del; 175 mod 8263507: Improve structure of package summary pages Reviewed-by: jjg ------------- PR: https://git.openjdk.java.net/jdk/pull/3413