Package org.apache.myfaces.trinidadinternal.ui.data

Examples of org.apache.myfaces.trinidadinternal.ui.data.DataObjectList


   * (number of contained nodes) * (size of the DataObjectList).
   */
  @Override
  public int size(UIXRenderingContext context)
  {
    DataObjectList dol = getDataObjectList(context);
    if (dol == null)
      return 0;
    return dol.getLength() * super.size(context);
  }
View Full Code Here


  public UINode getUINode(
    UIXRenderingContext context,
    int index
    )
  {
    DataObjectList dol = getDataObjectList(context);
    if (dol == null)
      throw new IndexOutOfBoundsException();

    int baseCount   = super.size(context);
    if ((index < 0) || (index >= (baseCount * dol.getLength())))
      throw new IndexOutOfBoundsException();

    DataObject data = dol.getItem(index / baseCount);
    UINode     node = super.getUINode(context, index % baseCount);

    if (data == null)
    {
      return node;
View Full Code Here

        Object o = context.getLocalProperty(0, this, _sNOT_SET_OBJECT);
        if (o != _sNOT_SET_OBJECT)
          return ((DataObjectList) o);
      }

      DataObjectList list =
        BeanAdapterUtils.getAdapterList(context,
                                        _boundData.getValue(context));
      if (context != null)
      {
        context.setLocalProperty(this, list);
View Full Code Here

      }
    }
    else
    {
      // Gather the children
      DataObjectList links = LinkDataObject.getLinkDataList(context,
                                                            navBar);
      MarlinBean     choice = new MarlinBean(CHOICE_NAME);

      int maxVisited = (int) currentValue;
      Object maxVisitedObj = navBar.getAttributeValue(context,
                                                      MAX_VISITED_ATTR);
      if (maxVisitedObj instanceof Number)
        maxVisited = ((Number) maxVisitedObj).intValue();

      // Sanity check the "maxVisited" attribute
      maxVisited = Math.min(maxVisited,
                            links == null ? 0 : links.getLength());
      // Add one option per link, but only go up to the "maxVisited"
      // value.  (BTW, since maxVisited is 1-indexed, but i is 0-indexed,
      // this is an _inclusive_ range here)
      for (int i = 0; i < maxVisited; i++)
      {
        DataObject link = links.getItem(i);
        MarlinBean option = new MarlinBean(OPTION_NAME);
        option.setAttributeValue(TEXT_ATTR,
                                 link.selectValue(context, TEXT_ATTR));
        option.setAttributeValue(VALUE_ATTR, IntegerUtils.getString(i + 1));
View Full Code Here

   * (number of contained nodes) * (size of the DataObjectList).
   */
  @Override
  public int size(UIXRenderingContext context)
  {
    DataObjectList dol = getDataObjectList(context);
    if (dol == null)
      return 0;
    return dol.getLength() * super.size(context);
  }
View Full Code Here

  public UINode getUINode(
    UIXRenderingContext context,
    int index
    )
  {
    DataObjectList dol = getDataObjectList(context);
    if (dol == null)
      throw new IndexOutOfBoundsException();

    int baseCount   = super.size(context);
    if ((index < 0) || (index >= (baseCount * dol.getLength())))
      throw new IndexOutOfBoundsException();

    DataObject data = dol.getItem(index / baseCount);
    UINode     node = super.getUINode(context, index % baseCount);

    if (data == null)
    {
      return node;
View Full Code Here

        Object o = context.getLocalProperty(0, this, _sNOT_SET_OBJECT);
        if (o != _sNOT_SET_OBJECT)
          return ((DataObjectList) o);
      }

      DataObjectList list =
        BeanAdapterUtils.getAdapterList(context,
                                        _boundData.getValue(context));
      if (context != null)
      {
        context.setLocalProperty(this, list);
View Full Code Here

      }
    }
    else
    {
      // Gather the children
      DataObjectList links = LinkDataObject.getLinkDataList(context,
                                                            navBar);
      MarlinBean     choice = new MarlinBean(CHOICE_NAME);

      int maxVisited = (int) currentValue;
      Object maxVisitedObj = navBar.getAttributeValue(context,
                                                      MAX_VISITED_ATTR);
      if (maxVisitedObj instanceof Number)
        maxVisited = ((Number) maxVisitedObj).intValue();

      // Sanity check the "maxVisited" attribute
      maxVisited = Math.min(maxVisited,
                            links == null ? 0 : links.getLength());
      // Add one option per link, but only go up to the "maxVisited"
      // value.  (BTW, since maxVisited is 1-indexed, but i is 0-indexed,
      // this is an _inclusive_ range here)
      for (int i = 0; i < maxVisited; i++)
      {
        DataObject link = links.getItem(i);
        MarlinBean option = new MarlinBean(OPTION_NAME);
        option.setAttributeValue(TEXT_ATTR,
                                 link.selectValue(context, TEXT_ATTR));
        option.setAttributeValue(VALUE_ATTR, IntegerUtils.getString(i + 1));
View Full Code Here

      }
    }
    else
    {
      // Gather the children
      DataObjectList links = LinkDataObject.getLinkDataList(context,
                                                            navBar);
      MarlinBean     choice = new MarlinBean(CHOICE_NAME);

      int maxVisited = (int) currentValue;
      Object maxVisitedObj = navBar.getAttributeValue(context,
                                                      MAX_VISITED_ATTR);
      if (maxVisitedObj instanceof Number)
        maxVisited = ((Number) maxVisitedObj).intValue();

      // Sanity check the "maxVisited" attribute
      maxVisited = Math.min(maxVisited,
                            links == null ? 0 : links.getLength());
      // Add one option per link, but only go up to the "maxVisited"
      // value.  (BTW, since maxVisited is 1-indexed, but i is 0-indexed,
      // this is an _inclusive_ range here)
      for (int i = 0; i < maxVisited; i++)
      {
        DataObject link = links.getItem(i);
        MarlinBean option = new MarlinBean(OPTION_NAME);
        option.setAttributeValue(TEXT_ATTR,
                                 link.selectValue(context, TEXT_ATTR));
        option.setAttributeValue(VALUE_ATTR, IntegerUtils.getString(i + 1));
View Full Code Here

   * (number of contained nodes) * (size of the DataObjectList).
   */
  @Override
  public int size(UIXRenderingContext context)
  {
    DataObjectList dol = getDataObjectList(context);
    if (dol == null)
      return 0;
    return dol.getLength() * super.size(context);
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.ui.data.DataObjectList

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.