Package org.xulfaces

Examples of org.xulfaces.IconProvider


  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {

    ResponseWriter responseWriter = facesContext.getResponseWriter();
    TreeCellComponent treeCellComponent = (TreeCellComponent) component;

    IconProvider iconProvider = treeCellComponent.getIconProvider();
    LabelProvider labelProvider = treeCellComponent.getLabelProvider();

    responseWriter.startElement("treecell", component);
   
    treeCellComponent.setNodeId(computeId(treeCellComponent));
    responseWriter.writeAttribute("id", treeCellComponent.getNodeId(), "id");

    String var = treeCellComponent.getVar();
    Object userObject = facesContext.getExternalContext().getSessionMap().get(var);

    if ( (treeCellComponent.getAttributes().get("label") != null|| (labelProvider != null)){
      // Deal with label
      String label = null;
      if (labelProvider != null) {
        label = labelProvider.getText(userObject, TreeRowComponent.CLOSED);
        treeCellComponent.setLabel(label);
      } else {
        Object value = convertAsString(facesContext, component, getProperty(facesContext, "label", component));
        if (value != null) {
          label = value.toString();
        }
      }

      if (label != null) {
        responseWriter.writeAttribute("label", label, "label");
      }
    }

    if ( (treeCellComponent.getAttributes().get("src") != null) || (iconProvider != null)){
      // Deal with src
      String src = null;
      if (iconProvider != null) {
        src = iconProvider.getIcon(userObject, TreeRowComponent.CLOSED);
      } else {
        src = (String) convertAsString(facesContext, component, getProperty(facesContext, "src", component));
      }
      if (src != null) {
        if (!src.equals("")) {
View Full Code Here

TOP

Related Classes of org.xulfaces.IconProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.