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

Java VisitResult类代码示例

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

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



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

示例1: visit

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

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


示例3: partialEncodeVisit

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


示例4: invokeVisitCallback

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


示例5: visit

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


示例6: visit

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


示例7: safeVisitTree

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


示例8: safeVisitTree

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


示例9: partialEncodeVisit

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


示例10: invokeVisitCallback

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


示例11: visitTree

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
@Override
  public boolean visitTree(VisitContext context, VisitCallback callback) {
if (!isVisitable(context)) {
	return false;
}
// Check for the current component
VisitResult res = context.invokeVisitCallback(this, callback);
if (res == VisitResult.COMPLETE) return true;
if (res == VisitResult.ACCEPT) {
	// we should visit the children if we have ids (all or selected) to visit
	boolean visitChildren = !context.getSubtreeIdsToVisit(this).isEmpty();
	if (visitChildren) {
		// visit the component facets
    	UIComponent facet = selectFacet(); 
    	if(facet!=null) {
    		try {
    			if(facet.visitTree(context, callback)) {
					return true;
        		}
    		} finally {
            	unselectFacet();
    		}
        }
	}
}
  	return false;
  }
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:28,代码来源:UISwitchFacet.java


示例12: visit

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
public VisitResult visit(VisitContext context, UIComponent component) {
	refreshCache(context, component);
	boolean valid = true;
	for (QueryFilter filter : getFilters()) {
		if (!filter.matches(component, FacesContext
				.getCurrentInstance())) {
			valid = false;
			break;
		}
	}
	if (valid) {
		List<VisitCallback> forEach = getCallbacks();
		for (VisitCallback each : forEach) {
			each.visit(context, component);
		}
		add(component);
		/*
		 * List<VisitCallback> forEach = getCallbacks(); for
		 * (VisitCallback each : forEach) { VisitResult thisResult =
		 * each.visit(context, component); switch
		 * (thisResult.compareTo(VisitResult.ACCEPT)) { case 1: //
		 * REJECT return thisResult; case 2: // COMPLETE add(component);
		 * return thisResult; } add(component); }
		 */
	}
	return VisitResult.ACCEPT;
}
 
开发者ID:OpenNTF,项目名称:xsp.extlib,代码行数:28,代码来源:XspQuery.java


示例13: visit

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
public VisitResult visit(final VisitContext context, final UIComponent component) {
	refreshCache(context, component);
	boolean valid = true;
	for (QueryFilter filter : getFilters()) {
		if (!filter.matches(component, FacesContext
		                    .getCurrentInstance())) {
			valid = false;
			break;
		}
	}
	if (valid) {
		List<VisitCallback> forEach = getCallbacks();
		for (VisitCallback each : forEach) {
			each.visit(context, component);
		}
		add(component);
		/*
		 * List<VisitCallback> forEach = getCallbacks(); for
		 * (VisitCallback each : forEach) { VisitResult thisResult =
		 * each.visit(context, component); switch
		 * (thisResult.compareTo(VisitResult.ACCEPT)) { case 1: //
		 * REJECT return thisResult; case 2: // COMPLETE add(component);
		 * return thisResult; } add(component); }
		 */
	}
	return VisitResult.ACCEPT;
}
 
开发者ID:jesse-gallagher,项目名称:XPages-Scaffolding,代码行数:28,代码来源:XspQuery.java


示例14: invokeVisitCallback

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
public VisitResult invokeVisitCallback(UIComponent component,
                                       VisitCallback callback)
{
  // First sure that we should visit this component - ie.
  // that this component is represented in our id set.
  VisitResult result;
 
  if (component instanceof UIXComponent)
  {
    // delegate to the UIXComponent to let it control partial encoding behavior
    result = ((UIXComponent)component).partialEncodeVisit(this,
                                                          PartialPageContextImpl.this,
                                                          callback);
  }
  else
  {
    // check that this component should be encoded
    if (_targetIds.contains(component.getId()) &&
        _targets.containsKey(component.getClientId(_context)))
    {
      // If we made it this far, the component matches one of
      // client ids, so perform the visit.
      result = callback.visit(this, component);         
    }
    else
    {
      // Not visiting this component, but allow visit to
      // continue into this subtree in case we've got
      // visit targets there.
      result = VisitResult.ACCEPT;
    }
  }

  // If we've encoded everything.
  // Return VisitResult.COMPLETE to terminate the visit.
  if (areAllTargetsProcessed())
    return VisitResult.COMPLETE;
  else
  {
    // Otherwise, just return the callback's result 
    return result;
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:44,代码来源:PartialPageContextImpl.java


示例15: invokeVisitCallback

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
@Override
public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback) {
    return callback.visit(this, component);
}
 
开发者ID:ButterFaces,项目名称:ButterFaces,代码行数:5,代码来源:VisitContextImpl.java


示例16: visitTree

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
public boolean visitTree(VisitContext context, VisitCallback callback) {
	// Perform UIComponent's version of visitTree, then UIData's visitTree. If we don't,
	// the RowExpansion will not be found, so it won't be rendered. This should be better
	// understood and optimized.

	if (!isVisitable(context))
		return false;

	// Push ourselves to EL before visiting
	FacesContext facesContext = context.getFacesContext();
	pushComponentToEL(facesContext, null);

	try {
		// Visit ourselves.  Note that we delegate to the
		// VisitContext to actually perform the visit.
		VisitResult result = context.invokeVisitCallback(this, callback);

		// If the visit is complete, short-circuit out and end the visit
		if (result == VisitResult.COMPLETE)
			return true;

		// Visit children if necessary
		if (result == VisitResult.ACCEPT) {
			Iterator<UIComponent> kids = this.getFacetsAndChildren();

			while(kids.hasNext()) {
				boolean done = kids.next().visitTree(context, callback);

				// If any kid visit returns true, we are done.
				if (done)
					return true;
			}
		}
	}
	finally {
		// Pop ourselves off the EL stack
		popComponentFromEL(facesContext);
	}

	return super.visitTree(context, callback);
}
 
开发者ID:edvin,项目名称:tornadofaces,代码行数:42,代码来源:Table.java


示例17: visitTree

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
@Override
public boolean visitTree(VisitContext context, VisitCallback callback) {

	if (this.getVar() == null) {
		return super.visitTree(context, callback);
	}

	// First check to see whether we are visitable. If not
	// short-circuit out of this subtree, though allow the
	// visit to proceed through to other subtrees.
	if (!isVisitable(context)) {
		return false;
	}

	FacesContext facesContext = context.getFacesContext();
	boolean visitRows = requiresRowIteration(context);

	int oldRowIndex = -1;
	if (visitRows) {
		oldRowIndex = getDataModel().getRowIndex();
		setIndex(facesContext, -1);
	}

	this.setDataModel(null);

	// Push ourselves to EL
	pushComponentToEL(facesContext, null);

	try {

		// Visit ourselves. Note that we delegate to the
		// VisitContext to actually perform the visit.
		VisitResult result = context.invokeVisitCallback(this, callback);

		// If the visit is complete, short-circuit out and end the visit
		if (result == VisitResult.COMPLETE) {
			return true;
		}

		// Visit children, short-circuiting as necessary
		if ((result == VisitResult.ACCEPT) && doVisitChildren(context)) {

			// And finally, visit rows
			if (!visitRows) {
				// visit rows without model access
				for (UIComponent kid : getChildren()) {
					if (kid.visitTree(context, callback)) {
						return true;
					}
				}
			} else {
				if (visitChildren(context, callback)) {
					return true;
				}
			}
		}
	} finally {
		// Clean up - pop EL and restore old row index
		popComponentFromEL(facesContext);
		if (visitRows) {
			setIndex(facesContext, oldRowIndex);
		}
	}

	// Return false to allow the visit to continue
	return false;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:68,代码来源:TabRepeat.java


示例18: invokeVisitCallback

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
@Override
public VisitResult invokeVisitCallback(UIComponent component,
		VisitCallback callback) {
	return callback.visit(this, component);
}
 
开发者ID:OpenNTF,项目名称:xsp.extlib,代码行数:6,代码来源:XspQuery.java


示例19: invokeVisitCallback

import javax.faces.component.visit.VisitResult; //导入依赖的package包/类
@Override
public VisitResult invokeVisitCallback(final UIComponent component,
		final VisitCallback callback) {
	return callback.visit(this, component);
}
 
开发者ID:jesse-gallagher,项目名称:XPages-Scaffolding,代码行数:6,代码来源:XspQuery.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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