net.dontdrinkandroot.wicket.bootstrap.behavior
Class IconBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.apache.wicket.markup.transformer.AbstractTransformerBehavior
          extended by net.dontdrinkandroot.wicket.bootstrap.behavior.IconBehavior
All Implemented Interfaces:
java.io.Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.markup.transformer.ITransformer, org.apache.wicket.util.io.IClusterable

public class IconBehavior
extends org.apache.wicket.markup.transformer.AbstractTransformerBehavior

Prepends and/or appends an Icon to the body of the attached component. Icons are specified by an InvertibleIconClass.

Author:
Philip W. Sorst
See Also:
Serialized Form

Constructor Summary
IconBehavior()
          Create an IconBehavior that does not add any Icon initially.
IconBehavior(org.apache.wicket.model.IModel<InvertibleIconClass> beforeIconModel)
          Creates an IconBehavior that prepends the given icon.
IconBehavior(InvertibleIconClass beforeIcon)
          Creates an IconBehavior that prepends the given icon.
 
Method Summary
 InvertibleIconClass getAppendIcon()
          Get the icon to append if set or null.
protected  org.apache.wicket.model.IModel<InvertibleIconClass> getAppendIconModel()
          Get the model of the icon to append.
 InvertibleIconClass getPrependIcon()
          Get the iocn to prepend if set or null.
protected  org.apache.wicket.model.IModel<InvertibleIconClass> getPrependIconModel()
          Get the model of the icon to prepend.
protected  java.lang.String renderIcon(org.apache.wicket.model.IModel<InvertibleIconClass> iconModel)
          Transforms an InvertibleIconClass Model into an italic tag String with the corresponding class attributes.
 IconBehavior setAppendIcon(InvertibleIconClass afterIcon)
          Set the icon to append, if it is null no icon will be appended.
 IconBehavior setAppendIconModel(org.apache.wicket.model.IModel<InvertibleIconClass> appendIconModel)
          Set the model of the icon to append, if it or its object is null no icon will be prepended.
 IconBehavior setPrependIcon(InvertibleIconClass beforeIcon)
          Set the icon to prepend, if it is null no icon will be prepended.
 IconBehavior setPrependIconModel(org.apache.wicket.model.IModel<InvertibleIconClass> prependIconModel)
          Set the model of the icon to prepend, if it or its object is null no icon will be prepended.
 java.lang.CharSequence transform(org.apache.wicket.Component component, java.lang.CharSequence output)
           
 
Methods inherited from class org.apache.wicket.markup.transformer.AbstractTransformerBehavior
afterRender, beforeRender, detach, newResponse
 
Methods inherited from class org.apache.wicket.behavior.Behavior
bind, canCallListenerInterface, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, onRemove, renderHead, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IconBehavior

public IconBehavior()
Create an IconBehavior that does not add any Icon initially.


IconBehavior

public IconBehavior(org.apache.wicket.model.IModel<InvertibleIconClass> beforeIconModel)
Creates an IconBehavior that prepends the given icon.


IconBehavior

public IconBehavior(InvertibleIconClass beforeIcon)
Creates an IconBehavior that prepends the given icon.

Method Detail

transform

public java.lang.CharSequence transform(org.apache.wicket.Component component,
                                        java.lang.CharSequence output)
                                 throws java.lang.Exception
Specified by:
transform in interface org.apache.wicket.markup.transformer.ITransformer
Specified by:
transform in class org.apache.wicket.markup.transformer.AbstractTransformerBehavior
Throws:
java.lang.Exception

getPrependIcon

public InvertibleIconClass getPrependIcon()
Get the iocn to prepend if set or null.


getAppendIcon

public InvertibleIconClass getAppendIcon()
Get the icon to append if set or null.


setPrependIcon

public IconBehavior setPrependIcon(InvertibleIconClass beforeIcon)
Set the icon to prepend, if it is null no icon will be prepended.


setAppendIcon

public IconBehavior setAppendIcon(InvertibleIconClass afterIcon)
Set the icon to append, if it is null no icon will be appended.


setPrependIconModel

public IconBehavior setPrependIconModel(org.apache.wicket.model.IModel<InvertibleIconClass> prependIconModel)
Set the model of the icon to prepend, if it or its object is null no icon will be prepended.


setAppendIconModel

public IconBehavior setAppendIconModel(org.apache.wicket.model.IModel<InvertibleIconClass> appendIconModel)
Set the model of the icon to append, if it or its object is null no icon will be prepended.


getPrependIconModel

protected org.apache.wicket.model.IModel<InvertibleIconClass> getPrependIconModel()
Get the model of the icon to prepend.


getAppendIconModel

protected org.apache.wicket.model.IModel<InvertibleIconClass> getAppendIconModel()
Get the model of the icon to append.


renderIcon

protected java.lang.String renderIcon(org.apache.wicket.model.IModel<InvertibleIconClass> iconModel)
Transforms an InvertibleIconClass Model into an italic tag String with the corresponding class attributes.



Copyright © 2013 dontdrinkandroot. All Rights Reserved.