Package org.apache.myfaces.custom.tree

Examples of org.apache.myfaces.custom.tree.HtmlTreeCheckbox


     * @see javax.faces.render.Renderer#encodeEnd(javax.faces.context.FacesContext,
     *      javax.faces.component.UIComponent)
     */
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
    {
        HtmlTreeCheckbox checkbox = (HtmlTreeCheckbox) component;

        String forAttr = checkbox.getFor();
        if (forAttr == null)
        {
            throw new IllegalStateException("Mandatory attribute 'for'");
        }

        UIComponent uiComponent = checkbox.findComponent(forAttr);
        if (uiComponent == null)
        {
            throw new IllegalStateException("Could not find component '" + forAttr
                                            + "' (calling findComponent on component '" + checkbox.getClientId(context) + "')");
        }
        if (!(uiComponent instanceof UISelectMany))
        {
            throw new IllegalStateException("UISelectMany expected");
        }

        UISelectMany uiSelectMany = (UISelectMany) uiComponent;

        Converter converter;
        try
        {
            converter = RendererUtils.findUISelectManyConverter(context, uiSelectMany);
        }
        catch (FacesException e)
        {
            converter = null;
        }

        Set lookupSet = RendererUtils.getSelectedValuesAsSet(context, component, converter, uiSelectMany);

        Object itemValue = checkbox.getItemValue();
        String itemStrValue = null;
        if (converter == null)
        {
            if (null != itemValue)
            {
                itemStrValue = itemValue.toString();
            }
        }
        else
        {
            itemStrValue = converter.getAsString(context, uiSelectMany, itemValue);
        }

        renderCheckbox(context,
                       uiSelectMany,
                       itemStrValue,
                       checkbox.getItemLabel(),
                       isDisabled(context,uiSelectMany),
                       lookupSet.contains(itemStrValue),
                       true);
    }
View Full Code Here


     * @see javax.faces.render.Renderer#encodeEnd(javax.faces.context.FacesContext,
     *      javax.faces.component.UIComponent)
     */
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
    {
        HtmlTreeCheckbox checkbox = (HtmlTreeCheckbox) component;

        String forAttr = checkbox.getFor();
        if (forAttr == null)
        {
            throw new IllegalStateException("Mandatory attribute 'for'");
        }

        UIComponent uiComponent = checkbox.findComponent(forAttr);
        if (uiComponent == null)
        {
            throw new IllegalStateException("Could not find component '" + forAttr
                    + "' (calling findComponent on component '" + checkbox.getClientId(context) + "')");
        }
        if (!(uiComponent instanceof UISelectMany))
        {
            throw new IllegalStateException("UISelectMany expected");
        }

        UISelectMany uiSelectMany = (UISelectMany) uiComponent;

        Converter converter;
        try
        {
            converter = RendererUtils.findUISelectManyConverter(context, uiSelectMany);
        }
        catch (FacesException e)
        {
            converter = null;
        }
       
        Set lookupSet = RendererUtils.getSelectedValuesAsSet(context, component, converter, uiSelectMany);

        Object itemValue = checkbox.getItemValue();
        String itemStrValue = null;
        if (converter == null)
        {
            if (null != itemValue)
            {
                itemStrValue = itemValue.toString();
            }
        }
        else
        {
            itemStrValue = converter.getAsString(context, uiSelectMany, itemValue);
        }

        renderCheckbox(context, uiSelectMany, itemStrValue, checkbox.getItemLabel(), lookupSet.contains(itemStrValue),
                true);
    }
View Full Code Here

     * @see javax.faces.render.Renderer#encodeEnd(javax.faces.context.FacesContext,
     *      javax.faces.component.UIComponent)
     */
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
    {
        HtmlTreeCheckbox checkbox = (HtmlTreeCheckbox) component;

        String forAttr = checkbox.getFor();
        if (forAttr == null)
        {
            throw new IllegalStateException("Mandatory attribute 'for'");
        }

        UIComponent uiComponent = checkbox.findComponent(forAttr);
        if (uiComponent == null)
        {
            throw new IllegalStateException("Could not find component '" + forAttr
                    + "' (calling findComponent on component '" + checkbox.getClientId(context) + "')");
        }
        if (!(uiComponent instanceof UISelectMany))
        {
            throw new IllegalStateException("UISelectMany expected");
        }

        UISelectMany uiSelectMany = (UISelectMany) uiComponent;

        Converter converter;
        try
        {
            converter = RendererUtils.findUISelectManyConverter(context, uiSelectMany);
        }
        catch (FacesException e)
        {
            converter = null;
        }
       
        Set lookupSet = RendererUtils.getSelectedValuesAsSet(context, component, converter, uiSelectMany);

        Object itemValue = checkbox.getItemValue();
        String itemStrValue = null;
        if (converter == null)
        {
            if (null != itemValue)
            {
                itemStrValue = itemValue.toString();
            }
        }
        else
        {
            itemStrValue = converter.getAsString(context, uiSelectMany, itemValue);
        }

        renderCheckbox(context,
            uiSelectMany,
            itemStrValue,
            checkbox.getItemLabel(),
            isDisabled(context,uiSelectMany),
            lookupSet.contains(itemStrValue),
                true);
    }
View Full Code Here

     * @see javax.faces.render.Renderer#encodeEnd(javax.faces.context.FacesContext,
     *      javax.faces.component.UIComponent)
     */
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException
    {
        HtmlTreeCheckbox checkbox = (HtmlTreeCheckbox) component;

        String forAttr = checkbox.getFor();
        if (forAttr == null)
        {
            throw new IllegalStateException("Mandatory attribute 'for'");
        }

        UIComponent uiComponent = checkbox.findComponent(forAttr);
        if (uiComponent == null)
        {
            throw new IllegalStateException("Could not find component '" + forAttr
                                            + "' (calling findComponent on component '" + checkbox.getClientId(context) + "')");
        }
        if (!(uiComponent instanceof UISelectMany))
        {
            throw new IllegalStateException("UISelectMany expected");
        }

        UISelectMany uiSelectMany = (UISelectMany) uiComponent;

        Converter converter;
        try
        {
            converter = RendererUtils.findUISelectManyConverter(context, uiSelectMany);
        }
        catch (FacesException e)
        {
            converter = null;
        }

        Set lookupSet = RendererUtils.getSelectedValuesAsSet(context, component, converter, uiSelectMany);

        Object itemValue = checkbox.getItemValue();
        String itemStrValue = null;
        if (converter == null)
        {
            if (null != itemValue)
            {
                itemStrValue = itemValue.toString();
            }
        }
        else
        {
            itemStrValue = converter.getAsString(context, uiSelectMany, itemValue);
        }

        renderCheckbox(context,
                       uiSelectMany,
                       itemStrValue,
                       checkbox.getItemLabel(),
                       isDisabled(context,uiSelectMany),
                       lookupSet.contains(itemStrValue),
                       true);
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.custom.tree.HtmlTreeCheckbox

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.