Module wicket.bootstrap.core
Class CssClassNameModifier
java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.AttributeModifier
de.agilecoders.wicket.core.markup.html.bootstrap.behavior.CssClassNameModifier
- All Implemented Interfaces:
Serializable,IComponentAwareEventSink,IComponentAwareHeaderContributor,IClusterable
#### Description
A CssClassNameModifier replaces an existing value with the given value.
#### Usage
<span class="className" wicket:id="foo"></span>
can be modified with these CssClassNameAppender:
```java
link.add(new CssClassNameModifier("className1"));
link.add(new CssClassNameModifier(Arrays.asList("className2", "className3")));
```
this will result in the following markup:
```html
<span class="className2 className3" wicket:id="foo"></span>
```- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wicket.AttributeModifier
AttributeModifier.MarkerValue -
Field Summary
Fields inherited from class org.apache.wicket.AttributeModifier
VALUELESS_ATTRIBUTE_ADD, VALUELESS_ATTRIBUTE_REMOVE -
Constructor Summary
ConstructorsConstructorDescriptionCssClassNameModifier(ICssClassNameProvider cssClassNameProvider) Constructor.CssClassNameModifier(String... appendValue) Constructor.CssClassNameModifier(List<String> appendValueList) Constructor.CssClassNameModifier(IModel<String> appendModel) Creates an AttributeModifier that appends the appendModel's value to the current value of the class attribute, and will add the attribute when it is not there already. -
Method Summary
Methods inherited from class org.apache.wicket.AttributeModifier
append, append, detach, getAttribute, getReplaceModel, newValue, onComponentTag, prepend, prepend, remove, replace, replace, replaceAttributeValue, toStringMethods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListener, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag, renderHead, unbind
-
Constructor Details
-
CssClassNameModifier
Creates an AttributeModifier that appends the appendModel's value to the current value of the class attribute, and will add the attribute when it is not there already.- Parameters:
appendModel- the model supplying a single value to append
-
CssClassNameModifier
Constructor.- Parameters:
appendValue- one or more values to append
-
CssClassNameModifier
Constructor.- Parameters:
appendValueList- a list of values to append
-
CssClassNameModifier
Constructor.- Parameters:
cssClassNameProvider- a css class name provider
-