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

net.abstractfactory.plum.view.web.component.WebLabel Maven / Gradle / Ivy

There is a newer version: 0.3.21
Show newest version
package net.abstractfactory.plum.view.web.component;

import net.abstractfactory.plum.view.component.Component;
import net.abstractfactory.plum.view.component.Label;
import net.abstractfactory.plum.view.component.TextBox;
import net.abstractfactory.util.StringEscapeUtils;

import org.jsoup.nodes.Element;
import org.jsoup.nodes.TextNode;
import org.jsoup.nodes.Entities.EscapeMode;
import org.jsoup.parser.Tag;

public class WebLabel extends AbstractWebComponent {
	private final String INPUT_NAME = "span";
	private Element label;

	public WebLabel(String id, Component component) {
		super(id, component);
	}

	protected Label getLabel() {
		return (Label) component;
	}

	public void createHtmlElement() {

		label = new Element(Tag.valueOf("span"), "");

		String oriText = null2Empty(getLabel().getText());
		String escapedText = org.apache.commons.lang3.StringEscapeUtils.escapeHtml4(oriText);
		
		label.appendText(escapedText);

		

		htmlOuterElement = label;
		htmlInnerElement = htmlOuterElement;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy