org.apache.wicket.markup.html.image
Class ContextPathGenerator

java.lang.Object
  extended by org.apache.wicket.behavior.AbstractBehavior
      extended by org.apache.wicket.markup.html.image.ContextPathGenerator
All Implemented Interfaces:
Serializable, IBehavior, IComponentConfigurationBehavior, IClusterable, IHeaderContributor

public class ContextPathGenerator
extends AbstractBehavior

A behavior that converts the provider url fragment to a context-relative url. For example if the current url is http://localhost/context/product/1231 and the specified url is images/border.jpg the generated url will be ../../images/border.jpg

Author:
Igor Vaynberg (ivaynberg)
See Also:
Serialized Form

Constructor Summary
ContextPathGenerator(IModel<String> contextRelativePath)
          Constructor
ContextPathGenerator(String contextRelativePath)
          Constructor
 
Method Summary
 void detach(Component component)
          Allows the behavior to detach any state it has attached during request processing.
 void onComponentTag(Component component, ComponentTag tag)
          Called any time a component that has this behavior registered is rendering the component tag.
 
Methods inherited from class org.apache.wicket.behavior.AbstractBehavior
afterRender, beforeRender, bind, cleanup, 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

ContextPathGenerator

public ContextPathGenerator(IModel<String> contextRelativePath)
Constructor

Parameters:
contextRelativePath - context-relative path, eg images/border.jpg

ContextPathGenerator

public ContextPathGenerator(String contextRelativePath)
Constructor

Parameters:
contextRelativePath - context-relative path, eg images/border.jpg
Method Detail

onComponentTag

public void onComponentTag(Component component,
                           ComponentTag tag)
Called any time a component that has this behavior registered is rendering the component tag.

Specified by:
onComponentTag in interface IBehavior
Overrides:
onComponentTag in class AbstractBehavior
Parameters:
component - the component that renders this tag currently
tag - the tag that is rendered
See Also:
IBehavior.onComponentTag(org.apache.wicket.Component, org.apache.wicket.markup.ComponentTag)

detach

public void detach(Component component)
Allows the behavior to detach any state it has attached during request processing.

Specified by:
detach in interface IBehavior
Overrides:
detach in class AbstractBehavior
Parameters:
component - the component that initiates the detachment of this behavior
See Also:
IBehavior.detach(Component)


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.