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

Java VisitContext类代码示例

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

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



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

示例1: visit

import javax.faces.component.visit.VisitContext; //导入依赖的package包/类
public VisitResult visit(
  VisitContext context,
  UIComponent  target)
{
  try
  {
    // we have the subtree we want, render it
    target.encodeAll(context.getFacesContext());
  }
  catch (IOException ioe)
  {
    // launder the IOException as a FacesException, we'll unwrap this later
    throw new FacesException(ioe);
  }

  PartialPageContext pprContext = RenderingContext.getCurrentInstance().getPartialPageContext();

  // if we finished rendering all of the destired targets, return that we are
  // done.  Otherwise, reject this subtree so that we don't traverse into it, since
  // we have already rendered all of the targets in it
  if (pprContext.areAllTargetsProcessed())
    return VisitResult.COMPLETE;
  else
    return VisitResult.REJECT;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:26,代码来源:PanelPartialRootRenderer.java


示例2: _processExecute

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例3: visit

import javax.faces.component.visit.VisitContext; //导入依赖的package包/类
public VisitResult visit(VisitContext context, UIComponent target)
{
  if (_phaseId == PhaseId.APPLY_REQUEST_VALUES)
  {
    target.processDecodes(_context);
  }
  else if (_phaseId == PhaseId.PROCESS_VALIDATIONS)
  {
    target.processValidators(_context);
  }
  else if (_phaseId == PhaseId.UPDATE_MODEL_VALUES)
  {
    target.processUpdates(_context);
  }


  // No need to visit children, since they will be executed/rendred by their parents
  return VisitResult.REJECT;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:20,代码来源:PartialViewContextImpl.java


示例4: partialEncodeVisit

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例5: visitChildrenForEncoding

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例6: visitChildren

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例7: visitAllChildren

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例8: visitUnstampedFacets

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例9: _visitStampedColumnFacets

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例10: _visitChildrenIterating

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例11: _visitChildrenIterating

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例12: visitData

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例13: visitData

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例14: visit

import javax.faces.component.visit.VisitContext; //导入依赖的package包/类
@Override
public VisitResult visit(VisitContext context, UIComponent target) {
	FacesContext facesContext = context.getFacesContext();
	Collection<String> executeIds = facesContext.getPartialViewContext().getExecuteIds();

	if (executeIds.contains(target.getClientId(facesContext))) {
		return VisitResult.REJECT;
	}

	if (target instanceof EditableValueHolder) {
		((EditableValueHolder) target).resetValue();
	}
	else if (context.getIdsToVisit() != VisitContext.ALL_IDS) {
		// Render ID didn't specifically point an EditableValueHolder. Visit all children as well.
		if (!SKIP_COMPONENTS.contains(target.getClass())) {
			try {
				target.visitTree(createVisitContext(facesContext, null, context.getHints()), VISIT_CALLBACK);
			} catch (Exception e) {
				// e.printStackTrace();
			}
		}
	}

	return VisitResult.ACCEPT;
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:26,代码来源:ResetInputAjaxActionListener.java


示例15: visit

import javax.faces.component.visit.VisitContext; //导入依赖的package包/类
@Override
public VisitResult visit(final VisitContext context, final UIComponent target) {
	// if (!target.isRendered()) {
	// return VisitResult.REJECT;
	// }

	if (target instanceof UIInput) {
		this.inputs.add((UIInput) target);
	}
	if (target instanceof UIForm) {
		this.forms.add((UIForm) target);
	}

	if (target instanceof UICommand) {
		this.commands.add((UICommand) target);
	}
	if (target instanceof UIOutput) {
		this.outputs.add((UIOutput) target);
	}
	if (target instanceof UISubmenu) {
		this.subMenus.add((UISubmenu) target);
	}
	if (target instanceof Column) {
		this.columns.add((Column) target);
	}
	if (target instanceof DataTable) {
		this.tables.add((DataTable) target);
	}
	if (target instanceof UISelectItems) {
		this.selectItems.add((UISelectItems) target);
	}
	if (target instanceof PanelGrid) {
		this.panelGrids.add((PanelGrid) target);
	}
	return VisitResult.ACCEPT;
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:37,代码来源:UIFacesVisitor.java


示例16: doVisitChildren

import javax.faces.component.visit.VisitContext; //导入依赖的package包/类
private boolean doVisitChildren(VisitContext context) {

		// Just need to check whether there are any ids under this
		// subtree. Make sure row index is cleared out since
		// getSubtreeIdsToVisit() needs our row-less client id.
		//
		// We only need to position if row iteration is actually needed.
		//
		if (requiresRowIteration(context)) {
			setIndex(context.getFacesContext(), -1);
		}
		Collection<String> idsToVisit = context.getSubtreeIdsToVisit(this);
		assert (idsToVisit != null);

		// All ids or non-empty collection means we need to visit our children.
		return (!idsToVisit.isEmpty());

	}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:19,代码来源:TabRepeat.java


示例17: safeVisitTree

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例18: safeVisitTree

import javax.faces.component.visit.VisitContext; //导入依赖的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


示例19: createVisitContext

import javax.faces.component.visit.VisitContext; //导入依赖的package包/类
public static VisitContext createVisitContext(
 FacesContext       context,
 Collection<String> ids,
 Set<VisitHint>     hints,
 PhaseId            phaseId)
{
  return VisitTreeUtils.createVisitContext(context, ids, hints);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:9,代码来源:MVisitContextFactory.java


示例20: isSkipIterationVisit

import javax.faces.component.visit.VisitContext; //导入依赖的package包/类
/**
 * @param visitContext
 * @return <code>true</code> if this is a non-iterating visit.
 */
public static boolean isSkipIterationVisit(VisitContext visitContext)
{
  FacesContext context = visitContext.getFacesContext();
  Map<Object, Object> attrs = context.getAttributes();
  Object skipIteration = attrs.get("javax.faces.visit.SKIP_ITERATION");

  return Boolean.TRUE.equals(skipIteration);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:13,代码来源:ComponentUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ProviderName类代码示例发布时间:2022-05-22
下一篇:
Java CompilationCustomizer类代码示例发布时间: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