@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."); } }
@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 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 { if (!ComponentHandler.isNew(parent)) { return;
@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);
/** * Enable the current view to be restorable. This basically sets a specific view attribute which the * {@link OmniViewHandler} could intercept on. * @throws IllegalStateException When given parent is not an instance of {@link UIViewRoot}. */ @Override public void apply(FaceletContext context, UIComponent parent) throws IOException { if (!(parent instanceof UIViewRoot)) { throw new IllegalStateException( format(ERROR_INVALID_PARENT, parent != null ? parent.getClass().getName() : null)); } if (!ComponentHandler.isNew(parent)) { return; } parent.getAttributes().put(EnableRestorableView.class.getName(), TRUE); }
/** * Enable the current view to be restorable. This basically sets a specific view attribute which the * {@link OmniViewHandler} could intercept on. * @throws IllegalStateException When given parent is not an instance of {@link UIViewRoot}. */ @Override public void apply(FaceletContext context, UIComponent parent) throws IOException { if (!(parent instanceof UIViewRoot)) { throw new IllegalStateException( format(ERROR_INVALID_PARENT, parent != null ? parent.getClass().getName() : null)); } if (!ComponentHandler.isNew(parent)) { return; } parent.getAttributes().put(EnableRestorableView.class.getName(), TRUE); }
@Override public void apply(FaceletContext context, UIComponent parent) throws IOException { List<UIComponent> oldChildren = new ArrayList<>(parent.getChildren()); nextHandler.apply(context, parent); if (ComponentHandler.isNew(parent)) { List<UIComponent> newChildren = new ArrayList<>(parent.getChildren()); newChildren.removeAll(oldChildren); applyMassAttribute(context, newChildren); } }
@Override public void apply(FaceletContext context, UIComponent parent) throws IOException { List<UIComponent> oldChildren = new ArrayList<>(parent.getChildren()); nextHandler.apply(context, parent); if (ComponentHandler.isNew(parent)) { List<UIComponent> newChildren = new ArrayList<>(parent.getChildren()); newChildren.removeAll(oldChildren); applyMassAttribute(context, newChildren); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { // only process if it's been created if (parent == null || !ComponentHandler.isNew(parent)) { return; } if (isEventSource(parent)) { applyAttachedObject(ctx.getFacesContext(), parent); } else if (UIComponent.isCompositeComponent(parent)) { // Allow the composite component to know about the target component. TagHandlerUtils.getOrCreateRetargetableHandlersList(parent).add(this); } else { throw new TagException(this.tag, "Parent does not match event source requirements: " + parent); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { // only process if it's been created if (parent == null || !ComponentHandler.isNew(parent)) { return; } if (isEventSource(parent)) { applyAttachedObject(ctx.getFacesContext(), parent); } else if (UIComponent.isCompositeComponent(parent)) { // Allow the composite component to know about the target component. TagHandlerUtils.getOrCreateRetargetableHandlersList(parent).add(this); } else { throw new TagException(this.tag, "Parent does not match event source requirements: " + parent); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { // only process if it's been created if (parent == null || !ComponentHandler.isNew(parent)) { return; } if (isEventSource(parent)) { applyAttachedObject(ctx.getFacesContext(), parent); } else if (UIComponent.isCompositeComponent(parent)) { // Allow the composite component to know about the target component. TagHandlerUtils.getOrCreateRetargetableHandlersList(parent).add(this); } else { throw new TagException(this.tag, "Parent does not match event source requirements: " + parent); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (null == parent || !(ComponentHandler.isNew(parent))) { return; } if (UIComponent.isCompositeComponent(parent)) { if (null == getFor()) { throw new TagException(this.tag, "actionListener tags nested within composite components must have a non-null 'for' attribute"); } TagHandlerUtils.getOrCreateRetargetableHandlersList(parent).add(this); } else { applyAttachedObject(ctx.getFacesContext(), parent); } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (null == parent || !(ComponentHandler.isNew(parent))) { return; } if (UIComponent.isCompositeComponent(parent)) { if (null == getFor()) { throw new TagException(this.tag, "actionListener tags nested within composite components must have a non-null 'for' attribute"); } TagHandlerUtils.getOrCreateRetargetableHandlersList(parent).add(this); } else { applyAttachedObject(ctx.getFacesContext(), parent); } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (null == parent || !(ComponentHandler.isNew(parent))) { return; } if (UIComponent.isCompositeComponent(parent)) { if (null == getFor()) { throw new TagException(this.tag, "actionListener tags nested within composite components must have a non-null 'for' attribute"); } TagHandlerUtils.getOrCreateRetargetableHandlersList(parent).add(this); } else { applyAttachedObject(ctx.getFacesContext(), parent); } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (ComponentHandler.isNew(parent)) { Class<? extends SystemEvent> eventClass = getEventClass(ctx); UIViewRoot viewRoot = ctx.getFacesContext().getViewRoot(); // ensure that f:event can be used anywhere on the page for preRenderView, // not just as a direct child of the viewRoot if (null != viewRoot && PreRenderViewEvent.class == eventClass && parent != viewRoot) { parent = viewRoot; } if (eventClass != null) { parent.subscribeToEvent(eventClass, new DeclarativeSystemEventListener( listener.getMethodExpression(ctx, Object.class, new Class[] { ComponentSystemEvent.class }), listener.getMethodExpression(ctx, Object.class, new Class[] { }))); } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (ComponentHandler.isNew(parent)) { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root == null) { throw new TagException(this.tag, "UIViewRoot not available"); } ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, PhaseListener.class); } PhaseListener pl = new LazyPhaseListener(this.listenerType, b); List<PhaseListener> listeners = root.getPhaseListeners(); if (!listeners.contains(pl)) { root.addPhaseListener(pl); } } }
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(this.tag, "ResetInput can only be attached to ActionSource components."); } }
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(final FaceletContext faceletContext, final UIComponent parent) throws ELException { if (parent == null) { throw new TagException(tag, "Parent UIComponent was null"); } if (ComponentHandler.isNew(parent)) { final Object attributeName = name.isLiteral() ? (Object) name.getValue(faceletContext) : name.getValueExpression(faceletContext, Object.class); final Object attributeValue = value.isLiteral() ? (Object) value.getValue(faceletContext) : value.getValueExpression(faceletContext, Object.class); ComponentUtils.putDataAttribute(parent, attributeName, attributeValue); } } }