org.apache.myfaces.view.facelets.tag.ui
Class DecorateHandler

java.lang.Object
  extended by javax.faces.view.facelets.TagHandler
      extended by org.apache.myfaces.view.facelets.tag.ui.DecorateHandler
All Implemented Interfaces:
FaceletHandler, ComponentContainerHandler, TemplateClient

@JSFFaceletTag(name="ui:decorate")
public final class DecorateHandler
extends TagHandler
implements TemplateClient, ComponentContainerHandler

The decorate tag acts the same as a composition tag, but it will not trim everything outside of it. This is useful in cases where you have a list of items in a document, which you would like to be decorated or framed. The sum of it all is that you can take any element in the document and decorate it with some external logic as provided by the template. TODO: REFACTOR - This class could easily use a common parent with CompositionHandler

Version:
$Id: DecorateHandler.java 1306698 2012-03-29 03:13:06Z lu4242 $
Author:
Jacob Hookom

Field Summary
 
Fields inherited from class javax.faces.view.facelets.TagHandler
nextHandler, tag, tagId
 
Constructor Summary
DecorateHandler(TagConfig config)
           
 
Method Summary
 void apply(FaceletContext ctx, UIComponent parent)
           
 boolean apply(FaceletContext ctx, UIComponent parent, String name)
          This contract is much like the normal FaceletHandler.apply method, but it takes in an optional String name which tells this instance what fragment/definition it's looking for.
 
Methods inherited from class javax.faces.view.facelets.TagHandler
getAttribute, getRequiredAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DecorateHandler

public DecorateHandler(TagConfig config)
Parameters:
config -
Method Detail

apply

public void apply(FaceletContext ctx,
                  UIComponent parent)
           throws IOException,
                  FacesException,
                  FaceletException,
                  javax.el.ELException
Specified by:
apply in interface FaceletHandler
Throws:
IOException
FacesException
FaceletException
javax.el.ELException

apply

public boolean apply(FaceletContext ctx,
                     UIComponent parent,
                     String name)
              throws IOException,
                     FacesException,
                     FaceletException,
                     javax.el.ELException
Description copied from interface: TemplateClient
This contract is much like the normal FaceletHandler.apply method, but it takes in an optional String name which tells this instance what fragment/definition it's looking for. If you are a match, apply your logic to the passed UIComponent and return true, otherwise do nothing and return false.

Specified by:
apply in interface TemplateClient
Parameters:
ctx - the FaceletContext of your instance, not the templates'
parent - current UIComponent instance to be applied
name - the String name or null if the whole body should be included
Returns:
true if this client matched/applied the definition for the passed name
Throws:
IOException
FacesException
FaceletException
javax.el.ELException


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.