public void setAttributes(FaceletContext ctx, Object instance) { componentHandler.setAttributes(ctx, instance); }
public void setAttributes(FaceletContext ctx, Object instance) { componentHandler.setAttributes(ctx, instance); }
public void setAttributes(FaceletContext ctx, Object instance) { componentHandler.setAttributes(ctx, instance); }
@Override public void setAttributes(FaceletContext ctx, Object component) { super.setAttributes(ctx, component); if (component instanceof FaceletContextConsumer) { FaceletContextConsumer faceletContextConsumer = (FaceletContextConsumer) component; faceletContextConsumer.setFaceletContext(ctx); } }
@Override public void setAttributes(FaceletContext ctx, Object component) { super.setAttributes(ctx, component); if (component instanceof FaceletContextConsumer) { FaceletContextConsumer faceletContextConsumer = (FaceletContextConsumer) component; faceletContextConsumer.setFaceletContext(ctx); } }
protected void doNewComponentActions(FaceletContext ctx, String id, UIComponent c) { if (log.isLoggable(Level.FINE)) { log.fine(owner.getTag() + " Component["+id+"] Created: " + c.getClass().getName()); } // If this is NOT a composite component... if (null == createCompositeComponentDelegate) { // set the attributes and properties into the UIComponent instance. owner.setAttributes(ctx, c); } // otherwise, allow the composite component code to do it. // mark it owned by a facelet instance c.getAttributes().put(ComponentSupport.MARK_CREATED, id); if (ctx.getFacesContext().isProjectStage(ProjectStage.Development)) { // inject the location into the component c.getAttributes().put(UIComponent.VIEW_LOCATION_KEY, owner.getTag().getLocation()); } }
protected void doNewComponentActions(FaceletContext ctx, String id, UIComponent c) { if (log.isLoggable(Level.FINE)) { log.fine(owner.getTag() + " Component["+id+"] Created: " + c.getClass().getName()); } // If this is NOT a composite component... if (null == createCompositeComponentDelegate) { // set the attributes and properties into the UIComponent instance. owner.setAttributes(ctx, c); } // otherwise, allow the composite component code to do it. // mark it owned by a facelet instance c.getAttributes().put(ComponentSupport.MARK_CREATED, id); if (ctx.getFacesContext().isProjectStage(ProjectStage.Development)) { // inject the location into the component c.getAttributes().put(UIComponent.VIEW_LOCATION_KEY, owner.getTag().getLocation()); } }
protected void doNewComponentActions(FaceletContext ctx, String id, UIComponent c) { if (log.isLoggable(Level.FINE)) { log.fine(owner.getTag() + " Component["+id+"] Created: " + c.getClass().getName()); } // If this is NOT a composite component... if (null == createCompositeComponentDelegate) { // set the attributes and properties into the UIComponent instance. owner.setAttributes(ctx, c); } // otherwise, allow the composite component code to do it. // mark it owned by a facelet instance c.getAttributes().put(ComponentSupport.MARK_CREATED, id); if (ctx.getFacesContext().isProjectStage(ProjectStage.Development)) { // inject the location into the component c.getAttributes().put(UIComponent.VIEW_LOCATION_KEY, owner.getTag().getLocation()); } }
protected void doNewComponentActions(FaceletContext ctx, String id, UIComponent c) { if (log.isLoggable(Level.FINE)) { log.fine(owner.getTag() + " Component["+id+"] Created: " + c.getClass().getName()); } // If this is NOT a composite component... if (null == createCompositeComponentDelegate) { // set the attributes and properties into the UIComponent instance. owner.setAttributes(ctx, c); } // otherwise, allow the composite component code to do it. // mark it owned by a facelet instance c.getAttributes().put(ComponentSupport.MARK_CREATED, id); if (ctx.getFacesContext().isProjectStage(ProjectStage.Development)) { // inject the location into the component c.getAttributes().put(UIComponent.VIEW_LOCATION_KEY, owner.getTag().getLocation()); } }
/** * Specialized implementation to prevent caching of the MetaRuleset when * ProjectStage is Development. */ @Override public void setAttributes(FaceletContext ctx, Object instance) { if (instance != null) { if (ctx.getFacesContext().isProjectStage(ProjectStage.Development)) { Metadata meta = createMetaRuleset(instance.getClass()).finish(); meta.applyMetadata(ctx, instance); } else { super.setAttributes(ctx, instance); } } }
/** * Specialized implementation to prevent caching of the MetaRuleset when * ProjectStage is Development. */ @Override public void setAttributes(FaceletContext ctx, Object instance) { if (instance != null) { if (ctx.getFacesContext().isProjectStage(ProjectStage.Development)) { Metadata meta = createMetaRuleset(instance.getClass()).finish(); meta.applyMetadata(ctx, instance); } else { super.setAttributes(ctx, instance); } } }
/** * Delegate to super and then try to get a {@link ValueExpression} representing a {@link MultiFieldValidator} * implementation and set it as <code>validator</code> property of current {@link ValidateMultiple} component, or * if it couldn't be obtained, then get a {@link MethodExpression} representing a method with the same signature * as {@link MultiFieldValidator#validateValues(FacesContext, List, List)} and set it as <code>validateMethod</code> * property of current {@link ValidateMultiple} component. */ @Override public void setAttributes(FaceletContext context, Object component) { super.setAttributes(context, component); ValidateMultiple validateMultiple = (ValidateMultiple) component; TagAttribute attribute = getRequiredAttribute("validator"); try { ValueExpression valueExpression = attribute.getValueExpression(context, MultiFieldValidator.class); MultiFieldValidator validator = (MultiFieldValidator) valueExpression.getValue(context); validateMultiple.setValidator(validator); } catch (Exception ignore) { // At least, ClassCastException and PropertyNotFoundException are expected. logger.log(FINEST, "Ignoring thrown exception; there is really no clean way to distinguish a ValueExpression from a MethodExpression.", ignore); MethodExpression validateMethod = attribute.getMethodExpression(context, boolean.class, PARAM_TYPES); validateMultiple.setValidateMethod(validateMethod); } }
/** * Specialized implementation to prevent caching of the MetaRuleset when * ProjectStage is Development. */ @Override public void setAttributes(FaceletContext ctx, Object instance) { if (instance != null) { if (ctx.getFacesContext().isProjectStage(ProjectStage.Development)) { Metadata meta = createMetaRuleset(instance.getClass()).finish(); meta.applyMetadata(ctx, instance); } else { super.setAttributes(ctx, instance); } } }
/** * Specialized implementation to prevent caching of the MetaRuleset when * ProjectStage is Development. */ @Override public void setAttributes(FaceletContext ctx, Object instance) { if (instance != null) { if (ctx.getFacesContext().isProjectStage(ProjectStage.Development)) { Metadata meta = createMetaRuleset(instance.getClass()).finish(); meta.applyMetadata(ctx, instance); } else { super.setAttributes(ctx, instance); } } }
/** * Delegate to super and then try to get a {@link ValueExpression} representing a {@link MultiFieldValidator} * implementation and set it as <code>validator</code> property of current {@link ValidateMultiple} component, or * if it couldn't be obtained, then get a {@link MethodExpression} representing a method with the same signature * as {@link MultiFieldValidator#validateValues(FacesContext, List, List)} and set it as <code>validateMethod</code> * property of current {@link ValidateMultiple} component. */ @Override public void setAttributes(FaceletContext context, Object component) { super.setAttributes(context, component); ValidateMultiple validateMultiple = (ValidateMultiple) component; TagAttribute attribute = getRequiredAttribute("validator"); try { ValueExpression valueExpression = attribute.getValueExpression(context, MultiFieldValidator.class); MultiFieldValidator validator = (MultiFieldValidator) valueExpression.getValue(context); validateMultiple.setValidator(validator); } catch (Exception ignore) { // At least, ClassCastException and PropertyNotFoundException are expected. logger.log(FINEST, "Ignoring thrown exception; there is really no clean way to distinguish a ValueExpression from a MethodExpression.", ignore); MethodExpression validateMethod = attribute.getMethodExpression(context, boolean.class, PARAM_TYPES); validateMultiple.setValidateMethod(validateMethod); } }
private void processNextHandler(FaceletContext ctx, FaceletHandler handler, UIComponent parent) throws IOException { if (handler instanceof ComponentHandler) { ComponentHandler componentHandler = (ComponentHandler) handler; ComponentConfig componentConfig = componentHandler.getComponentConfig(); String componentType = componentConfig.getComponentType(); if (isUIParameter(componentType)) { FacesContext facesContext = ctx.getFacesContext(); UIComponent component = (UIComponent) facesContext.getApplication().createComponent(componentType); componentHandler.setAttributes(ctx, component); if (parent instanceof ClientBehaviorHolder) { ClientBehaviorHolder clientBehaviorHolder = ((ClientBehaviorHolder) parent); Map<String, List<ClientBehavior>> clientBehaviors = clientBehaviorHolder.getClientBehaviors(); String eventName = getEventName(); if (eventName == null) { eventName = clientBehaviorHolder.getDefaultEventName(); } if (eventName != null) { List<ClientBehavior> eventClientBehaviors = clientBehaviors.get(eventName); for (ClientBehavior clientBehavior : eventClientBehaviors) { if (clientBehavior instanceof ComponentControlBehavior) { ((ComponentControlBehavior) clientBehavior).getChildren().add(component); } } } } componentHandler.applyNextHandler(ctx, component); } } }
private void processNextHandler(FaceletContext ctx, FaceletHandler handler, UIComponent parent) throws IOException { if (handler instanceof ComponentHandler) { ComponentHandler componentHandler = (ComponentHandler) handler; ComponentConfig componentConfig = componentHandler.getComponentConfig(); String componentType = componentConfig.getComponentType(); if (isUIParameter(componentType)) { FacesContext facesContext = ctx.getFacesContext(); UIComponent component = (UIComponent) facesContext.getApplication().createComponent(componentType); componentHandler.setAttributes(ctx, component); if (parent instanceof ClientBehaviorHolder) { ClientBehaviorHolder clientBehaviorHolder = ((ClientBehaviorHolder) parent); Map<String, List<ClientBehavior>> clientBehaviors = clientBehaviorHolder.getClientBehaviors(); String eventName = getEventName(); if (eventName == null) { eventName = clientBehaviorHolder.getDefaultEventName(); } if (eventName != null) { List<ClientBehavior> eventClientBehaviors = clientBehaviors.get(eventName); for (ClientBehavior clientBehavior : eventClientBehaviors) { if (clientBehavior instanceof ComponentControlBehavior) { ((ComponentControlBehavior) clientBehavior).getChildren().add(component); } } } } componentHandler.applyNextHandler(ctx, component); } } }
private void processNextHandler(FaceletContext ctx, FaceletHandler handler, UIComponent parent) throws IOException { if (handler instanceof ComponentHandler) { ComponentHandler componentHandler = (ComponentHandler) handler; ComponentConfig componentConfig = componentHandler.getComponentConfig(); String componentType = componentConfig.getComponentType(); if (isUIParameter(componentType)) { FacesContext facesContext = ctx.getFacesContext(); UIComponent component = (UIComponent) facesContext.getApplication().createComponent(componentType); componentHandler.setAttributes(ctx, component); if (parent instanceof ClientBehaviorHolder) { ClientBehaviorHolder clientBehaviorHolder = ((ClientBehaviorHolder) parent); Map<String, List<ClientBehavior>> clientBehaviors = clientBehaviorHolder.getClientBehaviors(); String eventName = getEventName(); if (eventName == null) { eventName = clientBehaviorHolder.getDefaultEventName(); } if (eventName != null) { List<ClientBehavior> eventClientBehaviors = clientBehaviors.get(eventName); for (ClientBehavior clientBehavior : eventClientBehaviors) { if (clientBehavior instanceof ComponentControlBehavior) { ((ComponentControlBehavior) clientBehavior).getChildren().add(component); } } } } componentHandler.applyNextHandler(ctx, component); } } }
private void processNextHandler(FaceletContext ctx, FaceletHandler handler, UIComponent parent) throws IOException { if (handler instanceof ComponentHandler) { ComponentHandler componentHandler = (ComponentHandler) handler; ComponentConfig componentConfig = componentHandler.getComponentConfig(); String componentType = componentConfig.getComponentType(); if (isUIParameter(componentType)) { FacesContext facesContext = ctx.getFacesContext(); UIComponent component = (UIComponent) facesContext.getApplication().createComponent(componentType); componentHandler.setAttributes(ctx, component); if (parent instanceof ClientBehaviorHolder) { ClientBehaviorHolder clientBehaviorHolder = ((ClientBehaviorHolder) parent); Map<String, List<ClientBehavior>> clientBehaviors = clientBehaviorHolder.getClientBehaviors(); String eventName = getEventName(); if (eventName == null) { eventName = clientBehaviorHolder.getDefaultEventName(); } if (eventName != null) { List<ClientBehavior> eventClientBehaviors = clientBehaviors.get(eventName); for (ClientBehavior clientBehavior : eventClientBehaviors) { if (clientBehavior instanceof ComponentControlBehavior) { ((ComponentControlBehavior) clientBehavior).getChildren().add(component); } } } } componentHandler.applyNextHandler(ctx, component); } } }
_delegate.setAttributes(ctx, c);