This documentation is for an old version of fiftyfive-wicket (2.0.9).


fiftyfive.wicket.css
Class CssClassModifier

java.lang.Object
  extended by org.apache.wicket.behavior.AbstractBehavior
      extended by fiftyfive.wicket.css.CssClassModifier
All Implemented Interfaces:
Serializable, IBehavior, IComponentConfigurationBehavior, IClusterable, IHeaderContributor
Direct Known Subclasses:
IterationCssBehavior

public abstract class CssClassModifier
extends AbstractBehavior

A behavior simliar to AttributeModifier but specially tuned for modifying the HTML class attribute. When this behavior is bound to a component it does the following:

Note that this class is abstract. Subclasses must implement the modifyClasses() to specify what classes are added (or subtracted!) from the class attribute.

Since:
2.0.4
See Also:
Shortcuts.toggledCssClass(String,org.apache.wicket.model.IModel), Serialized Form

Constructor Summary
CssClassModifier()
           
 
Method Summary
protected abstract  void modifyClasses(Component component, Set<String> cssClasses)
          Implemented by subclasses to specify what CSS classes should be added or subtracted to the HTML for this component.
 void onComponentTag(Component component, ComponentTag tag)
          Parse any existing classes declared in the markup for this component and then delegate to modifyClasses().
 
Methods inherited from class org.apache.wicket.behavior.AbstractBehavior
afterRender, beforeRender, bind, cleanup, detach, detachModel, exception, getStatelessHint, isEnabled, isTemporary, onConfigure, onException, onRendered, rendered, renderHead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CssClassModifier

public CssClassModifier()
Method Detail

modifyClasses

protected abstract void modifyClasses(Component component,
                                      Set<String> cssClasses)
Implemented by subclasses to specify what CSS classes should be added or subtracted to the HTML for this component.

Parameters:
component - The component whose HTML element is being rendered.
cssClasses - A set containing all the CSS classes that were declared in the markup for this component, if any. If values are added to this set, they will be emitted in the class attribute of the element when the component renders, with a space separating each value. Values may also be removed in order to prevent them from being emitted.

onComponentTag

public void onComponentTag(Component component,
                           ComponentTag tag)
Parse any existing classes declared in the markup for this component and then delegate to modifyClasses(). Set resulting set of classes on the component tag to render its class attribute with the desired values.

Specified by:
onComponentTag in interface IBehavior
Overrides:
onComponentTag in class AbstractBehavior


Copyright © 2011 55 Minutes. All Rights Reserved.