Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
License Agreement. Rich Faces - Natural Ajax for Java Server Faces (JSF) Copyright (C) 2007 Exadel, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 package org.ajax4jsf.templatecompiler.elements.html;
 
 import java.util.List;
 
Processing template HTLM-attributes.

Author(s):
ayukhovich@exadel.com (latest modification by $Author: alexsmirnov $)
Version:
$Revision: 1.1.2.3 $ $Date: 2007/02/26 20:48:42 $
 
 public class HTMLElement extends TemplateElementBase {
 	final static private String PRE_TAG_NAME = "pre";
 
 	private static final String PASS_THRU_ATTR = "x:passThruWithExclusions";
 
 	private static final List<StringDEFAULT_EXCLUSIONS = Arrays.asList("class""id");
 	
 			+ "/HTMLElement.vm";
 
 	private String htmlTag;
 
 	private String htmlText;
 
 
 	private Collection<StringpassThruAttributes = null;
 

Parameters:
element
variables
 
 	public HTMLElement(final Node element,
 			final CompilationContext componentBean) {
 		super(elementcomponentBean);
 
 		this. = null;
 		this. = element.getNodeName();
 		this. = componentBean;
 	}

 
 		VelocityContext context = new VelocityContext();
 		context.put("htmlTag"this.);
 		context.put("htmlAttributes"this..getAttributes());
 		context.put("passThruAttributes"this.);
 		if (this. != null) {
 			context.put("htmlText"this.);
 		}
 		return this..processTemplate(getTemplateName(), context);
 
 	}

Returns:
 
	protected String getTemplateName() {
		// TODO Auto-generated method stub
		return ;
	}

Returns:
	public String getEndElement() {
		String sReturnValue;
		Object[] objects = new Object[1];
		objects[0] = this.;
		sReturnValue = new Formatter().format("writer.endElement(\"%s\");",
				objects).toString();
		return sReturnValue;
	}

Parameters:
attributes
	public void processingAttributes(NamedNodeMap attributes) {
		if (attributes == null) {
			return;
		}
		for (int iElement = 0; iElement != attributes.getLength(); iElement++) {
			Node attribute = attributes.item(iElement);
			String attributeName = attribute.getNodeName();
			String attributeValue = attribute.getNodeValue();
			if (attributeName.equals()) {
else {
				this..addAttribute(attributeName, ELParser
						.compileEL(attributeValuethis.));
			}
// for
	}

Parameters:
listPassThruAttributes
	private void processingPassThruAtrribute(String listPassThruAttributes) {
			new TreeSet<String>(HTMLTags.getAttributes(this.));
		String[] excludeAttributes = listPassThruAttributes.split(",");
		for (String attribute : excludeAttributes) {
		}
	}

Set a body text for HTML-tag

Parameters:
nodeText
	public void setText(final String nodeText) {
		String tempStr = null;
		// if TAG is not PRE test do not trim
		if (nodeText.trim().length() != 0) {
				tempStr = nodeText;
else {
				tempStr = nodeText.trim();
			}
		}
		if (null != tempStr) {
			if (null == this.) {
				this. = ELParser.compileEL(tempStrthis.);
else {
				this. = this.
						+ ELParser.compileEL(tempStrthis.);
			}
		}
	}
New to GrepCode? Check out our FAQ X