public abstract class MenuItemWidget extends Widget
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 should implement the following two methods:
getLabel(RestRequest)
- The menu item label.
getContent(RestRequest)
- The menu item content.
For example, to render a link that brings up a simple dialog in a div tag:
The HTML content returned by the getHtml(RestRequest)
method is added where the
Constructor and Description |
---|
MenuItemWidget() |
Modifier and Type | Method and Description |
---|---|
abstract Object |
getContent(RestRequest req)
The content of the popup.
|
String |
getHtml(RestRequest req)
Resolves the HTML content for this widget.
|
abstract String |
getLabel(RestRequest req)
The label for the menu item as it's rendered in the menu bar.
|
String |
getScript(RestRequest req)
Returns the Javascript needed for the show and hide actions of the menu item.
|
String |
getStyle(RestRequest req)
Defines a
getHtml(RestRequest) method. |
getClasspathResourceAsString, getClasspathResourceAsString, getName, loadHtml, loadScript, loadStyle
public MenuItemWidget()
public String getScript(RestRequest req) throws Exception
public String getStyle(RestRequest req) throws Exception
getHtml(RestRequest)
method.public String getHtml(RestRequest req) throws Exception
Widget
A returned value of
public abstract String getLabel(RestRequest req) throws Exception
req
- The HTTP request object.Exception
public abstract Object getContent(RestRequest req) throws Exception
req
- The HTTP request object.Reader
- Serialized directly to the output.
CharSequence
- Serialized directly to the output.
HtmlSerializer.DEFAULT
.
org.apache.juneau.dto.html5
beans.
Exception
Copyright © 2018 Apache. All rights reserved.