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

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.apache.wicket.markup.html.image.ContextPathGenerator
All Implemented Interfaces:
java.io.Serializable, IClusterable, IComponentAwareEventSink, IComponentAwareHeaderContributor

public class ContextPathGenerator
extends Behavior

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<java.lang.String> contextRelativePath)
          Constructor
ContextPathGenerator(java.lang.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.Behavior
afterRender, beforeRender, bind, canCallListenerInterface, getStatelessHint, isEnabled, isTemporary, onConfigure, onEvent, onException, renderHead, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextPathGenerator

public ContextPathGenerator(IModel<java.lang.String> contextRelativePath)
Constructor

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

ContextPathGenerator

public ContextPathGenerator(java.lang.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.

Overrides:
onComponentTag in class Behavior
Parameters:
component - the component that renders this tag currently
tag - the tag that is rendered

detach

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

Overrides:
detach in class Behavior
Parameters:
component - the component that initiates the detachment of this behavior


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