Class WTheme
- Direct Known Subclasses:
WBootstrapTheme
,WCssTheme
public abstract class WTheme extends WObject
- See Also:
WApplication.setTheme(WTheme theme)
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description abstract void
apply(WWidget widget, DomElement element, int elementRole)
Applies the theme to a DOM element that renders a widget.abstract void
apply(WWidget widget, WWidget child, int widgetRole)
Applies the theme to a child of a composite widget.void
applyValidationStyle(WWidget widget, WValidator.Result validation, ValidationStyleFlag flag, ValidationStyleFlag... flags)
Applies a style that indicates the result of validation.abstract void
applyValidationStyle(WWidget widget, WValidator.Result validation, java.util.EnumSet<ValidationStyleFlag> flags)
Applies a style that indicates the result of validation.abstract boolean
canBorderBoxElement(DomElement element)
abstract java.lang.String
getActiveClass()
Returns a generic CSS class name for an active element.abstract java.lang.String
getDisabledClass()
Returns a generic CSS class name for a disabled element.abstract java.lang.String
getName()
Returns a theme name.java.lang.String
getResourcesUrl()
Returns the URL where theme-related resources are stored.abstract java.util.List<WCssStyleSheet>
getStyleSheets()
Returns a vector with stylesheets for the theme.abstract boolean
isCanStyleAnchorAsButton()
Returns whether the theme allows for an anchor to be styled as a button.void
serveCss(java.lang.StringBuilder out)
Serves the CSS for the theme.abstract java.lang.String
utilityCssClass(int utilityCssClassRole)
Returns a generic CSS class name for the chosen role.Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, remove, setFormData, setObjectName, tr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WTheme
Constructor. -
WTheme
public WTheme()Constructor.Calls
this((WObject)null)
-
-
Method Details
-
getName
public abstract java.lang.String getName()Returns a theme name.Returns a unique name for the theme. This name is used by the default implementation of
getResourcesUrl()
to compute a location for the theme's resources. -
getResourcesUrl
public java.lang.String getResourcesUrl()Returns the URL where theme-related resources are stored.The default implementation considers a folder within JWt's resource directory, based on the theme
getName()
. -
serveCss
public void serveCss(java.lang.StringBuilder out)Serves the CSS for the theme.This must serve CSS declarations for the theme.
The default implementation serves all the
getStyleSheets()
. -
getStyleSheets
Returns a vector with stylesheets for the theme.This should return a vector with stylesheets that implement the theme. This list may be tailored to the current user agent, which is read from the application environment.
-
apply
Applies the theme to a child of a composite widget.The
widgetRole
indicates the role thatchild
has within the implementation of thewidget
. -
apply
Applies the theme to a DOM element that renders a widget.The
element
is a rendered representation of thewidget
, and may be further customized to reflect the theme. -
getDisabledClass
public abstract java.lang.String getDisabledClass()Returns a generic CSS class name for a disabled element. -
getActiveClass
public abstract java.lang.String getActiveClass()Returns a generic CSS class name for an active element. -
utilityCssClass
public abstract java.lang.String utilityCssClass(int utilityCssClassRole)Returns a generic CSS class name for the chosen role. -
isCanStyleAnchorAsButton
public abstract boolean isCanStyleAnchorAsButton()Returns whether the theme allows for an anchor to be styled as a button. -
applyValidationStyle
public abstract void applyValidationStyle(WWidget widget, WValidator.Result validation, java.util.EnumSet<ValidationStyleFlag> flags)Applies a style that indicates the result of validation. -
applyValidationStyle
public final void applyValidationStyle(WWidget widget, WValidator.Result validation, ValidationStyleFlag flag, ValidationStyleFlag... flags)Applies a style that indicates the result of validation.Calls
applyValidationStyle(widget, validation, EnumSet.of(flag, flags))
-
canBorderBoxElement
-