Refine search
public String getEnumValue() { String componentId = enumOutput.getId(); TableProperty property = (TableProperty)enumOutput.getAttributes().get("property"); return getEnumSelectComponentCode(componentId, property); }
public HtmlOutputText() { super(); setRendererType("javax.faces.Text"); }
/** * <p>Set the value of the <code>role</code> property.</p> */ public void setRole(java.lang.String role) { getStateHelper().put(PropertyKeys.role, role); handleAttribute("role", role); }
String value; HtmlOutputText htmlOutputText = new HtmlOutputText(); htmlOutputText.setValue(value);
HtmlOutputText text = new HtmlOutputText(); text.setValueExpression("value", createValueExpression("#{bean.property}", String.class));
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; }
@Override protected void addSectionWidget( String section, int level, UIComponent container, UIMetawidget metawidget ) { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); HtmlOutputText heading = (HtmlOutputText) application.createComponent( HtmlOutputText.COMPONENT_TYPE ); heading.setId( FacesUtils.createUniqueId() ); heading.setStyle( mStyle ); heading.setStyleClass( mStyleClass ); heading.setValue( localizedSection ); metadataAttributes.put( LABEL, "" ); metadataAttributes.put( WIDE, TRUE ); heading.getAttributes().put( UIMetawidget.COMPONENT_ATTRIBUTE_METADATA, metadataAttributes );
FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); headerText.setId( FacesUtils.createUniqueId() ); headerText.setValue( metawidget.getLabelString( columnAttributes ) ); column.setHeader( headerText );
comp.setValueExpression("escape", _escape); comp.setValueExpression("style", _style); comp.setValueExpression("styleClass", _styleClass); comp.setValueExpression("role", _role); comp.setValueExpression("dir", _dir); comp.setValueExpression("lang", _lang); comp.setValueExpression("title", _title); comp.setValueExpression("value", _value); comp.setValueExpression("converter", _converter); if (s != null) Converter converter = getFacesContext().getApplication().createConverter(s); comp.setConverter(converter);
/** * Gets The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left). * * @return the new dir value */ public String getDir() { if (_dir != null) { return _dir; } ValueExpression expression = getValueExpression("dir"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
Application application = facesContext.getApplication(); uiText.setId(scroller.getId() + id + "_text"); uiText.setTransient(true); uiText.setValue(text); children.add(uiText);
protected void encodeHtmlOutputTextEnd(FacesContext context, HtmlOutputText htmlOutputText) throws IOException { ResponseWriter writer = context.getResponseWriter(); boolean startSpan = false; if (containsAttributeForRender(htmlOutputText, ignoreComponent)) { writer.startElement(JsfConstants.SPAN_ELEM, htmlOutputText); startSpan = true; RendererUtil.renderIdAttributeIfNecessary(writer, htmlOutputText, getIdForRender(context, htmlOutputText)); renderRemainAttributes(htmlOutputText, writer, ignoreComponent); } String value = ValueHolderUtil.getValueForRender(context, htmlOutputText); if (htmlOutputText.isEscape()) { writer.writeText(value, null); } else { writer.write(value); } if (startSpan) { writer.endElement(JsfConstants.SPAN_ELEM); } }
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; }
ValueBinding vb = context.getApplication().createValueBinding(_style); comp.setValueBinding("style", vb); comp.getAttributes().put("style", _style); ValueBinding vb = context.getApplication().createValueBinding(_styleClass); comp.setValueBinding("styleClass", vb); comp.getAttributes().put("styleClass", _styleClass); ValueBinding vb = context.getApplication().createValueBinding(_title); comp.setValueBinding("title", vb); comp.getAttributes().put("title", _title); ValueBinding vb = context.getApplication().createValueBinding(_escape); comp.setValueBinding("escape", vb); comp.getAttributes().put("escape", Boolean.valueOf(_escape)); ValueBinding vb = context.getApplication().createValueBinding(_converter); comp.setValueBinding("converter", vb); Converter converter = getFacesContext().getApplication().createConverter(_converter); comp.setConverter(converter); ValueBinding vb = context.getApplication().createValueBinding(_value); comp.setValueBinding("value", vb);
Validate.notNull(jsfContext, "Render context may not be null."); HtmlOutputText output; output = new HtmlOutputText(); output.setStyleClass(jsfContext.resolveStyleClass(JsfStyleClasses.TABLE_OUTPUT_TEXT)); output.setValueExpression( "value", this.expressionFactory.createValueExpression(jsfContext.getFacesContext().getELContext(), VariableUtil.compileVariable(jsfContext.getVariable(), jsfContext.getPrefixDeque()), Object.class)); final PresentationPropertyDescriptor<?, ?> presentationProperty = property.adapt(PresentationPropertyDescriptor.class); final NumberConverter converter = new NumberConverter(); converter.setPattern(presentationProperty.getFormat()); output.setConverter(converter); final HtmlFormat htmlFormat = new HtmlFormat(); htmlFormat.setFormat(format); output.getFacets().put("format", htmlFormat); output.setConverter(new EntityNameConverter(property.getPropertyType(), this.getModelExpression()));
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
/** * @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); }
/** * 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)); }
/** * <p>Return the value of the <code>dir</code> property.</p> * <p>Contents: Direction indication for text that does not inherit directionality. * Valid values are "LTR" (left-to-right) and "RTL" (right-to-left). * These attributes are case sensitive when rendering to XHTML, so * care must be taken to have the correct case. */ public java.lang.String getDir() { return (java.lang.String) getStateHelper().eval(PropertyKeys.dir); }
@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; }