String value; HtmlOutputText htmlOutputText = new HtmlOutputText(); htmlOutputText.setValue(value);
@NotNull public static HtmlOutputText createOutputText(FacesComponentIdFactory idFactory, CharSequence value, String styleClass) { HtmlOutputText text = createComponent(HtmlOutputText.class, idFactory); if (value != null) value = value.toString().trim(); text.setValue(value); text.setStyleClass(styleClass); return text; }
@NotNull public static HtmlOutputText addOutputText(@NotNull UIComponent parent, FacesComponentIdFactory idFactory, CharSequence value, String styleClass) { HtmlOutputText text = createComponent(HtmlOutputText.class, idFactory); text.setValue(value); text.setStyleClass(styleClass); parent.getChildren().add(text); return text; }
@NotNull public static HtmlOutputText addVerbatimText(@NotNull UIComponent parent, CharSequence html) { HtmlOutputText outputText = createComponent(HtmlOutputText.class, null); outputText.setEscape(false); outputText.setValue(html); parent.getChildren().add(outputText); return outputText; }
private HtmlPanelGrid gridComponent; public void someFunction(){ HtmlOutputText outPutText = new HtmlOutputText(); outPutText.setValue("Some Text"); gridComponent.getChildren().add(outPutText);
... public class MyBackingBean { ... private HtmlPanelGroup generatedElements = new HtmlPanelGroup(); public void init() { for (Element e : myElements) { // Take any element type you want HtmlOutputText subElement = new HtmlOutputText(); subElement.setValue(e.getText()); generatedElements.getChildren().add(subElement); } }
public static UIComponent addVerbatim(UIComponent parent, String text) throws Exception { HtmlOutputText verbatim = new HtmlOutputText(); verbatim.setTransient(true); verbatim.setValue(text); verbatim.setEscape(false); parent.getChildren().add(verbatim); return verbatim; }
@NotNull public static HtmlColumn addColumn(@NotNull UIComponent parent, FacesComponentIdFactory idFactory, CharSequence headerText, String headerStyle) { HtmlColumn column = createComponent(HtmlColumn.class, idFactory); HtmlOutputText header = new HtmlOutputText(); header.setValue(headerText); header.setStyleClass(headerStyle); column.setHeader(header); parent.getChildren().add(column); return column; }
public static UIComponent addVerbatim(UIComponent parent, String prevId, String text) throws Exception { HtmlOutputText verbatim = new HtmlOutputText(); verbatim.setTransient(true); verbatim.setValue(text); verbatim.setEscape(false); addChild(parent, prevId, verbatim); return verbatim; }
/** * @see org.pivot4j.analytics.property.AbstractPropertyInputEditor#createComponent(org.pivot4j.analytics.property.PropertyDescriptor, * javax.faces.component.UIComponent, javax.el.ValueExpression, * javax.el.MethodExpression, java.lang.String) */ @Override public void createComponent(PropertyDescriptor descriptor, UIComponent parent, ValueExpression expression, MethodExpression listener, String update) { super.createComponent(descriptor, parent, expression, listener, update); HtmlOutputText unitText = new HtmlOutputText(); unitText.setStyleClass("unit-text"); unitText.setValue("(pt)"); parent.getChildren().add(unitText); }
/** * Process the label. * * @param composer * The composer. * @param htmlForm * The form. */ private void processLabel(final Composer<RenderContext, S, E> composer, final UIComponent htmlForm) { final HtmlOutputText labelText = new HtmlOutputText(); labelText.setValue(composer.getLabel()); labelText.setStyleClass(composer.getContext().resolveStyleClass(JsfStyleClasses.FORM_LABEL)); htmlForm.getChildren().add(labelText); }
/** * Creates the label. * * @param composer * The composer. * @param htmlForm * The form. */ private void createLabel(final UIComponent htmlForm, final Composer<RenderContext, ?, ?> composer) { final HtmlOutputText labelText = new HtmlOutputText(); labelText.setValue(composer.getLabel()); labelText.setStyleClass(composer.getContext().resolveStyleClass(JsfStyleClasses.TABLE_LABEL)); htmlForm.getChildren().add(labelText); }
heading.setValue( localizedSection );
heading.setValue( localizedSection );
/** * Sets the label. * * @param jsfContext * The context. * @param label * The label. */ private void setLabel(final RenderContext jsfContext, final String label) { this.label = new HtmlOutputText(); this.label.setId(VariableUtil.compileName("label_", jsfContext.getPrefixDeque())); this.label.setValue(label); this.label.setStyleClass(jsfContext.resolveStyleClass(JsfStyleClasses.TABLE_OUTPUT_LABEL)); }
protected HtmlCommandLink getLink(FacesContext facesContext, HtmlCollapsiblePanel collapsiblePanel) throws IOException { Application application = facesContext.getApplication(); HtmlCommandLink link = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE); link.setId(collapsiblePanel.getId() + LINK_ID); link.setTransient(true); link.setImmediate(true); List children = link.getChildren(); // Create the indicator. You could later make this conditional and render optional images instead HtmlOutputText uiText = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE); uiText.setTransient(true); uiText.setValue(collapsiblePanel.isCollapsed() ? ">" : "ν"); uiText.setEscape(false); uiText.setStyleClass(collapsiblePanel.getIndicatorStyleClass()); uiText.setStyle(collapsiblePanel.getIndicatorStyle()); children.add(uiText); // Create the optional label String label = collapsiblePanel.getTitle(); if (label != null) { uiText = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE); uiText.setTransient(true); uiText.setValue(" " + label); uiText.setStyleClass(collapsiblePanel.getTitleStyleClass()); uiText.setStyle(collapsiblePanel.getTitleStyle()); children.add(uiText); } return link; }
text.setValue(content); text.setId(component.getId() + "_" + valueForLink.getTime() + "_text"); text.setTransient(true);
headerText.setValue( metawidget.getLabelString( columnAttributes ) ); column.setHeader( headerText );
uiText.setId(scroller.getId() + id + "_text"); uiText.setTransient(true); uiText.setValue(text); children.add(uiText);
headerText.setValue( metawidget.getLabelString( columnAttributes ) ); column.setHeader( headerText );