Package org.apache.tapestry

Examples of org.apache.tapestry.IPage


    }

    private IPage newPage()
    {
        MockControl control = newControl(IPage.class);
        IPage page = (IPage) control.getMock();

        page.getPageName();
        control.setReturnValue("Fred");

        page.getIdPath();
        control.setReturnValue(null);

        return page;
    }
View Full Code Here


        IForm form = newForm();
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle(form);
        Location l = newLocation();
        IBinding binding = newBinding(l);
        IPage page = newPage();

        replayControls();

        FieldLabel fl = (FieldLabel) _creator.newInstance(FieldLabel.class, new Object[]
        { "id", "label", "page", page, "container", page });
View Full Code Here

        MockControl fieldc = newControl(IFormComponent.class);

        IFormComponent field = (IFormComponent) fieldc.getMock();

        Location l = newLocation();
        IPage page = newPage();

        FieldLabel fl = (FieldLabel) _creator.newInstance(FieldLabel.class, new Object[]
        { "id", "label", "location", l, "field", field, "page", page, "container", page });

        form.prerenderField(writer, field, l);
View Full Code Here

    }

    protected IPage newPage(String name)
    {
        MockControl control = newControl(IPage.class);
        IPage result = (IPage) control.getMock();

        result.getPageName();
        control.setReturnValue(name);

        return result;
    }
View Full Code Here

        // 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 = cycle.getPage();
        IPage componentPage = component.getPage();

        Map parameters = new HashMap();

        boolean stateful = _request.getSession(false) != null;

        parameters.put(ServiceConstants.SERVICE, Tapestry.DIRECT_SERVICE);
        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);
        parameters.put(ServiceConstants.PARAMETER, dsp.getServiceParameters());

        return _linkFactory.constructLink(cycle, parameters, true);
    }
View Full Code Here

        String componentId = cycle.getParameter(ServiceConstants.COMPONENT);
        String componentPageName = cycle.getParameter(ServiceConstants.CONTAINER);
        String activePageName = cycle.getParameter(ServiceConstants.PAGE);
        boolean activeSession = cycle.getParameter(ServiceConstants.SESSION) != null;

        IPage page = cycle.getPage(activePageName);

        cycle.activate(page);

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

        IComponent component = componentPage.getNestedComponent(componentId);

        IDirect direct = null;

        try
        {
View Full Code Here

public class BaseTagWriter implements IRender
{

    public void render(IMarkupWriter writer, IRequestCycle cycle)
    {
        IPage page = cycle.getPage();

        StringBuffer sb = new StringBuffer();
        sb.append("/");

        if (page.getNamespace().getId() == null)
        {
            String name = page.getPageName();
            int slashx = name.lastIndexOf('/');

            // Include the directory and trailing slash.
            if (slashx > 0)
                sb.append(name.substring(0, slashx + 1));
View Full Code Here

        Iterator i = _loadedPages.values().iterator();

        while (i.hasNext())
        {
            IPage page = (IPage) i.next();

            _pageSource.releasePage(page);
        }

        _loadedPages = null;
View Full Code Here

    public IPage getPage(String name)
    {
        Defense.notNull(name, "name");

        IPage result = null;

        if (_loadedPages != null)
            result = (IPage) _loadedPages.get(name);

        if (result == null)
View Full Code Here

    {
        try
        {
            _monitor.pageLoadBegin(name);

            IPage result = _pageSource.getPage(this, name, _monitor);

            // Get the recorder that will eventually observe and record
            // changes to persistent properties of the page.

            IPageRecorder recorder = getPageRecorder(name);

            // Have it rollback the page to the prior state. Note that
            // the page has a null observer at this time (which keeps
            // these changes from being sent to the page recorder).

            recorder.rollback(result);

            // Now, have the page use the recorder for any future
            // property changes.

            result.setChangeObserver(recorder);

            // Now that persistent properties have been restored, we can
            // attach the page to this request.

            result.attach(_engine, this);

            return result;
        }
        finally
        {
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IPage

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.