Package org.apache.juneau.html
Interface HtmlWidget
- All Known Implementing Classes:
ContentTypeMenuItem
,MenuItemWidget
,PoweredByApache
,PoweredByJuneau
,QueryMenuItem
,ThemeMenuItem
,Widget
public interface HtmlWidget
Defines an interface for resolvers of "$W{...}" string variables.
Widgets must provide one of the following public constructors:
public Widget();
Widgets can be defined as inner classes of REST resource classes.
See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetHtml
(VarResolverSession session) Resolves the HTML content for this widget.getName()
The name for this widget.getScript
(VarResolverSession session) Resolves any Javascript that should be added to the<head>/<script> element.getStyle
(VarResolverSession session) Resolves any CSS styles that should be added to the<head>/<style> element.
-
Method Details
-
getName
The name for this widget.- Returns:
- A unique identifying name for this widget.
-
getHtml
Resolves the HTML content for this widget.A returned value of
null will cause nothing to be added to the page.- Parameters:
session
- The current serializer session.- Returns:
- The HTML content of this widget.
-
getScript
Resolves any Javascript that should be added to the<head>/<script> element.A returned value of
null will cause nothing to be added to the page.- Parameters:
session
- The current serializer session.- Returns:
- The Javascript needed by this widget.
-
getStyle
Resolves any CSS styles that should be added to the<head>/<style> element.A returned value of
null will cause nothing to be added to the page.- Parameters:
session
- The current serializer session.- Returns:
- The CSS styles needed by this widget.
-