Package org.apache.tapestry

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


        cycle.activate(page);

        IPage componentPage = componentPageName == null ? page : cycle.getPage(componentPageName);

        IComponent component = componentPage.getNestedComponent(componentId);

        IDirect direct = null;

        try
        {
View Full Code Here

     * captive {@link DirectLink}component embedded here.
     */

    private void writeTemplate(IMarkupWriter writer, IRequestCycle cycle)
    {
        IComponent inspectedComponent = getInspectedComponent();
        ComponentTemplate template = null;

        try
        {
            template = getTemplateSource().getTemplate(cycle, inspectedComponent);
View Full Code Here

    /** @since 3.0 * */

    private void write(IMarkupWriter writer, LocalizationToken token)
    {
        IComponent component = getInspectedComponent();

        writer.begin("span");
        writer.attribute("class", "jwc-tag");

        writer.print("<span key=\"");
        writer.print(token.getKey());
        writer.print('"');

        Map attributes = token.getAttributes();
        if (attributes != null && !attributes.isEmpty())
        {
            Iterator it = attributes.entrySet().iterator();
            while (it.hasNext())
            {
                Map.Entry entry = (Map.Entry) it.next();
                String attributeName = (String) entry.getKey();
                String attributeValue = (String) entry.getValue();

                writer.print(' ');
                writer.print(attributeName);
                writer.print("=\"");
                writer.print(attributeValue);
                writer.print('"');

            }
        }

        writer.print('>');
        writer.begin("span");
        writer.attribute("class", "localized-string");

        writer.print(component.getMessages().getMessage(token.getKey()));
        writer.end(); // <span>

        writer.print("</span>");

        writer.end(); // <span>
View Full Code Here

    /** @since 3.0 * */

    private void write(IMarkupWriter writer, boolean nextIsClose, OpenToken token)
    {
        IComponent component = getInspectedComponent();
        IEngineService service = getDirectService();

        // Each id references a component embedded in the inspected component.
        // Get that component.

        String id = token.getId();
        IComponent embedded = component.getComponent(id);
        Object[] serviceParameters = new Object[]
        { embedded.getIdPath() };

        // Build a URL to select that component, as if by the captive
        // component itself (it's a Direct).

        DirectServiceParameter dsp = new DirectServiceParameter(this, serviceParameters);
View Full Code Here

        Inspector inspector = (Inspector) getPage();

        String componentId = (String) cycle.getListenerParameters()[0];
        inspector.selectComponent(componentId);

        IComponent newComponent = inspector.getInspectedComponent();

        // If the component is not a BaseComponent then it won't have
        // a template, so switch to the specification view.

        if (!(newComponent instanceof BaseComponent))
View Full Code Here

                INamespace componentNamespace = _componentResolver
                        .getNamespace();

                // Instantiate the contained component.

                IComponent component = instantiateComponent(page, container,
                        id, componentSpecification, _componentResolver
                                .getType(), componentNamespace, contained);

                // Add it, by name, to the container.
View Full Code Here

        IContainedComponent contained = new ContainedComponent();
        contained.setLocation(location);
        contained.setType(componentType);

        IComponent result = instantiateComponent(page, container, componentId,
                spec, _componentResolver.getType(), componentNamespace,
                contained);

        container.addComponent(result);
View Full Code Here

        }

        ComponentConstructor cc = _componentConstructorFactory
                .getComponentConstructor(spec, className);

        IComponent result = (IComponent) cc.newInstance();

        result.setNamespace(namespace);
        result.setPage(page);
        result.setContainer(container);
        result.setId(id);
        result.setContainedComponent(containedComponent);
        result.setLocation(containedComponent.getLocation());

        _count++;

        return result;
    }
View Full Code Here

    public void setBeanProperty(IBeanProvider provider, Object bean)
    {
        if (_binding == null)
        {
            IComponent component = provider.getComponent();

            String description = BeanMessages.propertyInitializerName(_propertyName);

            _binding = _bindingSource.createBinding(
                    component,
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IComponent

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.