org.wamblee.wicket.behavior
Class LocalizedCompositeBehavior

java.lang.Object
  extended by org.wamblee.wicket.behavior.CompositeBehavior
      extended by org.wamblee.wicket.behavior.LocalizedCompositeBehavior
All Implemented Interfaces:
java.io.Serializable, org.apache.wicket.behavior.IBehavior, org.apache.wicket.IClusterable, org.apache.wicket.markup.html.IHeaderContributor

public abstract class LocalizedCompositeBehavior
extends CompositeBehavior

Composite behavior that deals with (optional) localization of the behavior. It does this by creating localized behaviors in the bind callback. This is required because the component is need in order to obtain the resources to use for localization.

See Also:
Serialized Form

Constructor Summary
LocalizedCompositeBehavior(org.apache.wicket.behavior.IBehavior[] aBehaviors, boolean aLocalize)
           
 
Method Summary
 void bind(org.apache.wicket.Component aComponent)
           
protected abstract  org.apache.wicket.behavior.IBehavior[] createLocalizedBehaviors(org.apache.wicket.Component aComponent)
          Callback to create further localized components.
protected  java.lang.String getLocalizedMessage(org.apache.wicket.Component aComponent, java.lang.String aMessage)
          Utility method to obtain a localized message for a given component.
 boolean isLocalized()
           
 
Methods inherited from class org.wamblee.wicket.behavior.CompositeBehavior
add, afterRender, beforeRender, detach, exception, getStatelessHint, isEnabled, isTemporary, onComponentTag, renderHead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizedCompositeBehavior

public LocalizedCompositeBehavior(org.apache.wicket.behavior.IBehavior[] aBehaviors,
                                  boolean aLocalize)
Method Detail

bind

public void bind(org.apache.wicket.Component aComponent)
Specified by:
bind in interface org.apache.wicket.behavior.IBehavior
Overrides:
bind in class CompositeBehavior

isLocalized

public boolean isLocalized()

getLocalizedMessage

protected java.lang.String getLocalizedMessage(org.apache.wicket.Component aComponent,
                                               java.lang.String aMessage)
Utility method to obtain a localized message for a given component.

Parameters:
aComponent - Component.
aMessage - Message or message key in case localization is used.
Returns:
Localized message.

createLocalizedBehaviors

protected abstract org.apache.wicket.behavior.IBehavior[] createLocalizedBehaviors(org.apache.wicket.Component aComponent)
Callback to create further localized components.

Parameters:
aLocalize - True iff localization must be used.
Returns:
Array of behaviors.


Copyright © 2022. All Rights Reserved.