Package org.apache.tapestry

Examples of org.apache.tapestry.IComponent


    /**
     * @see org.apache.tapestry.AbstractComponent#prepareForRender(org.apache.tapestry.IRequestCycle)
     */
    protected void prepareForRender(IRequestCycle cycle)
    {
        IComponent outer = (IComponent) cycle.getAttribute(ATTRIBUTE_NAME);

        if (outer != null)
            throw new ApplicationRuntimeException(FormMessages.linkSubmitMayNotNest(this, outer),
                    this, getLocation(), null);

View Full Code Here


    private void applyChange(IPage page, PropertyChange change)
    {
        String idPath = change.getComponentPath();

        IComponent component = (idPath == null) ? page : page
                .getNestedComponent(idPath);

        PropertyUtils.write(component, change.getPropertyName(), change
                .getNewValue());
    }
View Full Code Here

                .getNewValue());
    }

    public void observeChange(ObservedChangeEvent event)
    {
        IComponent component = event.getComponent();
        String propertyName = event.getPropertyName();

        if (_locked)
        {
            _log.error(RecordMessages.recorderLocked(propertyName, component),
                    null, null);
            return;
        }

        PropertyPersistenceStrategy strategy = findStrategy(component,
                propertyName);

        if (strategy != null)
            strategy.store(_pageName, component.getIdPath(), propertyName,
                    event.getNewValue());
    }
View Full Code Here

    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

    {
        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

    }

    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

        Block block = getBlock();

        if (block == null)
            return;

        IComponent previousInserter = block.getInserter();

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

     *
     **/

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

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

     * @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

     */

    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

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.