RFR: JDK-8295088: Update External Spec page to show tabs for hosts
Hannes Wallnöfer
hannesw at openjdk.org
Fri Oct 21 14:12:50 UTC 2022
On Mon, 10 Oct 2022 19:03:21 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
> Please review a medium but interesting fix to display tabs on the `External Specifications` page to indicate the host name for the spec.
>
> The underlying "fun" part is to update `Table` to be `Table<T>`, where `T` is the type parameter for the predicates used to classify each row to determine the tabs when it will be displayed.
>
> The changes to `Table` are relatively simple, but there is a downstream cost to update all the existing use sites to avoid introducing any raw types (i.e. because `Table` now takes a type parameter). While it would have been simple to just change existing uses from `Table` to `Table<Element>`, the changes are done more appropriately. In particular, if a table does not use tabs at all, the type parameter can be `Void`, and in other situations, the type parameter can be a subtype of `Element`, such as `ModuleElement`, `PackageElement` or `TypeElement`.
>
> With `Table` updated to be `Table<T>`, the table in `ExternalSpecsWriter` can be `Table<URI>` with table-tab predicates examining the host name for the URL.
>
> Eventually, it might be good to do a further upgrade to use a horizontal list of checkboxes instead of table tabs, for the potentially open-ended set of host names, but this will require an update to the JavaScript we use for checkboxes, which seems out of scope for the work presented here. I note that in demo JDK docs, there are only about half-a-dozen spec hosts, so table tabs are a reasonable compromise for now.
Very nice work, Jon! Looks good to me.
-------------
Marked as reviewed by hannesw (Reviewer).
PR: https://git.openjdk.org/jdk/pull/10636
More information about the javadoc-dev
mailing list