protected void addComponentToView(FaceletContext ctx, UIComponent parent, UIComponent c, boolean componentFound) { FacesContext context = ctx.getFacesContext(); boolean suppressEvents = ComponentSupport.suppressViewModificationEvents(context); boolean compcomp = UIComponent.isCompositeComponent(c); if (suppressEvents && componentFound && !compcomp) { context.setProcessingEvents(false); } ComponentSupport.addComponent(ctx, parent, c); if (suppressEvents && componentFound && !compcomp) { context.setProcessingEvents(true); } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { ComponentSupport.copyPassthroughAttributes(ctx, parent, owner.getTag()); if (wrapping) { applyWrapping(ctx, parent); } else { applyNested(ctx, parent); } }
protected void doOrphanedChildCleanup(FaceletContext ctx, UIComponent parent, UIComponent c) { FacesContext context = ctx.getFacesContext(); boolean suppressEvents = ComponentSupport.suppressViewModificationEvents(context); if (suppressEvents) { // if the component has already been found, it will be removed // and added back to the view. We don't want to publish events // for this case. context.setProcessingEvents(false); } ComponentSupport.finalizeForDeletion(c); UIViewRoot root = context.getViewRoot(); root.removeComponentResource(context, c, getLocationTarget(ctx)); if (suppressEvents) { // restore the original state context.setProcessingEvents(true); } }
public static UIComponent findUIInstructionChildByTagId(FacesContext context, UIComponent parent, String id) { UIComponent result = null; if (isBuildingNewComponentTree(context)) { return null; } Map<Object, Object> attrs = context.getAttributes(); if (attrs.containsKey(PartialStateSaving)) { if ((Boolean)attrs.get(PartialStateSaving)) { result = findChildByTagId(context, parent, id); } } return result; }
UIComponent c = ComponentSupport.findUIInstructionChildByTagId(context, parent, id); boolean componentFound = false; boolean suppressEvents = false; if (c != null) { componentFound = true; suppressEvents = ComponentSupport.suppressViewModificationEvents(ctx.getFacesContext()); ComponentSupport.markForDeletion(c); } else { Instruction[] applied; uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), mid); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(ctx.getFacesContext(), mid); ComponentSupport.finalizeForDeletion(c); if (suppressEvents) { context.setProcessingEvents(false);
if (isBuildingNewComponentTree(context)) { return null; String cid = null; List<UIComponent> components; String facetName = getFacetName(parent); if (null != facetName) { c = parent.getFacet(facetName); UIComponent foundChild = findChildByTagId(context, c, id); if (foundChild != null) { return foundChild;
/** * See taglib documentation. */ @Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); ResourceBundle bundle = null; try { String name = this.basename.getValue(ctx); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (root != null && root.getLocale() != null) { bundle = ResourceBundle.getBundle(name, root.getLocale(), cl); } else { bundle = ResourceBundle .getBundle(name, Locale.getDefault(), cl); } } catch (Exception e) { throw new TagAttributeException(this.tag, this.basename, e); } ResourceBundleMap map = new ResourceBundleMap(bundle); FacesContext faces = ctx.getFacesContext(); faces.getExternalContext().getRequestMap().put(this.var.getValue(ctx), map); } }
/** * @see com.sun.faces.facelets.Facelet#apply(javax.faces.context.FacesContext, javax.faces.component.UIComponent) */ @Override public void apply(FacesContext facesContext, UIComponent parent) throws IOException { IdMapper idMapper = IdMapper.getMapper(facesContext); boolean mapperSet = false; if (idMapper == null) { IdMapper.setMapper(facesContext, this.mapper); mapperSet = true; } DefaultFaceletContext ctx = new DefaultFaceletContext(facesContext, this); this.refresh(parent); ComponentSupport.markForDeletion(parent); this.root.apply(ctx, parent); ComponentSupport.finalizeForDeletion(parent); this.markApplied(parent); if (mapperSet) { IdMapper.setMapper(facesContext, null); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root != null) { if (this.renderKitId != null) { root.setLocale(ComponentSupport.getLocale(ctx, this.locale)); } catch (TagAttributeException tae) { Object result = this.locale.getObject(ctx);
ComponentSupport.setTagForComponent(context, c, this.owner.getTag()); ComponentSupport.copyPassthroughAttributes(ctx, c, owner.getTag()); adjustIndexOfDynamicChildren(context, c); popComponentFromEL(ctx, c, ccStackManager, compcompPushed);
String cid = null; List<UIComponent> components; String facetName = getFacetName(parent); if (null != facetName) { c = parent.getFacet(facetName); UIComponent foundChild = findChildByTagId(context, c, id); if (foundChild != null) { return foundChild;
@SuppressWarnings({"UnusedDeclaration"}) protected UIComponent findChild(FaceletContext ctx, UIComponent parent, String tagId) { return ComponentSupport.findChildByTagId(ctx.getFacesContext(), parent, tagId); }
@Override public void setAttributes(FaceletContext ctx, Object obj) { super.setAttributes(ctx, obj); NumberConverter c = (NumberConverter) obj; if (this.locale != null) { c.setLocale(ComponentSupport.getLocale(ctx, this.locale)); } }
public void addComponent(FaceletContext ctx, UIComponent parent, UIComponent c) { ComponentSupport.addComponent(ctx, parent, c); }
private void doOrphanedChildCleanup(FaceletContext ctx, UIComponent parent, UIComponent c, boolean parentModified) { if (parentModified) { ComponentSupport.finalizeForDeletion(c); } else { doOrphanedChildCleanup(ctx, parent, c); } }
public static void encodeRecursive(FacesContext context, UIComponent viewToRender) throws IOException, FacesException { if (viewToRender.isRendered()) { viewToRender.encodeBegin(context); if (viewToRender.getRendersChildren()) { viewToRender.encodeChildren(context); } else if (viewToRender.getChildCount() > 0) { Iterator kids = viewToRender.getChildren().iterator(); while (kids.hasNext()) { UIComponent kid = (UIComponent) kids.next(); encodeRecursive(context, kid); } } viewToRender.encodeEnd(context); } }
String facetName = getFacetName(parent); if (facetName == null) { if (child.getAttributes().containsKey(RIConstants.DYNAMIC_COMPONENT)) {
clientId + ".getParent()")); Tag usingPageTag = ComponentSupport.getTagForComponent(context, cc); Map<String, Object> attrs = cc.getAttributes(); BeanInfo componentMetadata = (BeanInfo) attrs.get(UIComponent.BEANINFO_KEY);
UIComponent c = ComponentSupport.findUIInstructionChildByTagId(context, parent, id); boolean componentFound = false; boolean suppressEvents = false; if (c != null) { componentFound = true; suppressEvents = ComponentSupport.suppressViewModificationEvents(ctx.getFacesContext()); ComponentSupport.markForDeletion(c); } else { Instruction[] applied; uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), mid); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(ctx.getFacesContext(), mid); ComponentSupport.finalizeForDeletion(c); if (suppressEvents) { context.setProcessingEvents(false);
public static UIComponent findUIInstructionChildByTagId(FacesContext context, UIComponent parent, String id) { UIComponent result = null; if (isBuildingNewComponentTree(context)) { return null; } Map<Object, Object> attrs = context.getAttributes(); if (attrs.containsKey(PartialStateSaving)) { if ((Boolean)attrs.get(PartialStateSaving)) { result = findChildByTagId(context, parent, id); } } return result; }