Package org.eclipse.jst.jsf.common.runtime.internal.model.component

Examples of org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo


    private ComponentInfo buildComponentTree(final Node root,
            final DTUIViewRoot viewRoot, final IDocument document,
            final XMLViewObjectConstructionStrategy objectConstructionStrategy)
    {
        final ComponentInfo dummyRoot = ComponentFactory.createComponentInfo(
                null, null, null, true);
        // populate the dummy root
        recurseDOMModel(root, dummyRoot, document, objectConstructionStrategy);

        // try to extract the view defined root from the dummyRoot and update
        // 'root' with its children.
        populateViewRoot(viewRoot, dummyRoot.getChildren());
        return viewRoot;
    }
View Full Code Here


     * @param children
     */
    protected void populateViewRoot(final DTUIViewRoot viewRoot,
            final List children)
    {
        ComponentInfo foundRoot = null;
        // TODO: additional cases:
        // 1) Valid case: view is a fragment and has one or more non-view root
        // children
        // 2) Invalid case: not a fragment and has no view root
        // 3) Invalid case: any definition and has more than one view root
        // 4) Invalid case: any definition and has component siblings to the
        // view root
        FIND_VIEWROOT: for (final Iterator it = children.iterator(); it
                .hasNext();)
        {
            final ComponentInfo topLevelChild = (ComponentInfo) it.next();

            if ("javax.faces.ViewRoot".equals(topLevelChild //$NON-NLS-1$
                    .getComponentTypeInfo().getComponentType()))
            {
                foundRoot = topLevelChild;
                break FIND_VIEWROOT;
            }
        }

        if (foundRoot != null)
        {
            for (final Iterator it = foundRoot.getChildren().iterator(); it
                    .hasNext();)
            {
                final ComponentInfo child = (ComponentInfo) it.next();
                final String facetName = foundRoot.getFacetName(child);

                // if not a facet, add as a normal child
                if (facetName == null)
                {
View Full Code Here

        objectConstructionStrategy.getConstructionData().setParent(parent);

        mappedObject = _adapter.mapToViewObject(node,
                objectConstructionStrategy, document);

        ComponentInfo newParent = parent;

        if (mappedObject instanceof ComponentInfo)
        {
            parent.addChild((ComponentInfo) mappedObject);
            newParent = (ComponentInfo) mappedObject;
View Full Code Here

            else if (tagElement instanceof IConverterTagElement)
            {
                final ConverterTypeInfo typeInfo = ((IConverterTagElement) tagElement)
                        .getConverter();
                // TODO: validate when no parent
                ComponentInfo parent = _constructionData.getParent();
                parent = findFirstParent(
                        ComponentFactory.INTERFACE_VALUEHOLDER, parent);
                if (parent != null)
                {
                    parent.addDecorator(
                            new ConverterDecorator(parent, typeInfo),
                            ComponentFactory.CONVERTER);
                }
                // TODO: else validate problem
            }
            else if (tagElement instanceof IValidatorTagElement)
            {
                final ValidatorTypeInfo typeInfo = ((IValidatorTagElement) tagElement)
                        .getValidator();
                ComponentInfo parent = _constructionData.getParent();
                parent = findFirstParent(
                        ComponentFactory.INTERFACE_EDITABLEVALUEHOLDER, parent);
                if (parent != null)
                {
                    parent.addDecorator(
                            new ValidatorDecorator(parent, typeInfo),
                            ComponentFactory.VALIDATOR);
                }
                // TODO :else validate problem
            }
View Full Code Here

    }

    private ComponentInfo findFirstParent(final String matchingType,
            final ComponentInfo start)
    {
        ComponentInfo parent = start;

        while (parent != null && parent.getComponentTypeInfo() != null
                && !parent.getComponentTypeInfo().isInstanceOf(matchingType))
        {
            parent = parent.getParent();
        }
        return parent;
    }
View Full Code Here

    private ComponentInfo findBestComponent(final String uri,
            final Element srcElement, final String id,
            final IComponentTagElement tagElement)
    {
        ComponentInfo bestComponent = null;

        final ComponentInfo parent = _constructionData.getParent();

        final Map<String, Object> initMap = new HashMap<String, Object>();
        final Map<String, String> attributeToPropertyMap = new HashMap<String, String>();
        populateInitMap(uri, initMap, srcElement, tagElement,
                attributeToPropertyMap);
View Full Code Here

                    && ((ComponentInfo) viewObject).getComponentTypeInfo() != null
                    && ((ComponentInfo) viewObject).getComponentTypeInfo()
                            .isInstanceOf(
                                    ComponentFactory.INTERFACE_VALUEHOLDER))
            {
                final ComponentInfo component = (ComponentInfo) viewObject;
                // get the original elementData
                final ElementData mappedElementData = mappingService
                        .findElementData(component);
                final String propName = mappedElementData
                        .getPropertyName(attrAdapter.getLocalName());
                if ("value".equals(propName)) //$NON-NLS-1$
                {
                    // final List converters =
                    // component.getDecorators(ComponentFactory.CONVERTER);

                    // (ConverterDecorator) it.next();
                    final CompositeType alternativeTypes = createCompositeType(
                            expectedType, exprTypes, component
                                    .getDecorators(ComponentFactory.CONVERTER));
                    if (DEBUG)
                    {
                        System.out.println(String.format(
                                "maybeAddAlternative took %d", Long.valueOf(System //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo

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.