public HtmlOutputLink() { super(); setRendererType("javax.faces.Link"); }
/** * <p>Set the value of the <code>hreflang</code> property.</p> * @param hreflang the new property value */ public void setHreflang(java.lang.String hreflang) { getStateHelper().put(PropertyKeys.hreflang, hreflang); handleAttribute("hreflang", hreflang); }
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); } } }
/** * 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; }
/** * <p>Return the value of the <code>disabled</code> property.</p> * @return the property value * <p>Contents: Flag indicating that this element must never * receive focus or be included in a subsequent * submit. */ public boolean isDisabled() { return (java.lang.Boolean) getStateHelper().eval(PropertyKeys.disabled, false); }
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);
comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("charset", _charset); comp.setValueExpression("coords", _coords); comp.setValueExpression("hreflang", _hreflang); comp.setValueExpression("rel", _rel); comp.setValueExpression("rev", _rev); comp.setValueExpression("shape", _shape); comp.setValueExpression("target", _target); comp.setValueExpression("type", _type); comp.setValueExpression("disabled", _disabled); comp.setValueExpression("onclick", _onclick); comp.setValueExpression("ondblclick", _ondblclick); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("onkeypress", _onkeypress); comp.setValueExpression("onkeyup", _onkeyup);
private List<ActionLink> getActionLinks(UIComponent component) { List<ActionLink> links = new ArrayList<ActionLink>(); List<UIComponent> children = component.getChildren(); for (Object child : children) { if (child instanceof HtmlOutputLink) { HtmlOutputLink link = (HtmlOutputLink) child; boolean rendered = link.isRendered(); if (rendered) { List<UIComponent> linkChildren = link.getChildren(); String name = null; String action = null; Object value = link.getValue(); if (value != null) { action = value.toString(); } if (linkChildren != null && !linkChildren.isEmpty()) { Object linkChild = linkChildren.get(0); name = linkChild.toString(); } if (name != null && !name.equals("") && action != null && !action.equals("")) { links.add(new ActionLink(name, action)); } } } } return links; }
HttpServletRequest request = (HttpServletRequest) externalContext.getRequest(); String url = component.getValue().toString(); RequestContextHolder requestContext = HDIVUtil.getRequestContext(request); String hdivParameter = requestContext.getHdivParameterName(); for (UIComponent comp : component.getChildren()) { if (comp instanceof UIParameter) { UIParameter param = (UIParameter) comp; component.setValue(url); component.getChildren().add(paramComponent); component.setValue(url);
column.getChildren().add(text); } else { HtmlOutputLink anchor = new HtmlOutputLink(); anchor.setValue(link); anchor.getChildren().add(text);
if (htmlOutputLink.getId().startsWith(ExtensionConstants.GO_PREFIX) || htmlOutputLink.getId().startsWith( ExtensionConstants.JUMP_PREFIX)) { PortletUrlBuilder urlBuilder = new PortletUrlBuilder(); urlBuilder.setBase(base); urlBuilder.setParameterDelimiter("&"); for (Iterator it = htmlOutputLink.getChildren().iterator(); it .hasNext();) { UIComponent child = (UIComponent) it.next(); urlBuilder.setBase(sufiixedBase); urlBuilder.setParameterDelimiter("&"); for (Iterator it = htmlOutputLink.getChildren().iterator(); it .hasNext();) { UIComponent child = (UIComponent) it.next(); if (WindowIdUtil.isNewWindowTarget(htmlOutputLink.getTarget())) { urlBuilder.add(WindowIdUtil.NEWWINDOW, JsfConstants.TRUE);
protected String buildHref(FacesContext context, HtmlOutputLink htmlOutputLink, String encoding) throws IOException { UrlBuilder urlBuilder = new UrlBuilder(); urlBuilder.setBase(ValueHolderUtil.getValueForRender(context, htmlOutputLink)); for (Iterator it = htmlOutputLink.getChildren().iterator(); it .hasNext();) { UIComponent child = (UIComponent) it.next(); if (child instanceof UIParameter) { UIParameter parameter = (UIParameter) child; urlBuilder.add( URLEncoder.encode(parameter.getName(), encoding), URLEncoder.encode(toBlankIfNull(parameter.getValue()), encoding)); } } if (WindowIdUtil.isNewWindowTarget(htmlOutputLink.getTarget())) { urlBuilder.add(WindowIdUtil.NEWWINDOW, JsfConstants.TRUE); } return context.getExternalContext().encodeResourceURL( urlBuilder.build()); }
if (output instanceof HtmlOutputLink) fragmentAttr = ((HtmlOutputLink) output).getFragment();
final HtmlOutputLink link = (HtmlOutputLink) component; final List<UIComponent> children = link.getChildren(); if (children != null) { return exportValue(context, children.get(0));
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); } } }
/** * 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; }
/** * <p>Set the value of the <code>fragment</code> property.</p> * @param fragment the new property value */ public void setFragment(java.lang.String fragment) { getStateHelper().put(PropertyKeys.fragment, fragment); }
comp.setValueExpression("rel", _rel); comp.setValueExpression("onblur", _onblur); comp.setValueExpression("dir", _dir); comp.setValueExpression("shape", _shape); comp.setValueExpression("onmouseup", _onmouseup); comp.setValueExpression("onfocus", _onfocus); comp.setValueExpression("hreflang", _hreflang); comp.setValueExpression("rev", _rev); comp.setValueExpression("type", _type); comp.setValueExpression("lang", _lang); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("onmouseover", _onmouseover); comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("styleClass", _styleClass); comp.setValueExpression("onkeyup", _onkeyup);
private List<ActionLink> getActionLinks(UIComponent component) { List<ActionLink> links = new ArrayList<>(); List<UIComponent> children = component.getChildren(); for (Object child : children) { if (child instanceof HtmlOutputLink) { HtmlOutputLink link = (HtmlOutputLink) child; boolean rendered = link.isRendered(); if (rendered) { List<UIComponent> linkChildren = link.getChildren(); String name = null; String action = null; Object value = link.getValue(); if (value != null) { action = value.toString(); } if (linkChildren != null && !linkChildren.isEmpty()) { Object linkChild = linkChildren.get(0); name = linkChild.toString(); } if (name != null && !name.equals("") && action != null && !action.equals("")) { links.add(new ActionLink(name, action)); } } } } return links; }
if (output instanceof HtmlOutputLink) fragmentAttr = ((HtmlOutputLink) output).getFragment();