Package eu.webtoolkit.jwt
Class WCssTemplateRule
java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WCssRule
eu.webtoolkit.jwt.WCssTemplateRule
public class WCssTemplateRule extends WCssRule
A CSS rule based on a template widget.
This is a CSS rule whose CSS style properties are defined based on properties of a template widget. When modifying the template widget, these changes are reflected on the CSS rule and thus all widgets that have this CSS rule.
- See Also:
WCssStyleSheet
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description WCssTemplateRule(java.lang.String selector)
Creates a CSS rule with a given selector.WCssTemplateRule(java.lang.String selector, WObject parent)
Creates a CSS rule with a given selector. -
Method Summary
Modifier and Type Method Description java.lang.String
getDeclarations()
Returns the declarations.WWidget
getTemplateWidget()
Returns the widget that is used as a template.void
remove()
Destructor.Methods inherited from class eu.webtoolkit.jwt.WCssRule
getSelector, getSheet, modified, setSelector
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, setFormData, setObjectName, tr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WCssTemplateRule
Creates a CSS rule with a given selector.The selector should be a valid CSS selector.
Note: If you want to update the rule, then the selector should be unique and not contain commas, since this is not supported by Microsoft Internet Explorer.
-
WCssTemplateRule
public WCssTemplateRule(java.lang.String selector)Creates a CSS rule with a given selector.
-
-
Method Details
-
remove
public void remove()Description copied from class:WCssRule
Destructor. -
getTemplateWidget
Returns the widget that is used as a template.Various properties of the widget are reflected in the CSS style:
- size and dimensions:
WWidget#resize()
,WWidget#setMinimumSize()
, andWWidget#setMaximumSize()
- its position:
WWidget#setPositionScheme()
,WWidget#setOffsets()
,WWidget#setFloatSide()
,WWidget#setClearSides()
- visibility:
WWidget.hide()
,WWidget.show()
andWWidget#setHidden()
- margins:
WWidget#setMargin()
- line height:
WWidget#setLineHeight()
- all decoration style properties:
WWidget.getDecorationStyle()
When modifying one of these properties of the returned widget, the rule will be updated accordingly.
- size and dimensions:
-
getDeclarations
public java.lang.String getDeclarations()Description copied from class:WCssRule
Returns the declarations.This is a semi-colon separated list of CSS declarations.
- Specified by:
getDeclarations
in classWCssRule
-