當前位置: 首頁>>代碼示例>>Java>>正文


Java UIComponent.isRendered方法代碼示例

本文整理匯總了Java中javax.faces.component.UIComponent.isRendered方法的典型用法代碼示例。如果您正苦於以下問題:Java UIComponent.isRendered方法的具體用法?Java UIComponent.isRendered怎麽用?Java UIComponent.isRendered使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.faces.component.UIComponent的用法示例。


在下文中一共展示了UIComponent.isRendered方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRenderedChildCount

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
 * Returns the total number of children with rendered=="true".
 */
@SuppressWarnings("unchecked")
static public int getRenderedChildCount(
  UIComponent component)
{
  int count = component.getChildCount();
  if (count == 0)
    return 0;

  int total = 0;
  for(UIComponent child : (List<UIComponent>)component.getChildren())
  {
    if (child.isRendered())
    {
      total++;
    }
  }

  return total;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:23,代碼來源:CoreRenderer.java

示例2: _renderChildren

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void _renderChildren(
  FacesContext context,
  UIComponent  component,
  NodeData     parentNode
  ) throws IOException
{
  int i = 0;
  for(UIComponent child : (List<UIComponent>)component.getChildren())
  {
    if (child.isRendered())
    {
      // Tell the parent node - if there is one - which child we're rendering
      if (parentNode != null)
      {
        parentNode.currentChild = i;
      }

      encodeChild(context, child);
    }

    i++;
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:25,代碼來源:ColumnGroupRenderer.java

示例3: _renderFacet

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
private void _renderFacet(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      facet,
  String           styleClass
  ) throws IOException
{
  if (facet != null && facet.isRendered())
  {
    ResponseWriter rw = context.getResponseWriter();

    rw.startElement(XhtmlConstants.SPAN_ELEMENT, null);
    renderStyleClass(context, rc, styleClass);
    encodeChild(context, facet);
    rw.endElement(XhtmlConstants.SPAN_ELEMENT);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:18,代碼來源:StatusIndicatorRenderer.java

示例4: _createStation

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
private void _createStation(
    UIXProcess  process,
    UIComponent stamp,
    int         index,
    boolean     active)
{
  process.setRowIndex(index);
  if(stamp.isRendered())
  {
    // The station will be visible.
    _stations.add(new Station(this,
                              stamp,
                              index,
                              process.getRowKey(),
                              active));
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:18,代碼來源:TrainRenderer.java

示例5: _renderComponent

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void _renderComponent(FacesContext context, UIComponent component)
  throws IOException
{
  component.encodeBegin(context);
  if (component.getRendersChildren())
  {
    component.encodeChildren(context);
  }
  else
  {
    int count = component.getChildCount();
    if (count > 0)
    {
      List<UIComponent> children = component.getChildren();
      for (int i = 0; i < count; i++)
      {
        UIComponent child = children.get(i);
        if (child.isRendered())
          _renderComponent(context, child);
      }
    }
  }

  component.encodeEnd(context);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:27,代碼來源:UIComponentUINode.java

示例6: _exportRow

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
private void _exportRow(UIXTable table, Writer out) throws IOException
{
  List children = table.getChildren();
  boolean needsComma = false;
  for (Object o : children)
  {
    UIComponent child = (UIComponent) o;
    if (!child.isRendered())
      continue;

    if (needsComma)
      out.write(',');
    
    if (_exportCell(child, out))
      needsComma = true;
  }
  
  out.write('\n');
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:20,代碼來源:CSVBean.java

示例7: _getDisclosedItemId

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
 *  Returns first disclosed child's Id.
 *
 * @param context the facesContext object
 * @param component
 * @return String id of the first showDetailItem child that can be rendered
 *                and is disclosed
 * @throws IOException
 */
@SuppressWarnings("unchecked")
private static String _getDisclosedItemId(FacesContext context,
                                          UIComponent component)
  throws IOException
{
  String returnId = null;
  ListIterator<UIComponent> iter = component.getChildren().listIterator();

  if (iter == null)
  {
    return null;
  }

  // This will only render UIXShowDetail children.
  // other children are ignored.
  while ( iter.hasNext())
  {
    UIComponent child = iter.next();
    if (! child.isRendered() )
    {
      continue;
    }

    // only CoreShowDetailItem children are rendered. Rest are ignored.
    if ( (child instanceof UIXShowDetail))
    {
      UIXShowDetail detailChild = (UIXShowDetail) child;
      if (detailChild.isDisclosed())
      {
        returnId = detailChild.getClientId(context);
        break;
      }
    }
  }
  return returnId;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:46,代碼來源:ShowOneListRendererBase.java

示例8: _findAndEncodeChild

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
 *  Find and encodes recursivly the child specified.
 *
 *  If the specified child can't be found, doesn't do anything.
 *
 *  @param context the facesContext object
 *  @param parent which contains the child to be encoded
 *  @param disclosedChildId id of the child which occurs in parent
 *         and has to be encoded recursively.
 *
 *  @throws IOException when any IO error while writing markup
 */
@SuppressWarnings("unchecked")
private static void _findAndEncodeChild(FacesContext context,
                                        UIComponent parent,
                                        String disclosedChildId)
  throws IOException
{
  UIComponent disclosedChild = _findChild(context,
                                          parent,
                                          disclosedChildId);

  if (disclosedChild == null)
  {
    return;
  }

  // Paint container span for showDetail child
  ResponseWriter out = context.getResponseWriter();
  out.startElement("span", disclosedChild);

  // Render the children of disclosedChild since the child is disclosed.
  if (disclosedChild.isRendered())
  {
    if (disclosedChild.getChildCount() > 0)
    {
      for(UIComponent child : (List<UIComponent>)disclosedChild.getChildren())
      {
        RenderUtils.encodeRecursive(context, child);
      }
    }
  }

  out.endElement("span");
  // end container span for showDetail child
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:47,代碼來源:ShowOneListRendererBase.java

示例9: willChildrenBeProcessed

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
protected boolean willChildrenBeProcessed(UIComponent component)
{
  if (!component.isRendered())
    return false;

  if (component instanceof TestForm)
    return ((TestForm) component).getWillBeSubmitted();
  else
    return ((CoreForm) component).isSubmitted();
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:12,代碼來源:CoreFormTest.java

示例10: _isVisitable

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
 * default implementation checking the <code>VisitHint.SKIP_TRANSIENT</code> and
 * <code>VisitHint.SKIP_UNRENDERED</code> hints.
 */
private static boolean _isVisitable(VisitContext visitContext, UIComponent component)
{
  Collection<VisitHint> hints = visitContext.getHints();

  if (hints.contains(VisitHint.SKIP_TRANSIENT) && component.isTransient())
    return false;

  if (hints.contains(VisitHint.SKIP_UNRENDERED) && !component.isRendered())
    return false;

  return true;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:17,代碼來源:UIXComponent.java

示例11: getFacet

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
 * Gets a facet, verifying that the facet should be rendered.
 */
static public UIComponent getFacet(
  UIComponent component,
  String      name)
{
  UIComponent facet = component.getFacet(name);
  if ((facet == null) || !facet.isRendered())
    return null;

  return facet;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:14,代碼來源:CoreRenderer.java

示例12: renderKids

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
protected void renderKids(
  FacesContext          context,
  RenderingContext      rc,
  TableRenderingContext trc,
  UIComponent           column
  ) throws IOException
{
  boolean renderedOne = false;
  for(UIComponent child : (List<UIComponent>)column.getChildren())
  {
    if (child.isRendered())
    {
      // Put each component on a separate line, separated by a div
      if (renderedOne)
      {
        ResponseWriter rw = context.getResponseWriter();
        rw.startElement("div", null);
        rw.endElement("div");
      }
      else
      {
        renderedOne = true;
      }

      encodeChild(context, child);
    }
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:30,代碼來源:ColumnRenderer.java

示例13: _renderChildren

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
private static void _renderChildren(FacesContext context, UIComponent root) throws IOException
{
  Iterator<UIComponent> iterator = root.getFacetsAndChildren();
  while (iterator.hasNext())
  {
    UIComponent child = iterator.next();
    if (child.isRendered())
      child.encodeAll(context);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:11,代碼來源:PartialViewContextImpl.java

示例14: getBackIndex

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
public static int getBackIndex(
  UIXCollection component,
  UIComponent    stamp,
  int            startIndex
)
{
  int i = startIndex - 1;
  while (i >= 0)
  {
    component.setRowIndex(i);
    boolean disabled = Boolean.TRUE.equals(
      stamp.getAttributes().get("disabled")); 
    boolean readOnly = Boolean.TRUE.equals(
      stamp.getAttributes().get("readOnly")); 
    boolean rendered = stamp.isRendered();

    // if this node is rendered and not disabled and not readOnly
    // then it can be used as the back button node.
    if (!disabled && !readOnly && rendered)    
    {
      component.setRowIndex(startIndex);
      return i;
    }
      
    i--;
  }
  
  component.setRowIndex(startIndex);
  return NO_INDEX;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:31,代碼來源:ProcessUtils.java

示例15: doTestApplyRequestValues

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected void doTestApplyRequestValues(
  FacesContext context,
  UIViewRoot   root,
  UIComponent  component)
{

  Mock mockUIComponent = createMockUIComponent();
  UIComponent fooChild = (UIComponent) mockUIComponent.proxy();
  
  // JavaServer Faces 1.0 Specification, section 2.2.2
  // During the apply-request-values phase,
  // only the processDecodes lifecycle method may be called.
  if (component.isRendered()){
    mockUIComponent.stubs().method("processDecodes").with(eq(facesContext));
  }

  // These children will never get called
  Mock mockBarChild = createMockUIComponent();
  UIComponent barChild = (UIComponent) mockBarChild.proxy();
  
  Mock mockOrdinaryChild = createMockUIComponent();
  UIComponent ordinaryChild = (UIComponent) mockOrdinaryChild.proxy();

  // construct the UIComponent tree and
  // execute the apply-request-values lifecycle phase
  root.getChildren().add(component);
  component.getFacets().put("foo", fooChild);
  component.getFacets().put("bar", barChild);
  component.getChildren().add(ordinaryChild);
  root.processDecodes(context);

  mockUIComponent.verify();
  mockBarChild.verify();
  mockOrdinaryChild.verify();
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:38,代碼來源:UIXSwitcherTest.java


注:本文中的javax.faces.component.UIComponent.isRendered方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。