@Override public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (ComponentHandler.isNew(parent)) { ValueExpression addToVE = null; ValueExpression removeFromVE = null; ValueExpression uniqueVE = null; if (addTo != null) { addToVE = addTo.getValueExpression(faceletContext, Object.class); } if (removeFrom != null) { removeFromVE = removeFrom.getValueExpression(faceletContext, Object.class); } if (unique != null) { uniqueVE = unique.getValueExpression(faceletContext, Object.class); } ValueExpression valueVE = value.getValueExpression(faceletContext, Object.class); ActionSource actionSource = (ActionSource) parent; actionSource.addActionListener(new Collector(addToVE, removeFromVE, valueVE, uniqueVE)); } } }
@Override public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (ComponentHandler.isNew(parent)) { ValueExpression valueVE = value.getValueExpression(faceletContext, Object.class); ValueExpression contentDispositionVE = null; ValueExpression monitorKeyVE = null; if (contentDisposition != null) { contentDispositionVE = contentDisposition.getValueExpression(faceletContext, String.class); } if (monitorKey != null) { monitorKeyVE = monitorKey.getValueExpression(faceletContext, String.class); } ActionSource actionSource = (ActionSource) parent; actionSource.addActionListener(new FileDownloadActionListener(valueVE, contentDispositionVE, monitorKeyVE)); } } }
@Override public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (ComponentHandler.isNew(parent)) { ValueExpression targetVE = target.getValueExpression(faceletContext, Object.class); ValueExpression typeVE = type.getValueExpression(faceletContext, Object.class); ValueExpression fileNameVE = fileName.getValueExpression(faceletContext, Object.class); ValueExpression pageOnlyVE = null; ValueExpression selectionOnlyVE = null; encodingVE = encoding.getValueExpression(faceletContext, Object.class); pageOnlyVE = pageOnly.getValueExpression(faceletContext, Object.class); selectionOnlyVE = selectionOnly.getValueExpression(faceletContext, Object.class); repeatVE = repeat.getValueExpression(faceletContext, Object.class); optionsVE = options.getValueExpression(faceletContext, Object.class); customExporterVE = customExporter.getValueExpression(faceletContext, Object.class);
@Override public String getEventName() { if (event == null) { return null; } if (event.isLiteral()) { return event.getValue(); } else { FaceletContext faceletContext = getFaceletContext(FacesContext.getCurrentInstance()); ValueExpression expression = event.getValueExpression(faceletContext, String.class); return (String) expression.getValue(faceletContext); } }
@Override public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (parent == null || !ComponentHandler.isNew(parent)) { return; } if (parent instanceof ActionSource) { ValueExpression targetVE = target.getValueExpression(faceletContext, Object.class); ValueExpression clearModelVE = clearModel != null ? clearModel.getValueExpression(faceletContext, Boolean.class) : null; ActionSource actionSource = (ActionSource) parent; actionSource.addActionListener(new ResetInputActionListener(targetVE, clearModelVE)); } else { throw new TagException(tag, "ResetInput can only be attached to ActionSource components."); } }
protected void setBehaviorAttribute(FaceletContext ctx, E behavior, TagAttribute attr, Class<?> type) { if (attr != null) { String attributeName = attr.getLocalName(); if (attr.isLiteral()) { behavior.setLiteral(attributeName, attr.getObject(ctx, type)); } else { behavior.setValueExpression(attributeName, attr.getValueExpression(ctx, type)); } } }
public ValueExpression getValue(FaceletContext ctx) { return this.value.getValueExpression(ctx, Object.class); } }
public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).setValueExpression("converter", attr .getValueExpression(ctx, Converter.class)); } }
public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).getPassThroughAttributes().put( _name, _attr.getValueExpression(ctx, _type)); } }
@Override public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).setValueExpression(this.name, this.attr .getValueExpression(ctx, this.type)); }
public void apply(FaceletContext ctx, String propName, FeatureDescriptor target, TagAttribute attribute) { ValueExpression ve = attribute.getValueExpression(ctx, getEvalType()); String v = (String) ve.getValue(ctx); if (v != null) { target.setShortDescription((String) ve.getValue(ctx)); } } }
public void apply(FaceletContext ctx, String propName, FeatureDescriptor target, TagAttribute attribute) { ValueExpression ve = attribute.getValueExpression(ctx, getEvalType()); String v = (String) ve.getValue(ctx); if (v != null) { target.setShortDescription((String) ve.getValue(ctx)); } }
public void apply(FaceletContext ctx, String propName, FeatureDescriptor target, TagAttribute attribute) { ValueExpression ve = attribute .getValueExpression(ctx, getEvalType()); target.setHidden((Boolean) ve.getValue(ctx)); }
@Override public void apply(FaceletContext ctx, String propName, FeatureDescriptor target, TagAttribute attribute) { ValueExpression ve = attribute .getValueExpression(ctx, getEvalType()); target.setExpert((Boolean) ve.getValue(ctx)); }
public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).setValueBinding("value", new LegacyValueBinding(attr.getValueExpression(ctx, Object.class))); } }
public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).setValueBinding("converter", new LegacyValueBinding(attr.getValueExpression(ctx, Converter.class))); } }
@Override public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).setValueBinding("value", new LegacyValueBinding(attr.getValueExpression(ctx, Object.class))); } }
@Override public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes() .get(FaceletContext.FACELET_CONTEXT_KEY); ActionSource as = (ActionSource) parent; ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, ActionListener.class); } ActionListener listener = new LazyActionListener(this.listenerType, b); as.addActionListener(listener); }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { String nameStr = this.name.getValue(ctx); ValueExpression valueVE = this.value.getValueExpression(ctx, Object.class); ctx.getVariableMapper().setVariable(nameStr, valueVE); }
public void applyMetadata(FaceletContext ctx, Object instance) { AbstractDataScroller datascroller = (AbstractDataScroller) instance; ValueExpression ve = page.getValueExpression(ctx, int.class); if (ve.isLiteralText()) { Integer value = (Integer) ve.getValue(ctx.getFacesContext().getELContext()); datascroller.setPage(value); } else { datascroller.setValueExpression("page", ve); } } }