Predefined Widgets
The {@link oajr.widget} package contains predefined reusable widgets.
{@link oajr.widget.MenuItemWidget} is an abstract class for rendering menu items with drop-downs. It defines some simple CSS and Javascript for enabling drop-down menus in the nav section of the page (although nothing keeps you from using it in an arbitrary location in the page).
The script specifies a
Subclasses implement the following two methods:
For example, to render a link that brings up a simple dialog in a div tag:
The HTML content returned by the {@link oajr.widget.MenuItemWidget#getHtml(RestRequest) getHtml(RestRequest)} method is added where the
{@link oajr.widget.ContentTypeMenuItem} is a predefined Widget that returns back a list of hyperlinks for rendering the contents of a page in a variety of content types.
The variable it resolves is
An example of this widget can be found in the PetStoreResource
in the examples that provides a drop-down menu item for rendering all other supported content types in plain text:
It renders the following popup-box:
{@link oajr.widget.QueryMenuItem} is a predefined Widget that returns a menu-item drop-down form for entering search/view/sort arguments.
The variable it resolves is
This widget is designed to be used in conjunction with the {@link oajr.converters.Queryable} converter, although implementations can process the query parameters themselves if they wish to do so by using the {@link oajr.RequestQuery#getSearchArgs()} method to retrieve the arguments and process the data themselves.
An example of this widget can be found in the PetStoreResource
in the examples that provides
search/view/sort capabilities against the collection of POJOs:
It renders the following popup-box:
Tooltips are provided by hovering over the field names.
When submitted, the form submits a GET request against the current URI with special GET search API query parameters.
(e.g.
{@link oajr.widget.ThemeMenuItem} is a predefined Widget that returns back a list of hyperlinks for rendering the contents of a page in the various default styles.
The variable it resolves is
An example of this widget can be found in the PetStoreResource
in the examples that provides
a drop-down menu item for rendering all other supported content types in plain text:
{@link oajr.widget.PoweredByJuneau} is a predefined Widget that places a powered-by-Juneau message on a page.
The variable it resolves is
It produces a simple Apache Juneau icon floating on the right.
Typically it's used in the footer of the page, as shown below in the AddressBookResource
from the examples:
It renders the following image:
{@link oajr.widget.Tooltip} is a predefined template for adding tooltips to HTML5 bean constructs, typically in menu item widgets.
The following examples shows how tooltips can be added to a menu item widget.