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

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


    UIXRenderingContext context,
    UINode           parent) throws IOException
  {
    int childCount = parent.getIndexedChildCount(context);

    ListDataObjectList list = new ListDataObjectList(childCount);
    BaseLafUtils.setRenderingProperty(context, _DATA_OBJECT_LIST_KEY, list);

    __setDataObjectUsedMode(context, true);
    for (int childIndex = 0; childIndex < childCount; childIndex++)
    {
View Full Code Here


    int indexedChildCount = parent.getIndexedChildCount(context);
    int modelChildCount = component.getRowCount();
    int totalChildCount = indexedChildCount + modelChildCount;
    int selectedIndex = component.getRowIndex();

    ListDataObjectList list = new ListDataObjectList(totalChildCount);
    BaseLafUtils.setRenderingProperty(context, _DATA_OBJECT_LIST_KEY, list);
    __setDataObjectUsedMode(context, true);

    // need newSelectedIndex and newIndex because the selectedIndex passed in
    // ignores what is and isn't rendered, but the list only has
    // what is rendered, so newIndex and newSelectedIndex deal with that.
    int newSelectedIndex = -1;
    int newIndex = 0;

    for (int i = 0; i < modelChildCount; i++)
    {
      component.setRowIndex(i);

      boolean includeStamp = true;
      /*if (checkStampType)
      {
        Object type = stamp.getAttributeValue(context, UIConstants.TYPE_ATTR);
        if (CoreCommandNavigationItem.TYPE_GLOBAL.equals(type))
          includeStamp = false;
      }*/

      if (includeStamp)
      {
        // needed for TrainRenderer. It is important to know what child index
        // this is, not just the index of the visible children.
        LinkDataObject.__setCurrentIndex(context, i);

        if ((stamp != null) &&
            !Boolean.FALSE.equals(
               stamp.getAttributeValue(context, UIConstants.RENDERED_ATTR)))
        {
          context.pushChild(stamp, null, i);
          context.pushRenderedChild(context, stamp);

          try
          {
            if ( i == selectedIndex)
              newSelectedIndex = newIndex;
            stamp.render(context);
          }
          finally
          {
            context.popRenderedChild(context);
            context.popChild();
          }

          newIndex++;
        }
        LinkDataObject.__setCurrentIndex(context, null);
      }
    }

    if ( newSelectedIndex > -1)
    {
      LinkDataObject ldo = (LinkDataObject)list.getItem(newSelectedIndex);
      ldo.setSelected(true);
    }

    for (int childIndex = 0; childIndex < indexedChildCount; childIndex++)
    {
View Full Code Here

   * called by LinkRenderer
   */
  static void __setDataObject(UIXRenderingContext context,
                              LinkDataObject dobj)
  {
    ListDataObjectList dol = (ListDataObjectList)
      BaseLafUtils.getRenderingProperty(context, _DATA_OBJECT_LIST_KEY);
    dol.addItem(dobj);
  }
View Full Code Here

    UIXRenderingContext context,
    UINode           parent) throws IOException
  {
    int childCount = parent.getIndexedChildCount(context);

    ListDataObjectList list = new ListDataObjectList(childCount);
    BaseLafUtils.setRenderingProperty(context, _DATA_OBJECT_LIST_KEY, list);

    __setDataObjectUsedMode(context, true);
    for (int childIndex = 0; childIndex < childCount; childIndex++)
    {
View Full Code Here

    int indexedChildCount = parent.getIndexedChildCount(context);
    int modelChildCount = component.getRowCount();
    int totalChildCount = indexedChildCount + modelChildCount;
    int selectedIndex = component.getRowIndex();

    ListDataObjectList list = new ListDataObjectList(totalChildCount);
    BaseLafUtils.setRenderingProperty(context, _DATA_OBJECT_LIST_KEY, list);
    __setDataObjectUsedMode(context, true);

    // need newSelectedIndex and newIndex because the selectedIndex passed in
    // ignores what is and isn't rendered, but the list only has
    // what is rendered, so newIndex and newSelectedIndex deal with that.
    int newSelectedIndex = -1;
    int newIndex = 0;

    for (int i = 0; i < modelChildCount; i++)
    {
      component.setRowIndex(i);

      boolean includeStamp = true;
      /*if (checkStampType)
      {
        Object type = stamp.getAttributeValue(context, UIConstants.TYPE_ATTR);
        if (CoreCommandNavigationItem.TYPE_GLOBAL.equals(type))
          includeStamp = false;
      }*/

      if (includeStamp)
      {
        // needed for TrainRenderer. It is important to know what child index
        // this is, not just the index of the visible children.
        LinkDataObject.__setCurrentIndex(context, i);

        if ((stamp != null) &&
            !Boolean.FALSE.equals(
               stamp.getAttributeValue(context, UIConstants.RENDERED_ATTR)))
        {
          context.pushChild(stamp, null, i);
          context.pushRenderedChild(context, stamp);

          try
          {
            if ( i == selectedIndex)
              newSelectedIndex = newIndex;
            stamp.render(context);
          }
          finally
          {
            context.popRenderedChild(context);
            context.popChild();
          }

          newIndex++;
        }
        LinkDataObject.__setCurrentIndex(context, null);
      }
    }

    if ( newSelectedIndex > -1)
    {
      LinkDataObject ldo = (LinkDataObject)list.getItem(newSelectedIndex);
      ldo.setSelected(true);
    }

    for (int childIndex = 0; childIndex < indexedChildCount; childIndex++)
    {
View Full Code Here

   * called by LinkRenderer
   */
  static void __setDataObject(UIXRenderingContext context,
                              LinkDataObject dobj)
  {
    ListDataObjectList dol = (ListDataObjectList)
      BaseLafUtils.getRenderingProperty(context, _DATA_OBJECT_LIST_KEY);
    dol.addItem(dobj);
  }
View Full Code Here

    UIXRenderingContext context,
    UINode           parent) throws IOException
  {
    int childCount = parent.getIndexedChildCount(context);

    ListDataObjectList list = new ListDataObjectList(childCount);
    BaseLafUtils.setRenderingProperty(context, _DATA_OBJECT_LIST_KEY, list);

    __setDataObjectUsedMode(context, true);
    for (int childIndex = 0; childIndex < childCount; childIndex++)
    {
View Full Code Here

    int indexedChildCount = parent.getIndexedChildCount(context);
    int modelChildCount = component.getRowCount();
    int totalChildCount = indexedChildCount + modelChildCount;
    int selectedIndex = component.getRowIndex();

    ListDataObjectList list = new ListDataObjectList(totalChildCount);
    BaseLafUtils.setRenderingProperty(context, _DATA_OBJECT_LIST_KEY, list);
    __setDataObjectUsedMode(context, true);

    // need newSelectedIndex and newIndex because the selectedIndex passed in
    // ignores what is and isn't rendered, but the list only has
    // what is rendered, so newIndex and newSelectedIndex deal with that.
    int newSelectedIndex = -1;
    int newIndex = 0;

    for (int i = 0; i < modelChildCount; i++)
    {
      component.setRowIndex(i);

      boolean includeStamp = true;
      /*if (checkStampType)
      {
        Object type = stamp.getAttributeValue(context, UIConstants.TYPE_ATTR);
        if (CoreCommandNavigationItem.TYPE_GLOBAL.equals(type))
          includeStamp = false;
      }*/

      if (includeStamp)
      {
        // needed for TrainRenderer. It is important to know what child index
        // this is, not just the index of the visible children.
        LinkDataObject.__setCurrentIndex(context, i);

        if ((stamp != null) &&
            !Boolean.FALSE.equals(
               stamp.getAttributeValue(context, UIConstants.RENDERED_ATTR)))
        {
          context.pushChild(stamp, null, i);
          context.pushRenderedChild(context, stamp);

          try
          {
            if ( i == selectedIndex)
              newSelectedIndex = newIndex;
            stamp.render(context);
          }
          finally
          {
            context.popRenderedChild(context);
            context.popChild();
          }

          newIndex++;
        }
        LinkDataObject.__setCurrentIndex(context, null);
      }
    }

    if ( newSelectedIndex > -1)
    {
      LinkDataObject ldo = (LinkDataObject)list.getItem(newSelectedIndex);
      ldo.setSelected(true);
    }

    for (int childIndex = 0; childIndex < indexedChildCount; childIndex++)
    {
View Full Code Here

   * called by LinkRenderer
   */
  static void __setDataObject(UIXRenderingContext context,
                              LinkDataObject dobj)
  {
    ListDataObjectList dol = (ListDataObjectList)
      BaseLafUtils.getRenderingProperty(context, _DATA_OBJECT_LIST_KEY);
    dol.addItem(dobj);
  }
View Full Code Here

TOP

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

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.