Class WCssTheme
- java.lang.Object
-
- eu.webtoolkit.jwt.WObject
-
- eu.webtoolkit.jwt.WTheme
-
- eu.webtoolkit.jwt.WCssTheme
-
public class WCssTheme extends WTheme
CSS-based theme support. This implements the classic JWt themes, which were available before theme support was customized with the addition of theWThemeclass.The following table shows which style classes are applied by this theme.
WAbstractItemView*.Wt-itemview .Wt-itemview .Wt-headerdiv the header container .Wt-itemview .Wt-header the header .Wt-itemview .Wt-header .Wt-label a header label .Wt-itemview .Wt-header .Wt-label a header label .Wt-itemview .Wt-tv-rh resize handle .Wt-itemview .Wt-tv-sh sort handle .Wt-itemview .Wt-tv-sh-none sort handle, unsorted .Wt-itemview .Wt-tv-sh-down sort handle, descending sort .Wt-itemview .Wt-tv-sh-up sort handle, ascending sort .Wt-itemview .Wt-selected selected item (or row) .Wt-itemview .Wt-spacer spacer (briefly visible during scrolling) WAbstractSpinBox.Wt-spinbox (for the HTML4 implementation) WCalendar*.Wt-cal .Wt-cal table.d1 the table (single letter days) .Wt-cal table.d3 the table (three letter days) .Wt-cal table.dlong the table (ful day names) .Wt-cal th.caption a caption cell (containing month/year navigation) .Wt-cal th week day header cell .Wt-cal td day cell .Wt-cal-oom out-of-month day .Wt-cal-oom out-of-range day (ray < bottom or day > top) .Wt-cal-sel selected day .Wt-cal-now today WDateEdit.Wt-dateedit .Wt-datepicker the popup WDatePicker.Wt-datepicker the popup WDialog.Wt-dialog the dialog .Wt-dialog .closeicon the close icon in the titlebar .Wt-dialog .titlebar the titlebar .Wt-dialog .body the dialog body .Wt-dialog .footer the dialog footer WMenuItem.item an unselected item .itemselected a selected item .item.Wt-closable a closable item .item.Wt-separator a separator item .item.Wt-sectheader a section header item .item .Wt-icon the item's icon .item .Wt-chkbox the item's checkbox .item .closeicon the item's close icon WMessageBox.Wt-dialog see supra (WDialog) WPanel.Wt-panel .Wt-panel .titlebar the titlebar .Wt-panel .body the body WPopupMenu.Wt-popupmenu the popup menu; for the items, see supra (WMenuItem) WPopupWidget.Wt-outset WProgressBar.Wt-progressbar .Wt-progressbar .Wt-pgb-bar the bar .Wt-progressbar .Wt-pgb-label the value label WPushButton.Wt-btn WSlider*.Wt-slider-h or .Wt-slider-v for horizontal or vertical slider .Wt-slider-[hv] .Wt-slider-bg background element .Wt-slider-[hv] .fill fill to the current value .Wt-slider-[hv] .handle the slider handle .Wt-slider-[hv] .Wt-w an additional element for styling .Wt-slider-[hv] .Wt-e an additional element for styling WSuggestionPopup.Wt-suggest .Wt-suggest li an item .Wt-suggest .active an active item WTabWidget.Wt-tabs the header, which is a WMenuWTableView*.Wt-tableview see supra (WAbstractItemView) .Wt-tableview .Wt-contents the contents area .Wt-tableview .Wt-contents .Wt-tv-c a contents cell WTreeNode*.Wt-tree a tree node .Wt-tree.Wt-trunk a trunk node .Wt-tree.Wt-end an end node (last node within parent) .Wt-tree ul children list .Wt-tree .Wt-ctrl collapse/expand control .Wt-tree .Wt-ctrl.expand expand control .Wt-tree .Wt-ctrl.collapse collapse control .Wt-tree .Wt-ctrl.noexpand an item that cannot be expanded .Wt-tree .Wt-selected a selected node .Wt-tree .Wt-label the label WTreeView*.Wt-treeview see supra (WAbstractItemView) .Wt-treeview ul a node .Wt-treeview ul.Wt-tv-root the root node .Wt-treeview .Wt-tv-row a row of additional cells .Wt-treeview .Wt-trunk a trunk node .Wt-treeview .Wt-end an end node (last node within parent) .Wt-treeview .Wt-ctrl collapse/expand control .Wt-treeview .Wt-ctrl.expand expand control .Wt-treeview .Wt-ctrl.collapse collapse control .Wt-treeview .Wt-ctrl.noexpand an item that cannot be expanded *CSS selectors for these widgets are currently still hard-coded in the widget itself.- See Also:
WApplication.setTheme(WTheme theme)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
-
Constructor Summary
Constructors Constructor Description WCssTheme(java.lang.String name)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(WWidget widget, DomElement element, int elementRole)Applies the theme to a DOM element that renders a widget.protected voidapplyFunctionalStyling(WWidget widget, WWidget child, int widgetRole)Applies the functional part of the theme to a widget's child.protected voidapplyOptionalStyling(WWidget widget, WWidget child, int widgetRole)Applies the optional part of the theme to a widget's child.voidapplyValidationStyle(WWidget widget, WValidator.Result validation, java.util.EnumSet<ValidationStyleFlag> styles)Applies a style that indicates the result of validation.booleancanBorderBoxElement(DomElement element)java.lang.StringgetActiveClass()Returns a generic CSS class name for an active element.java.lang.StringgetDisabledClass()Returns a generic CSS class name for a disabled element.java.lang.StringgetName()Returns a theme name.java.util.List<WLinkedCssStyleSheet>getStyleSheets()Returns the stylesheets.booleanisCanStyleAnchorAsButton()Returns whether the theme allows for an anchor to be styled as a button.voidloadValidationStyling(WApplication app)Load the required content for validation.java.lang.StringutilityCssClass(int utilityCssClassRole)Returns a generic CSS class name for the chosen role.-
Methods inherited from class eu.webtoolkit.jwt.WTheme
apply, applyValidationStyle, getPanelCollapseIconSide, getResourcesUrl, init, serveCss
-
Methods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, setFormData, setObjectName, tr
-
-
-
-
Constructor Detail
-
WCssTheme
public WCssTheme(java.lang.String name)
Constructor.Creates a classic JWt theme. JWt comes with two CSS themes: "polished" and default. For the bootstrap theme, use
WBootstrapTheme.
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:WThemeReturns 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.
-
getStyleSheets
public java.util.List<WLinkedCssStyleSheet> getStyleSheets()
Returns the stylesheets.Returns wt.css, plus on IE wt_ie.css, plus on IE6 wt_ie6.css. The style sheets are located in the theme directory in the resources folder.
- Specified by:
getStyleSheetsin classWTheme
-
apply
public void apply(WWidget widget, DomElement element, int elementRole)
Description copied from class:WThemeApplies the theme to a DOM element that renders a widget.The
elementis a rendered representation of thewidget, and may be further customized to reflect the theme.
-
getDisabledClass
public java.lang.String getDisabledClass()
Returns a generic CSS class name for a disabled element.The CSS class Wt-disabled is applied to disabled classes.
- Specified by:
getDisabledClassin classWTheme
-
getActiveClass
public java.lang.String getActiveClass()
Returns a generic CSS class name for an active element.The CSS class Wt-selected is applied to active classes.
- Specified by:
getActiveClassin classWTheme
-
utilityCssClass
public java.lang.String utilityCssClass(int utilityCssClassRole)
Description copied from class:WThemeReturns a generic CSS class name for the chosen role.- Specified by:
utilityCssClassin classWTheme
-
isCanStyleAnchorAsButton
public boolean isCanStyleAnchorAsButton()
Returns whether the theme allows for an anchor to be styled as a button.Returns false.
- Specified by:
isCanStyleAnchorAsButtonin classWTheme
-
loadValidationStyling
public void loadValidationStyling(WApplication app)
Description copied from class:WThemeLoad the required content for validation.The styling, and scripts used for validation are separated. Loading these is not done on theme initialization.
- Overrides:
loadValidationStylingin classWTheme
-
applyValidationStyle
public void applyValidationStyle(WWidget widget, WValidator.Result validation, java.util.EnumSet<ValidationStyleFlag> styles)
Description copied from class:WThemeApplies a style that indicates the result of validation.- Specified by:
applyValidationStylein classWTheme
-
canBorderBoxElement
public boolean canBorderBoxElement(DomElement element)
- Specified by:
canBorderBoxElementin classWTheme
-
applyFunctionalStyling
protected void applyFunctionalStyling(WWidget widget, WWidget child, int widgetRole)
Description copied from class:WThemeApplies the functional part of the theme to a widget's child.Only applies the functional part of the theme. This means that only things that are mandatory for the widget to function properly but depend on the theme are applied.
-
applyOptionalStyling
protected void applyOptionalStyling(WWidget widget, WWidget child, int widgetRole)
Description copied from class:WThemeApplies the optional part of the theme to a widget's child.Only applies the optional part of the theme. This means that only things that are purely cosmetic and do not affect the functionality of the widget are applied.
This should only be called for widgets that have theme styling enabled.
-
-