org.apache.wicket.markup.parser.filter
Class InlineEnclosureHandler

java.lang.Object
  extended by org.apache.wicket.markup.parser.AbstractMarkupFilter
      extended by org.apache.wicket.markup.parser.filter.InlineEnclosureHandler
All Implemented Interfaces:
java.io.Serializable, IClusterable, IMarkupFilter, IComponentResolver

public final class InlineEnclosureHandler
extends AbstractMarkupFilter
implements IComponentResolver

This is a markup inline filter. It identifies enclosures as attribute, for example: <tr wicket:enclosure="">. The <tr> tag used in the example can be replaced with any html tag that can contain child elements. If the 'child' attribute is empty it determines the wicket:id of the child component automatically by analyzing the wicket component (in this case one wicket component is allowed) in between the open and close tags. If the enclosure tag has a 'child' attribute like <tr wicket:enclosure="controllingChildId"> than more than just one wicket component inside the enclosure tags are allowed and the child component which determines the visibility of the enclosure is identified by the 'child' attribute value which must be equal to the relative child id path.

Author:
Joonas Hamalainen, Juergen Donnerstag
See Also:
EnclosureResolver, InlineEnclosure, Serialized Form

Field Summary
static java.lang.String INLINE_ENCLOSURE_ATTRIBUTE_NAME
          Attribute to identify inline enclosures
static java.lang.String INLINE_ENCLOSURE_ID_PREFIX
          The Component id prefix.
 
Constructor Summary
InlineEnclosureHandler()
          Construct.
 
Method Summary
static java.lang.String getInlineEnclosureAttribute(ComponentTag tag)
           
protected  MarkupElement onComponentTag(ComponentTag tag)
          Invoked when a ComponentTag was found.
 Component resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag)
          Try to resolve a component.
 
Methods inherited from class org.apache.wicket.markup.parser.AbstractMarkupFilter
getNextFilter, nextElement, onSpecialTag, postProcess, setNextFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INLINE_ENCLOSURE_ID_PREFIX

public static final java.lang.String INLINE_ENCLOSURE_ID_PREFIX
The Component id prefix.

See Also:
Constant Field Values

INLINE_ENCLOSURE_ATTRIBUTE_NAME

public static final java.lang.String INLINE_ENCLOSURE_ATTRIBUTE_NAME
Attribute to identify inline enclosures

See Also:
Constant Field Values
Constructor Detail

InlineEnclosureHandler

public InlineEnclosureHandler()
Construct.

Method Detail

onComponentTag

protected MarkupElement onComponentTag(ComponentTag tag)
                                throws java.text.ParseException
Description copied from class: AbstractMarkupFilter
Invoked when a ComponentTag was found.

By default this method is also called for WicketTags.

Specified by:
onComponentTag in class AbstractMarkupFilter
Returns:
Usually the same as the tag attribute
Throws:
java.text.ParseException

getInlineEnclosureAttribute

public static final java.lang.String getInlineEnclosureAttribute(ComponentTag tag)
Parameters:
tag -
Returns:
The wicket:enclosure attribute or null if not found

resolve

public Component resolve(MarkupContainer container,
                         MarkupStream markupStream,
                         ComponentTag tag)
Description copied from interface: IComponentResolver
Try to resolve a component.

Specified by:
resolve in interface IComponentResolver
Parameters:
container - The container parsing its markup
markupStream - The current markupStream
tag - The current component tag while parsing the markup
Returns:
component or null if not found


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