org.wicketstuff.minis.behavior.image
Class AbstractImageDimensionProvider

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.wicketstuff.minis.behavior.image.AbstractImageDimensionProvider
All Implemented Interfaces:
Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable
Direct Known Subclasses:
ImageDimensionProvider

public abstract class AbstractImageDimensionProvider
extends org.apache.wicket.behavior.Behavior

This behavior can be added to Image components to render width and height attributes in the markup. The exact way to retrieve the dimension information is left for the subclasses.

Providing dimension information for elements makes page rendering faster.

Author:
akiraly
See Also:
Serialized Form

Field Summary
static String HEIGHT
          "height" standard html img attribute name
static String WIDTH
          "width" standard html img attribute name
 
Constructor Summary
AbstractImageDimensionProvider()
           
 
Method Summary
protected abstract  ImageDimension getImageDimension(org.apache.wicket.Component component, org.apache.wicket.markup.ComponentTag tag)
          Gets the image dimension.
 void onComponentTag(org.apache.wicket.Component component, org.apache.wicket.markup.ComponentTag tag)
           
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onConfigure, onEvent, onException, onRemove, renderHead, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIDTH

public static final String WIDTH
"width" standard html img attribute name

See Also:
Constant Field Values

HEIGHT

public static final String HEIGHT
"height" standard html img attribute name

See Also:
Constant Field Values
Constructor Detail

AbstractImageDimensionProvider

public AbstractImageDimensionProvider()
Method Detail

getImageDimension

protected abstract ImageDimension getImageDimension(org.apache.wicket.Component component,
                                                    org.apache.wicket.markup.ComponentTag tag)
Gets the image dimension. By default it is called by onComponentTag(Component, ComponentTag).

Parameters:
component - "the component that renders this tag currently"
tag - "the tag that is rendered"
Returns:
image dimension used for width and height, can be null

onComponentTag

public void onComponentTag(org.apache.wicket.Component component,
                           org.apache.wicket.markup.ComponentTag tag)
Overrides:
onComponentTag in class org.apache.wicket.behavior.Behavior


Copyright © 2018. All rights reserved.