/** * Construct an instance of the HtmlSelectBooleanCheckbox. */ public HtmlSelectBooleanCheckbox() { setRendererType("javax.faces.Checkbox"); }
/** * <p>Set the value of the <code>accesskey</code> property.</p> * @param accesskey the new property value */ public void setAccesskey(java.lang.String accesskey) { getStateHelper().put(PropertyKeys.accesskey, accesskey); handleAttribute("accesskey", accesskey); }
/** * 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; }
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); } } }
comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("onselect", _onselect); comp.setValueExpression("disabled", _disabled); comp.setValueExpression("readonly", _readonly); comp.setValueExpression("onclick", _onclick); comp.setValueExpression("ondblclick", _ondblclick); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("onkeypress", _onkeypress); comp.setValueExpression("onkeyup", _onkeyup); comp.setValueExpression("onmousedown", _onmousedown); comp.setValueExpression("onmousemove", _onmousemove); comp.setValueExpression("onmouseout", _onmouseout); comp.setValueExpression("onmouseover", _onmouseover); comp.setValueExpression("onmouseup", _onmouseup); comp.setValueExpression("style", _style);
/** {@inheritDoc} */ @Override protected UIOutput getOutput(final PropertyDescriptor<?, ?> property, final RenderContext jsfContext) { Validate.notNull(property, "Property may not be null."); Validate.notNull(jsfContext, "Render context may not be null."); HtmlSelectBooleanCheckbox output; output = new HtmlSelectBooleanCheckbox(); output.setStyleClass(jsfContext.resolveStyleClass(JsfStyleClasses.TABLE_OUTPUT_CHECKBOX)); output.setReadonly(true); output.setValueExpression( "value", this.expressionFactory.createValueExpression(jsfContext.getFacesContext().getELContext(), VariableUtil.compileVariable(jsfContext.getVariable(), jsfContext.getPrefixDeque()), Object.class)); 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); output.getFacets().put("format", htmlFormat); } if (property.isRelation()) { output.setConverter(new EntityNameConverter(property.getPropertyType(), this.getModelExpression())); } return output; }
comp.setValueBinding("style", vb); comp.getAttributes().put("style", _style); comp.setValueBinding("styleClass", vb); comp.getAttributes().put("styleClass", _styleClass); comp.setValueBinding("tabindex", vb); comp.getAttributes().put("tabindex", _tabindex); comp.setValueBinding("onblur", vb); comp.getAttributes().put("onblur", _onblur); comp.setValueBinding("onfocus", vb); comp.getAttributes().put("onfocus", _onfocus); comp.setValueBinding("accesskey", vb); comp.getAttributes().put("accesskey", _accesskey); comp.setValueBinding("onclick", vb); comp.getAttributes().put("onclick", _onclick); comp.setValueBinding("ondblclick", vb);
/** * <p>Return the value of the <code>ondblclick</code> property.</p> * @return the property value * <p>Contents: Javascript code executed when a pointer button is * double clicked over this element. */ public java.lang.String getOndblclick() { return (java.lang.String) getStateHelper().eval(PropertyKeys.ondblclick); }
/** * <p>Return the value of the <code>disabled</code> property.</p> */ public boolean isDisabled() { if (!Util.isEnabledOnUserRole(this)) { return true; } else { return super.isDisabled(); } }
protected boolean isDisabled(FacesContext facesContext, UIComponent component) { //TODO: overwrite in extended HtmlCheckboxRenderer and check for // enabledOnUserRole boolean disabled; boolean readonly; if (component instanceof HtmlSelectBooleanCheckbox) { disabled = ((HtmlSelectBooleanCheckbox) component).isDisabled(); readonly = ((HtmlSelectBooleanCheckbox) component).isReadonly(); } else if (component instanceof HtmlSelectManyCheckbox) { disabled = ((HtmlSelectManyCheckbox) component).isDisabled(); readonly = ((HtmlSelectManyCheckbox) component).isReadonly(); } else { disabled = RendererUtils.getBooleanAttribute(component, HTML.DISABLED_ATTR, false); readonly = RendererUtils.getBooleanAttribute(component, HTML.READONLY_ATTR, false); } if (!disabled && readonly) { disabled = MyfacesConfig.getCurrentInstance(facesContext .getExternalContext()).isReadonlyAsDisabledForSelect(); } return disabled; }
private HtmlSelectBooleanCheckbox createHtmlBooleanCheckbox(Application application, FacesContext facesContext, String elExpression) { HtmlSelectBooleanCheckbox htmlSelectBooleanCheckbox = new HtmlSelectBooleanCheckbox(); htmlSelectBooleanCheckbox.setImmediate(true); ExpressionFactory expressionFactory = application.getExpressionFactory(); ELContext elContext = facesContext.getELContext(); ValueExpression valueExpression = expressionFactory.createValueExpression(elContext, elExpression, boolean.class); htmlSelectBooleanCheckbox.setValueExpression("value", valueExpression); return htmlSelectBooleanCheckbox; }
/** * Binds the value of the specified UIInput to an EL expression corresponding to the Configuration property's * override attribute with the specified name. */ @SuppressWarnings("deprecation") private void setInputOverrideExpression(HtmlSelectBooleanCheckbox input, String propertyName) { // e.g.: #{configuration.simpleProperties['useJavaContext'].override} String expression = String.format(this.overrideExpressionFormat, propertyName); ValueExpression valueExpression = FacesExpressionUtility.createValueExpression(expression, Boolean.class); input.setValueExpression("value", valueExpression); }
/** * Gets Script to be invoked when the element is clicked. * * @return the new onclick value */ public String getOnclick() { if (_onclick != null) { return _onclick; } ValueExpression expression = getValueExpression("onclick"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
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); } } }
comp.setValueExpression("label", _label); comp.setValueExpression("style", _style); comp.setValueExpression("styleClass", _styleClass); comp.setValueExpression("tabindex", _tabindex); comp.setValueExpression("onblur", _onblur); comp.setValueExpression("onfocus", _onfocus); comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("onclick", _onclick); comp.setValueExpression("ondblclick", _ondblclick); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("onkeypress", _onkeypress); comp.setValueExpression("onkeyup", _onkeyup); comp.setValueExpression("onmousedown", _onmousedown); comp.setValueExpression("onmousemove", _onmousemove); comp.setValueExpression("onmouseout", _onmouseout);
/** * <p>Return the value of the <code>onmousemove</code> property.</p> * @return the property value * <p>Contents: Javascript code executed when a pointer button is * moved within this element. */ public java.lang.String getOnmousemove() { return (java.lang.String) getStateHelper().eval(PropertyKeys.onmousemove); }
protected boolean isDisabled(FacesContext facesContext, UIComponent component) { //TODO: overwrite in extended HtmlCheckboxRenderer and check for // enabledOnUserRole if (component instanceof HtmlSelectBooleanCheckbox) { return ((HtmlSelectBooleanCheckbox) component).isDisabled(); } else if (component instanceof HtmlSelectManyCheckbox) { return ((HtmlSelectManyCheckbox) component).isDisabled(); } else { return org.apache.myfaces.shared_impl.renderkit.RendererUtils.getBooleanAttribute(component, HTML.DISABLED_ATTR, false); } }
protected boolean isDisabled(FacesContext facesContext, UIComponent component) { //TODO: overwrite in extended HtmlCheckboxRenderer and check for // enabledOnUserRole boolean disabled; boolean readonly; if (component instanceof HtmlSelectBooleanCheckbox) { disabled = ((HtmlSelectBooleanCheckbox) component).isDisabled(); readonly = ((HtmlSelectBooleanCheckbox) component).isReadonly(); } else if (component instanceof HtmlSelectManyCheckbox) { disabled = ((HtmlSelectManyCheckbox) component).isDisabled(); readonly = ((HtmlSelectManyCheckbox) component).isReadonly(); } else { disabled = RendererUtils.getBooleanAttribute(component, HTML.DISABLED_ATTR, false); readonly = RendererUtils.getBooleanAttribute(component, HTML.READONLY_ATTR, false); } if (!disabled && readonly) { disabled = MyfacesConfig.getCurrentInstance(facesContext .getExternalContext()).isReadonlyAsDisabledForSelect(); } return disabled; }
/** * <p>Set the value of the <code>onchange</code> property.</p> * @param onchange the new property value */ public void setOnchange(java.lang.String onchange) { getStateHelper().put(PropertyKeys.onchange, onchange); handleAttribute("onchange", onchange); }
/** * Gets Script to be invoked when the pointing device is released over this element. * * @return the new onmouseup value */ public String getOnmouseup() { if (_onmouseup != null) { return _onmouseup; } ValueExpression expression = getValueExpression("onmouseup"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }