@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { ResponseWriter writer = context.getResponseWriter(); //Last facet UIComponent last = component.getFacet("last"); if (last != null) { last.encodeAll(context); } writer.endElement("head"); }
public static boolean isFacetOf(final UIComponent component, final UIComponent parent) { for (final Object o : parent.getFacets().keySet()) { final UIComponent facet = parent.getFacet((String) o); if (component.equals(facet)) { return true; } } return false; }
UIComponent inputFacet = child.getFacet("input");
public static void removeFacet(FaceletContext ctx, UIComponent parent, UIComponent c, String facetName) { UIComponent facet = parent.getFacet(facetName); if (Boolean.TRUE.equals(facet.getAttributes().get(FACET_CREATED_UIPANEL_MARKER))) { facet.getChildren().remove(c); } else { parent.getFacets().remove(facetName); } }
public void encodeRowEdit(FacesContext context, TreeTable tt) throws IOException { Map<String, String> params = context.getExternalContext().getRequestParameterMap(); String clientId = tt.getClientId(context); String editedRowKey = params.get(clientId + "_rowEditIndex"); String action = params.get(clientId + "_rowEditAction"); tt.setRowKey(editedRowKey); TreeNode node = tt.getRowNode(); if (action.equals("cancel")) { VisitContext visitContext = null; for (UIColumn column : tt.getColumns()) { for (UIComponent grandkid : column.getChildren()) { if (grandkid instanceof CellEditor) { UIComponent inputFacet = grandkid.getFacet("input"); if (inputFacet instanceof EditableValueHolder) { ((EditableValueHolder) inputFacet).resetValue(); } else { if (visitContext == null) { visitContext = VisitContext.createVisitContext(context, null, ComponentUtils.VISIT_HINTS_SKIP_UNRENDERED); } inputFacet.visitTree(visitContext, ResetInputVisitCallback.INSTANCE); } } } } } encodeNode(context, tt, node); }
for (UIComponent grandkid : column.getChildren()) { if (grandkid instanceof CellEditor) { UIComponent inputFacet = grandkid.getFacet("input");
/** * @see javax.faces.component.UIComponent#getFacet(java.lang.String) */ public UIComponent getFacet(String name) { return parent.getFacet(name); }
/** * @see javax.faces.component.UIComponent#getFacet(java.lang.String) */ @Override public UIComponent getFacet(String name) { return parent.getFacet(name); }
protected List<UIComponent> getFirstResources(FacesContext facesContext, UIComponent uiComponent) { List<UIComponent> resources = null; UIComponent firstFacet = uiComponent.getFacet(FIRST_FACET); if (firstFacet != null) { resources = new ArrayList<UIComponent>(); resources.add(firstFacet); } return resources; }
protected List<UIComponent> getMiddleResources(FacesContext facesContext, UIComponent uiComponent) { List<UIComponent> resources = null; UIComponent firstFacet = uiComponent.getFacet(MIDDLE_FACET); if (firstFacet != null) { resources = new ArrayList<UIComponent>(); resources.add(firstFacet); } return resources; }
@Override public boolean hasContent(FacesContext context, UIComponent component) { UIComponent facet = component.getFacet("initial"); return facet != null && facet.isRendered(); }
@Override public boolean hasContent(FacesContext context, UIComponent component) { UIComponent facet = component.getFacet("finish"); return facet != null && facet.isRendered(); }
private boolean hasRightInputGroup(UIComponent component, SupportedFacets supportedFacets) { return (supportedFacets.getSupportedFacets().contains(InputComponentFacet.BOOTSTRAP_INPUT_GROUP_RIGHT_ADDON)) && component.getFacet(INPUT_GROUP_ADDON_RIGHT) != null || supportedFacets.getSupportedFacets().contains(InputComponentFacet.BOOTSTRAP_INPUT_GROUP_RIGHT_BTN) && component.getFacet(INPUT_GROUP_BTN_RIGHT) != null; }
/** * @param component Component from which to return a facet * @param name Name of the desired facet * @return the specified facet from the specified component, but * <strong>only</strong> if its <code>rendered</code> property is * set to <code>true</code>. */ protected UIComponent getFacet(UIComponent component, String name) { final UIComponent facet = component.getFacet(name); return facet != null && facet.isRendered() ? facet : null; }
@Override public void encodeChildren(FacesContext facesContext, UIComponent uiComponent) throws IOException { UIComponent implicitPanelGroup = uiComponent.getFacet(TabHandler.IMPLICIT_FACET_NAME); // For more information, see TabHandler. if (implicitPanelGroup != null) { implicitPanelGroup.encodeAll(facesContext); } super.encodeChildren(facesContext, uiComponent); }
protected void processColumnHeader(FacesContext fc, OutputTypeHandler outputHandler, UIComponent uiColumn, int colIndex) { UIComponent headerComp = uiColumn.getFacet("header"); if (headerComp != null) { String headerText = encodeParentAndChildrenAsString(fc, headerComp); if (headerText != null) { outputHandler.writeHeaderCell(headerText, colIndex); } } }
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { ResponseWriter writer = context.getResponseWriter(); //Last facet UIComponent last = component.getFacet("last"); if (last != null) { last.encodeAll(context); } writer.endElement("head"); }
public static UIComponent getDecoration(String name, UIComponent component) { UIComponent dec = component.getFacet(name); if (dec!=null) return dec; if ( component.getParent()==null ) return null; return getDecoration( name, component.getParent() ); }
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { ResponseWriter writer = context.getResponseWriter(); //Last facet UIComponent last = component.getFacet("last"); if (last != null) { last.encodeAll(context); } writer.endElement("head"); }