All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.facelets.compiler.AbstractUIHandler Maven / Gradle / Ivy

Go to download

Facelets is an open source alternative view handler technology for JavaServer Faces (JSF).

The newest version!
package com.sun.facelets.compiler;

import javax.faces.component.UIComponent;

import com.sun.facelets.FaceletContext;
import com.sun.facelets.FaceletHandler;
import com.sun.facelets.tag.TextHandler;
import com.sun.facelets.tag.jsf.core.FacetHandler;

public abstract class AbstractUIHandler implements FaceletHandler, TextHandler {

	public void addComponent(FaceletContext ctx, UIComponent parent, UIComponent c) {
		// possible facet scoped
        String facetName = this.getFacetName(ctx, parent);
        if (facetName == null) {
        	parent.getChildren().add(c);
        } else {
        	parent.getFacets().put(facetName, c);
        }
	}
	
	protected final String getFacetName(FaceletContext ctx, UIComponent parent) {
    	return (String) parent.getAttributes().get(FacetHandler.KEY);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy