net.dontdrinkandroot.wicket.bootstrap.behavior

## Class IconBehavior

- java.lang.Object
- - org.apache.wicket.behavior.Behavior
  - - org.apache.wicket.markup.transformer.AbstractTransformerBehavior
    - - net.dontdrinkandroot.wicket.bootstrap.behavior.IconBehavior

All Implemented Interfaces:
  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 <philip@sorst.net>
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`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

Methods
`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 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.
`CharSequence` `transform(org.apache.wicket.Component component, 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, 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 CharSequence transform(org.apache.wicket.Component component,
                         CharSequence output)
                           throws Exception

Specified by:
  `transform` in interface `org.apache.wicket.markup.transformer.ITransformer`
Specified by:
  `transform` in class `org.apache.wicket.markup.transformer.AbstractTransformerBehavior`
Throws:
  `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 String renderIcon(org.apache.wicket.model.IModel<InvertibleIconClass> iconModel)

Transforms an `InvertibleIconClass` Model into an italic tag String with the corresponding class attributes.