WebUITab — Contract of Tabs in Web UI

WebUITab represents a tab in web UI with a name and pages.

WebUITab can be:

WebUITab is simply a collection of WebUIPages that can be attached to the tab.

WebUITab has a name (and defaults to prefix capitalized).

SparkUITab is the one and only implementation of WebUITab contract.
WebUITab is a private[spark] contract.

Attaching Page to Tab — attachPage Method

attachPage(page: WebUIPage): Unit

attachPage prepends the page prefix (of the input WebUIPage) with the tab prefix (with no ending slash, i.e. /, if the page prefix is undefined).

In the end, attachPage adds the WebUIPage to pages registry.

attachPage is used when web UI tabs register their pages.

Requesting Base URI Path — basePath Method

basePath: String

basePath requests the parent WebUI for the base path.

basePath is used when…​FIXME

Requesting Header Tabs — headerTabs Method

headerTabs: Seq[WebUITab]

headerTabs requests the parent WebUI for the header tabs.

headerTabs is used exclusively when UIUtils is requested to headerSparkPage.

Creating WebUITab Instance

WebUITab takes the following when created:

WebUITab initializes the internal registries and counters.

WebUITab is a Scala abstract class and cannot be created directly, but only as one of the implementations.