• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VisitCallback类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.faces.component.visit.VisitCallback的典型用法代码示例。如果您正苦于以下问题:Java VisitCallback类的具体用法?Java VisitCallback怎么用?Java VisitCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VisitCallback类属于javax.faces.component.visit包,在下文中一共展示了VisitCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: _processExecute

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
private void _processExecute(UIViewRoot component, PhaseId phaseId)
{
  // We are only handling visit-based (partial) execution here.
  // Full execution (isExecuteAll() == true) is handled by the UIViewRoot
  // Note that this is different from the render phase

  Collection<String> executeIds = getExecuteIds();
  if (executeIds == null || executeIds.isEmpty())
  {
    _LOG.warning("No execute Ids were supplied for the Ajax request");
    return;
  }

  VisitContext visitContext = VisitContext.createVisitContext(_context, executeIds,
                      EnumSet.of(VisitHint.SKIP_UNRENDERED, VisitHint.EXECUTE_LIFECYCLE));
  VisitCallback visitCallback = new ProcessPhaseCallback(_context, phaseId);

  component.visitTree(visitContext, visitCallback);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:20,代码来源:PartialViewContextImpl.java


示例2: partialEncodeVisit

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
/**
 * <p>
 * Called when visiting the CoreRenderer's component during optimized partial page encoding so
 * that the CoreRenderer can modify what is actually encoded.  For example tab controls often
 * render the tabs for the ShowDetailItems in the tab bar before delegating to the
 * disclosed ShowDetailItem to render the tab content.  As a result, the tab control
 * needs to encode its tab bar if any of its ShowDetailItems are partial targets so that
 * the tab labels, for example, are up-to-date.
 * </p>
 * <p>
 * The default implementation calls the VisitCallback and returns its result if this UIXComponent
 * is a partial target of the current encoding.
 * </p>
 * @param visitContext VisitContext to pass to the VisitCallback
 * @param partialContext PartialPageContext for the current partial encoding
 * @param component The component for the CoreRenderer to visit
 * @param callback VisitCallback to call if this component is a partial target
 * @return The VisitResult controlling continued iteration of the visit.
 */
public VisitResult partialEncodeVisit(
  VisitContext       visitContext,
  PartialPageContext partialContext,
  UIComponent        component,
  VisitCallback      callback)
{
  if (partialContext.isPossiblePartialTarget(component.getId()) &&
      partialContext.isPartialTarget(component.getClientId(visitContext.getFacesContext())))
  {
    // visit the component instance
    return callback.visit(visitContext, component);
  }
  else
  {
    // Not visiting this component, but allow visit to
    // continue into this subtree in case we've got
    // visit targets there.
    return VisitResult.ACCEPT;
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:40,代码来源:CoreRenderer.java


示例3: visitChildrenForEncoding

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
/**
 * Hook to allow the renderer to customize the visitation of the children components
 * of a component during the visitation of a component during rendering.
 *
 * @param component the component which owns the children to visit
 * @param visitContext the visitation context
 * @param callback the visit callback
 * @return <code>true</code> if the visit is complete.
 * @see UIXComponent#visitChildren(VisitContext, VisitCallback)
 */
public boolean visitChildrenForEncoding(
  UIXComponent  component,
  VisitContext  visitContext,
  VisitCallback callback)
{
  // visit the children of the component
  Iterator<UIComponent> kids = getRenderedFacetsAndChildren(
                                 visitContext.getFacesContext(), component);

  while (kids.hasNext())
  {
    // If any kid visit returns true, we are done.
    if (kids.next().visitTree(visitContext, callback))
    {
      return true;
    }
  }

  return false;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:31,代码来源:CoreRenderer.java


示例4: visitChildren

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
/**
* Hook for subclasses to override the manner in which the component's children are visited.  The default
* implementation visits all of the children and facets of the Component.
* <code>setupChildrenVisitingContext</code> will have been called before this method is
* invoked and <code>tearDownChildrenVisitingContext</code> will be called after.
* respectively.  If the purpose of this visit was to encode the component and the
* component uses a CoreRenderer, the CoreRenderer's
* <code>setupChildrenEncodingContext</code> and <code>tearDownChildrenEncodingContext</code>
* will be called before and after this method is invoked, respectively.
* @param visitContext the <code>VisitContext</code> for this visit
* @param callback the <code>VisitCallback</code> instance
* @return <code>true</code> if the visit is complete.
* @see #setupChildrenVisitingContext
* @see #tearDownChildrenVisitingContext
* @see org.apache.myfaces.trinidad.render.CoreRenderer#setupChildrenEncodingContext
* @see org.apache.myfaces.trinidad.render.CoreRenderer#tearDownChildrenEncodingContext
*/
protected boolean visitChildren(
  VisitContext visitContext,
  VisitCallback callback)
{
  // See if this is during encoding, if so, allow the renderer to control the visitation of
  // the children so that any special encoding context may be applied around the visitation
  // of each child.
  if (_isEncodingVisit(visitContext))
  {
    Renderer renderer = getRenderer(visitContext.getFacesContext());
    if (renderer instanceof CoreRenderer)
    {
      CoreRenderer coreRenderer = (CoreRenderer)renderer;
      return coreRenderer.visitChildrenForEncoding(this, visitContext, callback);
    }
  }

  // visit all of the children of the component
  return visitAllChildren(visitContext, callback);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:38,代码来源:UIXComponent.java


示例5: visitAllChildren

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
/**
 * Default implementation of visiting children that visits all children without iterating
 * @param visitContext the <code>VisitContext</code> for this visit
 * @param callback the <code>VisitCallback</code> instance
 * @return <code>true</code> if the visit is complete.
 */
protected final boolean visitAllChildren(
  VisitContext  visitContext,
  VisitCallback callback)
{
  // visit the children of the component
  Iterator<UIComponent> kids =
    visitContext.getHints().contains(VisitHint.SKIP_UNRENDERED) ?
      getRenderedFacetsAndChildren(visitContext.getFacesContext()) :
      getFacetsAndChildren();

  while (kids.hasNext())
  {
    // If any kid visit returns true, we are done.
    if (kids.next().visitTree(visitContext, callback))
    {
      return true;
    }
  }

  return false;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:28,代码来源:UIXComponent.java


示例6: visitUnstampedFacets

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
/**
 * Hook method for subclasses to override to change the behavior
 * of how unstamped facets of the UIXCollection are visited.  The
 * Default implementation visits all of the facets of the
 * UIXCollection.
 */
protected boolean visitUnstampedFacets(
  VisitContext  visitContext,
  VisitCallback callback)
{
  // Visit the facets with no row
  if (getFacetCount() > 0)
  {
    for (UIComponent facet : getFacets().values())
    {
      if (UIXComponent.visitTree(visitContext, facet, callback))
      {
        return true;
      }
    }
  }

  return false;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:25,代码来源:UIXCollection.java


示例7: _visitStampedColumnFacets

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
/**
 * Implementation used to visit each stamped row
 */
private boolean _visitStampedColumnFacets(
  VisitContext      visitContext,
  VisitCallback     callback)
{
  // visit the facets of the stamped columns
  List<UIComponent> stamps = getStamps();

  if (!stamps.isEmpty())
  {
    VisitContext columnVisitingContext = new ColumnFacetsOnlyVisitContext(visitContext);

    for (UIComponent stamp : stamps)
    {
      if (UIXComponent.visitTree(columnVisitingContext, stamp, callback))
      {
        return true;
      }
    }
  }

  return false;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:26,代码来源:UIXCollection.java


示例8: invokeVisitCallback

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
@Override
public VisitResult invokeVisitCallback(
  UIComponent   component,
  VisitCallback visitCallback)
{
  if (component instanceof UIXShowDetail)
  {
    UIXShowDetail showDetail = (UIXShowDetail)component;
    if (_isShowDetailForCurrentComponent(showDetail))
    {
      if (_foundItemToRender || !isChildSelected(showDetail))
      {
        // We already visited the one to be shown
        return VisitResult.REJECT;
      }
      else
      {
        _foundItemToRender = true;
      }
    }
  }

  return super.invokeVisitCallback(component, visitCallback);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:25,代码来源:UIXShowOneTemplate.java


示例9: _visitChildrenIterating

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
private boolean _visitChildrenIterating(
  VisitContext  visitContext,
  VisitCallback callback)
{
  boolean done = visitData(visitContext, callback);
  
  if (!done)
  {
    // process the children
    int childCount = getChildCount();
    if (childCount > 0)
    {
      for (UIComponent child : getChildren())
      {
        done = UIXComponent.visitTree(visitContext, child, callback);
        
        if (done)
          break;
      }
    }          
  }
  
  return done;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:25,代码来源:UIXNavigationPathTemplate.java


示例10: _visitChildrenIterating

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
private boolean _visitChildrenIterating(
  VisitContext  visitContext,
  VisitCallback callback)
{
  boolean done = visitData(visitContext, callback);

  if (!done)
  {
    // process the children
    int childCount = getChildCount();
    if (childCount > 0)
    {
      for (UIComponent child : getChildren())
      {
        done = UIXComponent.visitTree(visitContext, child, callback);

        if (done)
          break;
      }
    }
  }

  return done;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:25,代码来源:UIXProcessTemplate.java


示例11: visitData

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
@Override
protected boolean visitData(
  VisitContext  visitContext,
  VisitCallback callback)
{
  Object oldKey = getRowKey();

  Object focusPath = getFocusRowKey();
  setRowKey(focusPath);

  boolean done;

  try
  {
    done = visitLevel(visitContext, callback, getStamps());
  }
  finally
  {
    setRowKey(oldKey);
  }

  return done;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:24,代码来源:UIXProcessTemplate.java


示例12: visitData

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
@Override
protected boolean visitData(
  VisitContext  visitContext,
  VisitCallback callback)
{
  Object oldKey = getRowKey();

  boolean done;

  try
  {
    HierarchyUtils.__setStartDepthPath(this, getLevel());
    done = visitLevel(visitContext, callback, getStamps());
  }
  finally
  {
    setRowKey(oldKey);
  }

  return done;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:22,代码来源:UIXNavigationLevelTemplate.java


示例13: safeVisitTree

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
public static boolean safeVisitTree(VisitContext context,
		VisitCallback callback, UIComponent component) {
	if (!(isVisitable(context, component))) {
		return false;
	}
	VisitResult res = context.invokeVisitCallback(component, callback);
	if (res == VisitResult.COMPLETE) {
		return true;
	}
	if ((res == VisitResult.ACCEPT)
			&& (((component.getChildCount() > 0) || (component
					.getFacetCount() > 0)))) {
		for (Iterator it = component.getFacetsAndChildren(); it.hasNext();) {
			UIComponent c = (UIComponent) it.next();
			if (safeVisitTree(context, callback, c)) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:OpenNTF,项目名称:xsp.extlib,代码行数:22,代码来源:XspQuery.java


示例14: safeVisitTree

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static boolean safeVisitTree(final VisitContext context,
		final VisitCallback callback, final UIComponent component) {
	if (!(isVisitable(context, component))) {
		return false;
	}
	VisitResult res = context.invokeVisitCallback(component, callback);
	if (res == VisitResult.COMPLETE) {
		return true;
	}
	if ((res == VisitResult.ACCEPT)
			&& (((component.getChildCount() > 0) || (component
					.getFacetCount() > 0)))) {
		for (Iterator<UIComponent> it = component.getFacetsAndChildren(); it.hasNext();) {
			UIComponent c = it.next();
			if (safeVisitTree(context, callback, c)) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:jesse-gallagher,项目名称:XPages-Scaffolding,代码行数:23,代码来源:XspQuery.java


示例15: visitSingleComponent

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
/**
 * Visit a single component in the component tree starting from the view root.
 * <p>Method assumes the {@link RequestContext} is available and a view root must be set on the faces context.</p>
 *
 * @param facesContext the faces context
 * @param clientId the client ID of the component to visit
 * @param visitCallback the callback to be invoked if the component is found
 * @return true if a component was visited
 */
public static boolean visitSingleComponent(
  FacesContext  facesContext,
  String        clientId,
  VisitCallback visitCallback)
{
  VisitContext visitContext = VisitContext.createVisitContext(facesContext,
                                Collections.singleton(clientId), null);
  return UIXComponent.visitTree(visitContext, facesContext.getViewRoot(), visitCallback);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:19,代码来源:VisitTreeUtils.java


示例16: visitLevel

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
protected final boolean visitLevel(
  VisitContext      visitContext,
  VisitCallback     callback,
  List<UIComponent> stamps)
{
  if (getRowCount() != 0)
  {      
    if (!stamps.isEmpty())
    {
      int oldRow = getRowIndex();
      int first = getFirst();
      int last = TableUtils.getLast(this, first);

      try
      {
        for (int i = first; i <= last; i++)
        {
          setRowIndex(i);

          for (UIComponent currStamp : stamps)
          {
            // visit the stamps.  If we have visited all of the visit targets then return early
            if (UIXComponent.visitTree(visitContext, currStamp, callback))
              return true;
          }
        }
      }
      finally
      {
        setRowIndex(oldRow);          
      }
    }
  }
  
  return false;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:37,代码来源:UIXHierarchy.java


示例17: partialEncodeVisit

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
/**
 * <p>
 * Called when visiting the component during optimized partial page encoding so that the
 * component can modify what is actually encoded.  For example tab controls often
 * render the tabs for the ShowDetailItems in the tab bar before delegating to the
 * disclosed ShowDetailItem to render the tab content.  As a result, the tab control
 * needs to encode its tab bar if any of its ShowDetailItems are partial targets so that
 * the tab labels, for example, are up-to-date.
 * </p>
 * <p>
 * The default implementation delegates to the CoreRenderer if this component has one, otherwise
 * it calls the VisitCallback and returns its result if this UIXComponent is a partial
 * target of the current encoding.
 * </p>
 * @param visitContext VisitContext to pass to the VisitCallback
 * @param partialContext PartialPageContext for the current partial encoding
 * @param callback VisitCallback to call if this component is a partial target
 * @return The VisitResult controlling continued iteration of the visit.
 */
public VisitResult partialEncodeVisit(
  VisitContext visitContext,
  PartialPageContext partialContext,
  VisitCallback callback)
{
  FacesContext context  = visitContext.getFacesContext();
  Renderer     renderer = getRenderer(context);

  if (renderer instanceof CoreRenderer)
  {
    // delegate to the CoreRenderer
    return ((CoreRenderer)renderer).partialEncodeVisit(visitContext,
                                                       partialContext,
                                                       this,
                                                       callback);
  }
  else
  {
    // check that this is a component instance that should be encoded
    if (partialContext.isPossiblePartialTarget(getId()) &&
        partialContext.isPartialTarget(getClientId(context)))
    {
      // visit the component instance
      return callback.visit(visitContext, this);
    }
    else
    {
      // Not visiting this component, but allow visit to
      // continue into this subtree in case we've got
      // visit targets there.
      return VisitResult.ACCEPT;
    }
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:54,代码来源:UIXComponent.java


示例18: invokeVisitCallback

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
@Override
public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)
{
  if (component instanceof UIXColumn)
  {
    if (component.getFacetCount() > 0)
    {
      // visit the facet children without filtering for just UIXColumn children
      for (UIComponent facetChild : component.getFacets().values())
      {
        if (UIXComponent.visitTree(getWrapped(), facetChild, callback))
          return VisitResult.COMPLETE;
      }

      // visit the indexed children, recursively looking for more columns
      for (UIComponent child : component.getChildren())
      {
        if (UIXComponent.visitTree(this, child, callback))
          return VisitResult.COMPLETE;
      }
    }
  }

  // at this point, we either have already manually processed the UIXColumn's children, or
  // the component wasn't a UIXColumn and shouldn't be processed
  return VisitResult.REJECT;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:28,代码来源:UIXCollection.java


示例19: visitTree

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
@Override
public boolean visitTree(
  VisitContext  visitContext,
  VisitCallback callback)
{
  if (visitContext.getHints().contains(VisitHint.SKIP_UNRENDERED))
  {
    // Filter which children to be visited so that only one show detail
    // is visited for this show one component
    visitContext = new PartialVisitContext(visitContext);
  }
  return super.visitTree(visitContext, callback);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:14,代码来源:UIXShowOneTemplate.java


示例20: visitChildren

import javax.faces.component.visit.VisitCallback; //导入依赖的package包/类
@Override
protected boolean visitChildren(
  VisitContext  visitContext,
  VisitCallback callback)
{
  if (ComponentUtils.isSkipIterationVisit(visitContext))
  {
    return visitChildrenWithoutIterating(visitContext, callback);
  }
  else
  {
    return visitData(visitContext, callback);
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:15,代码来源:UIXTreeTemplate.java



注:本文中的javax.faces.component.visit.VisitCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WorkgroupInvitation类代码示例发布时间:2022-05-22
下一篇:
Java RefreshNamenodesRequestProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap