@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 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; }
/** * @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); }
/** * 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); }
/** * 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); }
else sc = sc + " " + "input-group-addon"; out.setStyleClass(sc); prependingAddOnFacet.encodeAll(context); } else {
else sc = sc + " " + classToApply; out.setStyleClass(sc); comp.encodeAll(ctx);
else sc = sc + " " + "input-group-addon"; out.setStyleClass(sc); prependingAddOnFacet.encodeAll(context); } else {
heading.setId( FacesUtils.createUniqueId() ); heading.setStyle( mStyle ); heading.setStyleClass( mStyleClass );
heading.setId( FacesUtils.createUniqueId() ); heading.setStyle( mStyle ); heading.setStyleClass( mStyleClass );
else sc = sc + " " + classToApply; out.setStyleClass(sc); comp.encodeAll(ctx);
/** * 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)); }
/** {@inheritDoc} */ @Override public void build(final PropertyDescriptor<P, E> property, final RenderContext context) { Validate.notNull(property, "Descriptor may not be null."); Validate.notNull(context, "Render context may not be null."); final Deque<PropertyDescriptor<?, ?>> prefixes = context.getPrefixDeque(); this.buildLabel(property, context); this.buildMessages(property, context); this.input = new HtmlOutputText(); this.addValue(this.input, prefixes, property, context); this.input.setId(this.compileInputName(prefixes)); this.input.setStyleClass(context.resolveStyleClass(JsfStyleClasses.FORM_INPUT_ROTEXT)); final PresentationPropertyDescriptor<?, ?> presentationProperty = property.adapt(PresentationPropertyDescriptor.class); String format = null; if (!CheckUtil.isNull(presentationProperty)) { format = presentationProperty.getFormat(); } if (!CheckUtil.isNull(format)) { final HtmlFormat htmlFormat = new HtmlFormat(); htmlFormat.setFormat(format); this.input.getFacets().put("format", htmlFormat); } }
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; }
HtmlOutputText output; output = new HtmlOutputText(); output.setStyleClass(jsfContext.resolveStyleClass(JsfStyleClasses.TABLE_OUTPUT_TEXT)); output.setValueExpression( "value",