Refine search
public static void addComponentResource(FacesContext context, String name, String library, String target) { Application application = context.getApplication(); UIComponent componentResource = application.createComponent(UIOutput.COMPONENT_TYPE); componentResource.setRendererType(application.getResourceHandler().getRendererTypeForResourceName(name)); componentResource.getAttributes().put("name", name); componentResource.getAttributes().put("library", library); componentResource.getAttributes().put("target", target); context.getViewRoot().addComponentResource(context, componentResource, target); }
public static void includeCompositeComponent(UIComponent parent, String libraryName, String resourceName, String id) { // Prepare. FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY); // This basically creates <ui:component> based on <composite:interface>. Resource resource = application.getResourceHandler().createResource(resourceName, libraryName); UIComponent composite = application.createComponent(context, resource); composite.setId(id); // Mandatory for the case composite is part of UIForm! Otherwise JSF can't find inputs. // This basically creates <composite:implementation>. UIComponent implementation = application.createComponent(UIPanel.COMPONENT_TYPE); implementation.setRendererType("javax.faces.Group"); composite.getFacets().put(UIComponent.COMPOSITE_FACET_NAME, implementation); // Now include the composite component file in the given parent. parent.getChildren().add(composite); parent.pushComponentToEL(context, composite); // This makes #{cc} available. try { faceletContext.includeFacelet(implementation, resource.getURL()); } catch (IOException e) { throw new FacesException(e); } finally { parent.popComponentFromEL(context); } }
@Override protected UIColumn createColumnComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (Column) application.createComponent( Column.COMPONENT_TYPE ); }
/** * Create a UIData component. */ protected UIData createDataTableComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (HtmlDataTable) application.createComponent( HtmlDataTable.COMPONENT_TYPE ); }
@Override protected UIData createDataTableComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (UIData) application.createComponent( DataTable.COMPONENT_TYPE ); }
/** * Create a UIColumn component. */ protected UIColumn createColumnComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (UIColumn) application.createComponent( HtmlColumn.COMPONENT_TYPE ); }
/** * Create a UIData component. */ protected UIData createDataTableComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (HtmlDataTable) application.createComponent( HtmlDataTable.COMPONENT_TYPE ); }
/** * Create a HtmlCommandLink component. */ protected HtmlCommandLink createCommandLinkComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (HtmlCommandLink) application.createComponent( HtmlCommandLink.COMPONENT_TYPE ); }
/** * Create a HtmlCommandLink component. */ protected HtmlCommandLink createCommandLinkComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (HtmlCommandLink) application.createComponent( HtmlCommandLink.COMPONENT_TYPE ); }
@Override protected HtmlCommandLink createCommandLinkComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (CommandLink) application.createComponent( CommandLink.COMPONENT_TYPE ); }
/** * Create a UIColumn component. */ protected UIColumn createColumnComponent() { FacesContext context = FacesContext.getCurrentInstance(); Application application = context.getApplication(); return (UIColumn) application.createComponent( HtmlColumn.COMPONENT_TYPE ); }
public static UITaskId newInstance() { return (UITaskId) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE); } }
public static UIDecorate newInstance() { return (UIDecorate) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE); }
public static UIConversationId newInstance() { return (UIConversationId) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE); } }
public static UISelection newInstance() { return (UISelection) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE); }
public static UIFragment newInstance() { return (UIFragment) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE); }
/** * @see org.pivot4j.analytics.property.AbstractPropertyInputEditor#createInput * (org.pivot4j.analytics.property.PropertyDescriptor, * javax.faces.component.UIComponent, javax.faces.context.FacesContext) */ @Override protected UIInput createInput(PropertyDescriptor descriptor, UIComponent parent, FacesContext context) { Application application = FacesContext.getCurrentInstance() .getApplication(); return (UIInput) application .createComponent(AjaxColorPicker.COMPONENT_TYPE); }
public static UIConversationPropagation newInstance() { return (UIConversationPropagation) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE); }
public static UIConversationName newInstance() { return (UIConversationName) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE); }
private String setUIViewRootComponent(FacesContext context) { Application app = context.getApplication(); UIComponent root = app.createComponent(UIViewRoot.COMPONENT_TYPE); if (root == null || (root.getClass() == UIViewRoot.class && root.getClass().getAnnotation(PortletNamingContainer.class) == null)) { app.addComponent(UIViewRoot.COMPONENT_TYPE, PortletNamingContainerUIViewRoot.class.getName()); return UIViewRoot.class.getName(); } return null; }