Package org.apache.myfaces.trinidad.component

Examples of org.apache.myfaces.trinidad.component.UIXTreeTable


                            TableRenderingContext tContext,
                            UIComponent           column) throws IOException
  {
    TreeTableRenderingContext ttrc = (TreeTableRenderingContext) tContext;
    boolean isRTL = arc.isRightToLeft();
    UIXTreeTable hGrid = ttrc.getUIXTreeTable();
    final boolean disclosed;
    final String onclick;
    if (hGrid.isContainer())
    {
      RowKeySet treeState = hGrid.getDisclosedRowKeys();
      String jsVarName = ttrc.getJSVarName();
      if (treeState.isContained())
      {
        disclosed = true;
        onclick = TreeUtils.callJSExpandNode(hGrid, jsVarName, false);
      }
      else
      {
        disclosed = false;
        onclick = TreeUtils.callJSExpandNode(hGrid, jsVarName, true);
      }
    }
    else // not a row container
    {
      disclosed = false;
      onclick = null;
    }

    int focusPath = hGrid.getDepth(TreeUtils.getFocusRowKey(hGrid));
    int depth = hGrid.getDepth() + 1 - focusPath;
    if (!ttrc.isRootNodeRendered())
    {
      // decrease the depth by one if the root node is not rendered to avoid
      // unnecessary indentation
      --depth;
View Full Code Here


      UIComponent child,
      int renderedCount,
      boolean isLastChild) throws IOException
    {
      TreeTableRenderingContext ttrc = TreeTableRenderingContext.getInstance();
      UIXTreeTable tree = ttrc.getUIXTreeTable();
      ResponseWriter out = context.getResponseWriter();
      out.startElement("a", tree);
      out.writeURIAttribute("href", "#" , null);
      // put style classes on the links
      if (isLastChild)
      {
        renderStyleClass(
          context, arc,
          SkinSelectors.AF_TREE_TABLE_MP_SELECTED_STYLE_CLASS);
      }
      else
      {
        renderStyleClass(
          context, arc,
          SkinSelectors.AF_TREE_TABLE_MP_STEP_STYLE_CLASS);
      }
      Object oldPath = tree.getRowKey();
      Object focusRowKey = ttrc.getFocusRowKey();
      List<Object> focusPath = tree.getAllAncestorContainerRowKeys(focusRowKey);
      Object crumbPath = (renderedCount < focusPath.size())
        ? focusPath.get(renderedCount)
        : focusRowKey;
      try
      {
        tree.setRowKey(crumbPath);
        String onclick =
          TreeUtils.callJSFocusNode(tree, ttrc.getJSVarName());
        out.writeAttribute("onclick", onclick , null);
        super.renderLink(context, arc, child, renderedCount, isLastChild);
      }
      finally
      {
        tree.setRowKey(oldPath);
      }
      out.endElement("a");
    }
View Full Code Here

      context.getExternalContext().getRequestParameterMap();

    Object source = parameters.get(TrinidadRenderingConstants.SOURCE_PARAM);
    if (component.getClientId(context).equals(source))
    {
      UIXTreeTable treeTable = (UIXTreeTable) component;
      TreeUtils.decodeExpandEvents(parameters, component,
                                   TreeUtils.getFocusRowKey(treeTable));
      TreeUtils.decodeFocusEvent(parameters, component);
      TreeUtils.decodeGotoEvent(parameters, component);
      // bug 4522210:
View Full Code Here

    final RenderingContext   arc,
    final TreeTableRenderingContext ttrc,
    final FacesBean bean)
    throws IOException
  {
    final UIXTreeTable treeTableBase = ttrc.getUIXTreeTable();
    final ResponseWriter writer = context.getResponseWriter();
    final RowKeySet treeState = treeTableBase.getDisclosedRowKeys();
    final int specialColCount = _getSpecialColCount(ttrc);
    final boolean rootNodeRendered = isRootNodeRendered(bean);

    TableUtils.RowLoop loop = new TableUtils.RowLoop()
    {
      @Override
      protected void loop(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        Object focusPath = TreeUtils.getFocusRowKey(treeTableBase);
        treeTableBase.setRowKey(focusPath);
        processRow(context, treeTable);
      }

      @Override
      protected void processRowImpl(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        if (rootNodeRendered || treeTableBase.getDepth() > 0)
        {
          writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
          renderSingleRow(context, arc, ttrc, treeTableBase);
          writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
        }

//
  //        if (hasInvisibleNodes)
  //        {
  //          //context.addHiddenDataObject(treeTableBase.getRowData());
  //        }

        if (treeTableBase.isContainer())
        {
          if (treeState.isContained() || (rootNodeRendered == false && treeTableBase.getDepth() == 0))
          {
            treeTableBase.enterContainer();
            int rows = treeTableBase.getRows();
            int rowCount = treeTableBase.getRowCount();
            boolean renderNavRow = (rows > 0) &&
              ((rowCount < 0) || (rowCount > rows));
            if (renderNavRow)
            {
              renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_TOP);
            }
            super.loop(context, treeTable);
            if (renderNavRow)
            {
              renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_BOTTOM);
            }
            treeTableBase.exitContainer();
          }
        }
      }
    };
View Full Code Here

      context.getExternalContext().getRequestParameterMap();

    Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
    if (component.getClientId(context).equals(source))
    {
      UIXTreeTable treeTable = (UIXTreeTable) component;
      TreeUtils.decodeExpandEvents(parameters, component,
                                   TreeUtils.getFocusRowKey(treeTable));
      TreeUtils.decodeFocusEvent(parameters, component);
      TreeUtils.decodeGotoEvent(parameters, component);
      // bug 4522210:
View Full Code Here

    final RenderingContext   arc,
    final TreeTableRenderingContext ttrc,
    final FacesBean bean)
    throws IOException
  {
    final UIXTreeTable treeTableBase = ttrc.getUIXTreeTable();
    final ResponseWriter writer = context.getResponseWriter();
    final RowKeySet treeState = treeTableBase.getDisclosedRowKeys();
    final int specialColCount = _getSpecialColCount(ttrc);
    final boolean rootNodeRendered = isRootNodeRendered(bean);

    TableUtils.RowLoop loop = new TableUtils.RowLoop()
    {
      @Override
      protected void loop(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        Object focusPath = TreeUtils.getFocusRowKey(treeTableBase);
        treeTableBase.setRowKey(focusPath);
        processRow(context, treeTable);
      }

      @Override
      protected void processRowImpl(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        if (rootNodeRendered || treeTableBase.getDepth() > 0)
        {
          writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
          renderSingleRow(context, arc, ttrc, treeTableBase);
          writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
        }

//
  //        if (hasInvisibleNodes)
  //        {
  //          //context.addHiddenDataObject(treeTableBase.getRowData());
  //        }

        if (treeTableBase.isContainer())
        {
          if (treeState.isContained() || (rootNodeRendered == false && treeTableBase.getDepth() == 0))
          {
            treeTableBase.enterContainer();
            int rows = treeTableBase.getRows();
            int rowCount = treeTableBase.getRowCount();
            boolean renderNavRow = (rows > 0) &&
              ((rowCount < 0) || (rowCount > rows));
            if (renderNavRow)
            {
              renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_TOP);
            }
            super.loop(context, treeTable);
            if (renderNavRow)
            {
              renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_BOTTOM);
            }
            treeTableBase.exitContainer();
          }
        }
      }
    };
View Full Code Here

      UIComponent child,
      int renderedCount,
      boolean isLastChild) throws IOException
    {
      TreeTableRenderingContext ttrc = TreeTableRenderingContext.getInstance();
      UIXTreeTable tree = ttrc.getUIXTreeTable();
      ResponseWriter out = context.getResponseWriter();
      out.startElement("a", tree);
      out.writeURIAttribute("href", "#" , null);
      // put style classes on the links
      if (isLastChild)
      {
        renderStyleClass(
          context, arc,
          SkinSelectors.AF_TREE_TABLE_MP_SELECTED_STYLE_CLASS);
      }
      else
      {
        renderStyleClass(
          context, arc,
          SkinSelectors.AF_TREE_TABLE_MP_STEP_STYLE_CLASS);
      }
      Object oldPath = tree.getRowKey();
      Object focusRowKey = ttrc.getFocusRowKey();
      List<Object> focusPath = tree.getAllAncestorContainerRowKeys(focusRowKey);
      Object crumbPath = (renderedCount < focusPath.size())
        ? focusPath.get(renderedCount)
        : focusRowKey;
      try
      {
        tree.setRowKey(crumbPath);
        String onclick =
          TreeUtils.callJSFocusNode(tree, ttrc.getJSVarName());
        out.writeAttribute("onclick", onclick , null);
        super.renderLink(context, arc, child, renderedCount, isLastChild);
      }
      finally
      {
        tree.setRowKey(oldPath);
      }
      out.endElement("a");
    }
View Full Code Here

    Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
    clientId = clientId == null ? component.getClientId(facesContext) : clientId;
    if (clientId.equals(source))
    {
      UIXTreeTable treeTable = (UIXTreeTable) component;
      TreeUtils.decodeExpandEvents(parameters, component,
                                   TreeUtils.getFocusRowKey(treeTable));
      TreeUtils.decodeFocusEvent(parameters, component);
      TreeUtils.decodeGotoEvent(parameters, component);
      // bug 4522210:
View Full Code Here

    final TreeTableRenderingContext ttrc,
    final UIComponent               component,
    final FacesBean                 bean
    ) throws IOException
  {
    final UIXTreeTable treeTableBase = ttrc.getUIXTreeTable();
    final ResponseWriter writer = context.getResponseWriter();
    final RowKeySet treeState = treeTableBase.getDisclosedRowKeys();
    final int specialColCount = _getSpecialColCount(ttrc);
    final boolean rootNodeRendered = isRootNodeRendered(component, bean);

    TableUtils.RowLoop loop = new TableUtils.RowLoop()
    {
      @Override
      protected void loop(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        Object focusPath = TreeUtils.getFocusRowKey(treeTableBase);
        treeTableBase.setRowKey(focusPath);
        processRow(context, treeTable);
      }

      @Override
      protected void processRowImpl(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        if (rootNodeRendered || treeTableBase.getDepth() > 0)
        {
          writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
          renderSingleRow(context, rc, ttrc, treeTableBase);
          writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
        }

//
  //        if (hasInvisibleNodes)
  //        {
  //          //context.addHiddenDataObject(treeTableBase.getRowData());
  //        }

        if (treeTableBase.isContainer())
        {
          if (treeState.isContained() || (rootNodeRendered == false && treeTableBase.getDepth() == 0))
          {
            treeTableBase.enterContainer();
            int rows = treeTableBase.getRows();
            int rowCount = treeTableBase.getRowCount();
            boolean renderNavRow = (rows > 0) &&
              ((rowCount < 0) || (rowCount > rows));
            if (renderNavRow)
            {
              renderEmptyTableRow(context, rc, ttrc, specialColCount, _NAV_TOP);
            }
            super.loop(context, treeTable);
            if (renderNavRow)
            {
              renderEmptyTableRow(context, rc, ttrc, specialColCount, _NAV_BOTTOM);
            }
            treeTableBase.exitContainer();
          }
        }
      }
    };
View Full Code Here

      int              renderedCount,
      boolean          isLastChild
      ) throws IOException
    {
      TreeTableRenderingContext ttrc = TreeTableRenderingContext.getInstance();
      UIXTreeTable tree = ttrc.getUIXTreeTable();
      ResponseWriter out = context.getResponseWriter();
      out.startElement("a", tree);
      out.writeURIAttribute("href", "#" , null);
      // put style classes on the links
      if (isLastChild)
      {
        renderStyleClass(
          context, rc,
          SkinSelectors.AF_TREE_TABLE_MP_SELECTED_STYLE_CLASS);
      }
      else
      {
        renderStyleClass(
          context, rc,
          SkinSelectors.AF_TREE_TABLE_MP_STEP_STYLE_CLASS);
      }
      Object oldPath = tree.getRowKey();
      Object focusRowKey = ttrc.getFocusRowKey();
      List<Object> focusPath = tree.getAllAncestorContainerRowKeys(focusRowKey);
      Object crumbPath = (renderedCount < focusPath.size())
        ? focusPath.get(renderedCount)
        : focusRowKey;
      try
      {
        tree.setRowKey(crumbPath);
        String onclick =
          TreeUtils.callJSFocusNode(tree, ttrc.getJSVarName());
        out.writeAttribute("onclick", onclick , null);
        super.renderLink(context, rc, child, renderedCount, isLastChild);
      }
      finally
      {
        tree.setRowKey(oldPath);
      }
      out.endElement("a");
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.component.UIXTreeTable

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.