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

org.springframework.faces.ui.DojoWidgetRenderer Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.springframework.faces.ui;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;

public class DojoWidgetRenderer extends DojoElementDecorationRenderer {

	protected String getDojoAttributesAsString(FacesContext context, UIComponent component) {

		DojoWidget advisor = (DojoWidget) component;
		StringBuffer attrs = new StringBuffer();

		for (int i = 0; i < advisor.getDojoAttributes().length; i++) {

			String key = advisor.getDojoAttributes()[i];
			Object value = advisor.getAttributes().get(key);

			if (value != null) {

				if (attrs.length() > 0)
					attrs.append(", ");

				attrs.append(key + " : ");

				if (value instanceof String) {
					attrs.append("'" + value + "'");
				} else {
					attrs.append(value.toString());
				}

			}
		}
		return attrs.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy