Package javax.faces.component

Examples of javax.faces.component.UIComponent


        final Collection<String> childrenIds = getDirectChildrenIds(component);
        final Set<UIComponent> ajaxOutputs = new HashSet<UIComponent>();

        if (childrenIds != null) {
            for (String childId : childrenIds) {
                UIComponent child = component.findComponent(childId);

                if (child instanceof AjaxOutput) {
                    ajaxOutputs.add(child);
                } else if (isContainerComponent(child)) {
                    ajaxOutputs.addAll(getAjaxOutputs(facesContext, child));
View Full Code Here


    private static boolean isContainerComponent(UIComponent component) {
        return component instanceof NamingContainer || component instanceof UIViewRoot;
    }

    private UIComponent findParentContainerComponent(UIComponent component) {
        UIComponent c = component.getParent();
        while (c != null && !isContainerComponent(c)) {
            c = c.getParent();
        }

        return c;
    }
View Full Code Here

        return c;
    }

    private void componentAdded(UIComponent c) {
        UIComponent child = c;
        UIComponent parent;
        while ((parent = findParentContainerComponent(child)) != null) {
            Set<String> trackedChildrenSet = getTrackedChildrenSet(parent, true);
            boolean updateNextParent = trackedChildrenSet.isEmpty();
            trackedChildrenSet.add(getId(child));
View Full Code Here

            child = parent;
        }
    }

    private void componentRemoved(UIComponent c) {
        UIComponent child = c;
        UIComponent parent;
        while ((parent = findParentContainerComponent(child)) != null) {
            Set<String> trackingSet = getTrackedChildrenSet(parent, false);
            if (trackingSet != null) {
                trackingSet.remove(getId(child));
View Full Code Here

        while (matcher.find()) {

            // make new id selector here using matcher.group(1)
            String unescaped = matcher.group(1).replaceAll("\\\\:", ":");
            UIComponent target = RENDERER_UTILS.findComponentFor(context, component, unescaped);

            if (target != null) {
                matcher.appendReplacement(sb,
                        escapeReplacement("#" + ScriptUtils.escapeCSSMetachars(target.getClientId(context))));
            }
        }

        matcher.appendTail(sb);
View Full Code Here

    public void broadcast(FacesContext context) throws AbortProcessingException {
        // Set up the correct context and fire our wrapped event
        UIDataAdaptor dataAdaptor = getComponent();
        initialRowKey = dataAdaptor.getRowKey();

        UIComponent compositeParent = null;

        UIComponent targetComponent = event.getComponent();

        try {
            if (!UIComponent.isCompositeComponent(targetComponent)) {
                compositeParent = UIComponent.getCompositeComponentParent(targetComponent);
            }

            if (compositeParent != null) {
                compositeParent.pushComponentToEL(context, null);
            }

            setupEventContext(context);

            targetComponent.pushComponentToEL(context, null);
            targetComponent.broadcast(event);
        } finally {
            try {
                dataAdaptor.setRowKey(context, initialRowKey);
            } catch (Exception e) {
                LOGGER.error(e.getMessage(), e);
            }

            initialRowKey = null;

            targetComponent.popComponentFromEL(context);

            if (compositeParent != null) {
                compositeParent.popComponentFromEL(context);
            }
        }
View Full Code Here

    @Override
    public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
        if (event instanceof PreRenderComponentEvent) {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final UIComponent parent = event.getComponent();
            final UIComponent component = parent.findComponent(componentId);

            preRenderParent(facesContext, component);
        }
    }
View Full Code Here

    private UIComponent createComponentResource(FacesContext context) {
        Application application = context.getApplication();

        // renderkit id is not set on FacesContext at this point, so calling
        // application.createComponent(context, componentType, rendererType) causes NPE
        UIComponent resourceComponent = application.createComponent(UIOutput.COMPONENT_TYPE);

        String rendererType = application.getResourceHandler().getRendererTypeForResourceName(BOTH_SKINNING);
        resourceComponent.setRendererType(rendererType);

        return resourceComponent;
    }
View Full Code Here

            }

            if (!skinningResourceFound) {
                // it's important for skinning resources to come *before* any users/components stylesheet,
                // that's why they are *always* added here
                UIComponent basic = createComponentResource(context);
                basic.getAttributes().put("library", LIBRARY);
                basic.setValueExpression("name", SkinningResourceNameExpression.INSTANCE);
                basic.setValueExpression("rendered", SkinningResourceRenderedExpression.INSTANCE);
                basic.setId(SKINNING_RESOURCE_ID);

                // workaround for Mojarra: RF-8937
                boolean initialProcessingEvents = context.isProcessingEvents();
                context.setProcessingEvents(false);
                viewRoot.addComponentResource(context, basic);
View Full Code Here

    public static UIComponent getParent(UIComponent component, Predicate<UIComponent> predicat) {
        if (component == null || predicat == null) {
            return null;
        }

        UIComponent parent = component.getParent();
        while (parent != null) {
            if (predicat.apply(parent)) {
                return parent;
            }
            parent = parent.getParent();
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of javax.faces.component.UIComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.