wicket.markup.html.body
Class BodyTagAttributeModifier
java.lang.Object
wicket.behavior.AbstractBehavior
wicket.AttributeModifier
wicket.markup.html.body.BodyTagAttributeModifier
- All Implemented Interfaces:
- java.io.Serializable, IBehavior
public final class BodyTagAttributeModifier
- extends AttributeModifier
An attribute modifier specifically for body tags.
Panels have associated markup files and if they contain
<wicket:head> and <body onLoad="...">
than the body's onLoad attribute will be appended to the page's
onLoad attribute. That appendation happens by means of an AttributeModifier
which the Panel adds to the body container. In the case where the Panel is
removed or replaced, than the AttributeModifier must be removed or at least
disabled. That exactly is what this special purpose AttributeModifier does,
i.e. it disables itself if the owner component (Panel) is removed or replaced.
- Author:
- Juergen Donnerstag
- See Also:
- Serialized Form
|
Constructor Summary |
BodyTagAttributeModifier(java.lang.String attribute,
boolean addAttributeIfNotPresent,
IModel replaceModel,
Component behaviorOwner)
Create a new attribute modifier with the given attribute name and model
to replace with. |
BodyTagAttributeModifier(java.lang.String attribute,
IModel replaceModel,
Component behaviorOwner)
Create a new attribute modifier with the given attribute name and model
to replace with. |
BodyTagAttributeModifier(java.lang.String attribute,
java.lang.String pattern,
boolean addAttributeIfNotPresent,
IModel replaceModel,
Component behaviorOwner)
Create a new attribute modifier with the given attribute name and
expected pattern to match plus the model to replace with. |
BodyTagAttributeModifier(java.lang.String attribute,
java.lang.String pattern,
IModel replaceModel,
Component behaviorOwner)
Create a new attribute modifier with the given attribute name and
expected pattern to match plus the model to replace with. |
|
Method Summary |
protected java.lang.String |
newValue(java.lang.String currentValue,
java.lang.String replacementValue)
Gets the value that should replace the current attribute value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BodyTagAttributeModifier
public BodyTagAttributeModifier(java.lang.String attribute,
boolean addAttributeIfNotPresent,
IModel replaceModel,
Component behaviorOwner)
- Create a new attribute modifier with the given attribute name and model
to replace with. The additional boolean flag specifies whether to add the
attribute if it is not present.
- Parameters:
attribute - The attribute name to replace the value foraddAttributeIfNotPresent - Whether to add the attribute if it is not presentreplaceModel - The model to replace the value withbehaviorOwner - The component which created (owns) the modifier
BodyTagAttributeModifier
public BodyTagAttributeModifier(java.lang.String attribute,
IModel replaceModel,
Component behaviorOwner)
- Create a new attribute modifier with the given attribute name and model
to replace with. The attribute will not be added if it is not present.
- Parameters:
attribute - The attribute name to replace the value forreplaceModel - The model to replace the value withbehaviorOwner - The component which created (owns) the modifier
BodyTagAttributeModifier
public BodyTagAttributeModifier(java.lang.String attribute,
java.lang.String pattern,
boolean addAttributeIfNotPresent,
IModel replaceModel,
Component behaviorOwner)
- Create a new attribute modifier with the given attribute name and
expected pattern to match plus the model to replace with. A null pattern
will match the attribute regardless of its value. The additional boolean
flag specifies whether to add the attribute if it is not present.
- Parameters:
attribute - The attribute name to replace the value forpattern - The pattern of the current attribute value to matchaddAttributeIfNotPresent - Whether to add the attribute if it is not present and the
replacement value is not nullreplaceModel - The model to replace the value withbehaviorOwner - The component which created (owns) the modifier
BodyTagAttributeModifier
public BodyTagAttributeModifier(java.lang.String attribute,
java.lang.String pattern,
IModel replaceModel,
Component behaviorOwner)
- Create a new attribute modifier with the given attribute name and
expected pattern to match plus the model to replace with. A null pattern
will match the attribute regardless of its value. The attribute will not
be added if it is not present.
- Parameters:
attribute - The attribute name to replace the value forpattern - The pattern of the current attribute value to matchreplaceModel - The model to replace the value withbehaviorOwner - The component which created (owns) the modifier
newValue
protected java.lang.String newValue(java.lang.String currentValue,
java.lang.String replacementValue)
- Description copied from class:
AttributeModifier
- Gets the value that should replace the current attribute value. This
gives users the ultimate means to customize what will be used as the
attribute value. For instance, you might decide to append the replacement
value to the current instead of just replacing it as is Wicket's default.
- Overrides:
newValue in class AttributeModifier
- Parameters:
currentValue - The current attribute value. This value might be null!replacementValue - The replacement value. This value might be null!
- Returns:
- The value that should replace the current attribute value
- See Also:
AttributeModifier.newValue(java.lang.String,
java.lang.String)
Copyright © 2004-2007 Wicket developers. All Rights Reserved.