Examples of IComponent


Examples of org.apache.tapestry.IComponent

    public ILink getLink(boolean post, Object parameter)
    {
        Defense.isAssignable(parameter, IComponent.class, "parameter");

        IComponent component = (IComponent) parameter;

        Map parameters = new HashMap();
        parameters.put(ServiceConstants.PAGE, component.getPage().getPageName());
        parameters.put(ServiceConstants.COMPONENT, component.getIdPath());

        return _linkFactory.constructLink(this, false, parameters, false);
    }
View Full Code Here

Examples of org.apache.tapestry.IComponent

    {
        String pageName = cycle.getParameter(ServiceConstants.PAGE);
        String componentId = cycle.getParameter(ServiceConstants.COMPONENT);

        IPage componentPage = cycle.getPage(pageName);
        IComponent component = componentPage.getNestedComponent(componentId);

        if (!(component instanceof IXTile))
            throw new ApplicationRuntimeException("Incorrect component type: was "
                    + component.getClass() + " but must be " + IXTile.class, component, null, null);

        IXTile xtile = (IXTile) component;

        String[] params = cycle.getParameters(ServiceConstants.PARAMETER);
        cycle.setListenerParameters(params);
View Full Code Here

Examples of org.apache.tapestry.IComponent

    }

    public void connect()
    {

        IComponent container = _component.getContainer();

        for(Iterator it = container.getBindingNames().iterator(); it.hasNext();)
        {
            String bindingName = (String) it.next();
            connectInformalBinding(container, _component, bindingName);
        }
    }
View Full Code Here

Examples of org.apache.tapestry.IComponent

        Block block = getBlock();

        if (block == null)
            return;

        IComponent previousInserter = block.getInserter();

        try
        {
            block.setInserter(this);
            block.renderBody(writer, cycle);
View Full Code Here

Examples of org.apache.tapestry.IComponent

     *
     **/

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        IComponent container = getContainer();

        container.renderBody(writer, cycle);
    }
View Full Code Here

Examples of org.apache.tapestry.IComponent

     * @param objSettingsContainer
     *            the component from which to get the settings
     */
    public void loadSettings(IComponent objSettingsContainer)
    {
        IComponent objColumnRendererSource = (IComponent) objSettingsContainer
                .getComponents().get(
                        getColumnName() + COLUMN_RENDERER_BLOCK_SUFFIX);
        if (objColumnRendererSource == null)
            objColumnRendererSource = (IComponent) objSettingsContainer
                    .getComponents().get(COLUMN_RENDERER_BLOCK_SUFFIX);
        if (objColumnRendererSource != null
                && objColumnRendererSource instanceof Block)
            setColumnRendererSource(new BlockTableRendererSource(
                    (Block) objColumnRendererSource));

        IComponent objValueRendererSource = (IComponent) objSettingsContainer
                .getComponents().get(
                        getColumnName() + VALUE_RENDERER_BLOCK_SUFFIX);
        if (objValueRendererSource == null)
            objValueRendererSource = (IComponent) objSettingsContainer
                    .getComponents().get(VALUE_RENDERER_BLOCK_SUFFIX);
View Full Code Here

Examples of org.apache.tapestry.IComponent

     */

    public void performCallback(IRequestCycle cycle)
    {
        IPage page = cycle.getPage(_pageName);
        IComponent component = page.getNestedComponent(_componentIdPath);
        IDirect direct = null;

        try
        {
            direct = (IDirect) component;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(Tapestry.format(
                    "DirectCallback.wrong-type",
                    component.getExtendedId()), component, null, ex);
        }

        cycle.setListenerParameters(_parameters);
        direct.trigger(cycle);
    }
View Full Code Here

Examples of org.apache.tapestry.IComponent

    {
        Defense.isAssignable(parameter, DirectServiceParameter.class, "parameter");

        DirectServiceParameter dsp = (DirectServiceParameter) parameter;

        IComponent component = dsp.getDirect();

        // New since 1.0.1, we use the component to determine
        // the page, not the cycle. Through the use of tricky
        // things such as Block/InsertBlock, it is possible
        // that a component from a page different than
        // the response page will render.
        // In 1.0.6, we start to record *both* the render page
        // and the component page (if different).

        IPage activePage = _requestCycle.getPage();
        IPage componentPage = component.getPage();
       
        Map parameters = new HashMap();
       
        boolean stateful = _request.getSession(false) != null;
       
        parameters.put(ServiceConstants.PAGE, activePage.getPageName());
        parameters.put(ServiceConstants.COMPONENT, component.getIdPath());
        parameters.put(ServiceConstants.CONTAINER, componentPage == activePage ? null
                : componentPage.getPageName());
        parameters.put(ServiceConstants.SESSION, stateful ? "T" : null);
       
        // handle dynamic XHR/JSON parameters
View Full Code Here

Examples of org.jibx.binding.model.IComponent

           
            // check for container with element name or text content
            ContainerElementBase contain = (ContainerElementBase)expands.get(i);
            contents = contain.getContentComponents();
            for (int j = 0; j < contents.size(); j++) {
                IComponent comp = (IComponent)contents.get(j);
                if (comp.hasName()) {
                   
                    // component with name means child element
                    haschild = true;
                   
                } else if (comp instanceof ValueElement) {
View Full Code Here

Examples of org.jibx.binding.model.IComponent

        }
       
        // generate schema equivalents for content components of container
        ArrayList comps = cont.getContentComponents();
        for (int i = offset; i < comps.size(); i++) {
            IComponent comp = (IComponent)comps.get(i);
            if (comp.hasName()) {
               
                // create element for named content component
                ElementElement element = buildElement(comp, repeat, hold);
                if (comp instanceof StructureElementBase) {
                    addItemDocumentation((StructureElementBase)comp, element);
                }
                cdef.getParticleList().add(element);
               
            } else if (comp instanceof ContainerElementBase) {
                ContainerElementBase contain = (ContainerElementBase)comp;
                boolean iscoll = comp instanceof CollectionElement;
                if (contain.children().size() > 0) {
                   
                    // no element name, but children; handle with recursive call
                    CommonCompositorDefinition part = buildCompositor(contain, 0, iscoll, hold);
                    addCompositorPart(part, cdef);
                   
                } else if (iscoll) {
                   
                    // collection without a wrapper element
                    CollectionElement coll = (CollectionElement)comp;
                    String itype = coll.getItemTypeName();
                    TemplateElementBase ref = coll.getDefinitions().getSpecificTemplate(itype);
                    if (ref instanceof MappingElement) {
                       
                        // item type with concrete mapping, make it an element
                        MappingDetail detail = m_detailDirectory.getMappingDetail((MappingElementBase)ref);
                        ElementElement item = new ElementElement();
                        QName oname = detail.getOtherName();
                        setElementRef(oname, item, hold);
                        item.setMinOccurs(Count.COUNT_ZERO);
                        item.setMaxOccurs(Count.COUNT_UNBOUNDED);
                        addItemDocumentation(coll, item);
                        cdef.getParticleList().add(item);
                       
                    } else {
                       
                        // TODO: handle this with xs:any strict?
                        m_context.addWarning("Handling not implemented for unspecified mapping", coll);
                    }
                   
                } else if (comp instanceof StructureElement) {
                   
                    // no children, must be mapping reference
                    StructureElement struct = (StructureElement)comp;
                    MappingElementBase ref = (MappingElementBase)struct.getEffectiveMapping();
                    if (ref == null) {
                       
                        // TODO: handle this with xs:any strict?
                        m_context.addWarning("Handling not implemented for unspecified mapping", struct);
                       
                    } else {
                       
                        // handle mapping reference based on form and name use
                        MappingDetail detail = m_detailDirectory.getMappingDetail(ref);
                        if (ref.isAbstract()) {
                           
                            // abstract inline treated as group
                            GroupRefElement group = new GroupRefElement();
                            setGroupRef(detail.getOtherName(), group, hold);
                            if (comp.isOptional()) {
                                group.setMinOccurs(Count.COUNT_ZERO);
                            }
                            cdef.getParticleList().add(group);
                           
                        } else {
                           
                            // concrete treated as element reference
                            ElementElement elem = new ElementElement();
                            setElementRef(detail.getOtherName(), elem, hold);
                            if (comp.isOptional()) {
                                elem.setMinOccurs(Count.COUNT_ZERO);
                            }
                            addItemDocumentation(struct, elem);
                            cdef.getParticleList().add(elem);
                           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.