Package com.volantis.mcs.protocols.layouts

Examples of com.volantis.mcs.protocols.layouts.FormInstance


        pageContext.setDeviceLayout(runtimeDeviceLayout);

        final Form form = new Form(canvasLayout);
        form.setName("form");
        pageContext.setForm(form);
        FormInstance formInstance = new FormInstance(
                NDimensionalIndex.ZERO_DIMENSIONS);
        formInstance.setFormat(form);
        pageContext.setFormatInstance(formInstance);

        final Pane testPane = new Pane(canvasLayout);
        final String paneName = "testPane";
        testPane.setName(paneName);
View Full Code Here


     * d) fragmented form with nitial value set as a TextComponentIdentity
     */
    public void testGetInitialValue() throws Exception {
        // a) Expect null as the result
        XFTextInputAttributes attributes = new XFTextInputAttributes();
        FormInstance formInstance = new FormInstance(NDimensionalIndex.ZERO_DIMENSIONS);
        final Form form = new Form(null);
        formInstance.setFormat(form);
        attributes.setFormData(formInstance);

        TestMarinerRequestContext requestContext = new TestMarinerRequestContext();
        ContextInternals.setEnvironmentContext(requestContext,
                new TestEnvironmentContext());
View Full Code Here

                formElement.getProtocolAttributes();

        String paneName = attributes.getPane();
        Pane pane = null;
        if (null == paneName) {
            FormInstance form = (FormInstance) formAttributes.getFormData();
            pane = ((Form) form.getFormat()).getDefaultPane();
            paneName = pane.getName();
        }

        FormatReference formatRef =
                FormatReferenceParser.parsePane(paneName, pageContext);
View Full Code Here

        // Javadoc inherited from super class.
        public boolean visit(Form format, Object object)
                throws FormatVisitorException {

            initialiseFormatInstance(new FormInstance(index), format);
            // Only visit the topmost format.
            return true;
        }
View Full Code Here

                if (child == null) {
                    return;
                }

                LayoutModule module = context.getLayoutModule();
                FormInstance formInstance = (FormInstance) instance;

                FormatInstance childInstance =
                        context.getFormatInstance(
                                child, instance.getIndex());

                // If the page contained an XFForm element
                if (formInstance.getPreambleBuffer(false) != null ||
                        formInstance.getContentBuffer(false) != null ||
                        formInstance.getPostambleBuffer(false) != null) {
                   
                    // Write out the form and contained layouts
                    FormAttributes attributes = factory.createFormAttributes();
                    attributes.setForm(form);

                    module.writeOpenForm(attributes);

                    OutputBuffer buffer =
                            formInstance.getPreambleBuffer(false);
                    if (buffer != null) {
                        module.writeFormPreamble(buffer);
                    }

                    context.renderFormat(childInstance);

                    buffer = formInstance.getPostambleBuffer(false);
                    if (buffer != null) {
                        module.writeFormPostamble(buffer);
                    }

                    module.writeCloseForm(attributes);
View Full Code Here

        MethodInvoker invoker = new MethodInvoker() {
            public void invoke() throws Exception {
                if (protocol instanceof DOMProtocol) {
                    MarinerPageContext context = protocol.getMarinerPageContext();
                    FormInstance formInstance = (FormInstance) context.
                            getFormatInstance(attributes.getForm(), NDimensionalIndex.ZERO_DIMENSIONS);
                    ((DOMOutputBuffer) formInstance.getContentBuffer(true)).
                            saveInsertionPoint();
                }
                protocol.writeOpenForm(attributes);
                protocol.writeCloseForm(attributes);
            }
View Full Code Here

        linkReference = resolver.resolveQuotedLinkExpression(
                attributes.getAction(), PageURLType.FORM);
        pattributes.setAction(linkReference);

        // Set the form attribute.
        FormInstance formInstance =
                (FormInstance) pageContext.getFormatInstance(
                        form, NDimensionalIndex.ZERO_DIMENSIONS);
        pattributes.setFormData(formInstance);

        // Process the help as a mariner expression.
View Full Code Here

    // Javadoc inherited from super class.
    public final void writeOpenForm(FormAttributes attributes) {

        Form form = attributes.getForm();
        FormInstance formInstance = (FormInstance)context.getFormatInstance(
            form,
            NDimensionalIndex.ZERO_DIMENSIONS);

        // Push the form's content buffer on the stack of output buffers.
        DOMOutputBuffer dom
            = (DOMOutputBuffer)formInstance.getContentBuffer(true);
        context.pushOutputBuffer(dom);

        openForm(dom, attributes);
    }
View Full Code Here

    // Javadoc inherited from super class.
    public final void writeCloseForm(FormAttributes attributes) {

        Form form = attributes.getForm();
        FormInstance formInstance = (FormInstance)context.getFormatInstance(
            form,
            NDimensionalIndex.ZERO_DIMENSIONS);

        DOMOutputBuffer dom = getCurrentBuffer();
        closeForm(dom, attributes);

        // Pop the form context's content buffer off the stack of output buffers.
        context.popOutputBuffer(formInstance.getContentBuffer(true));

        // Get the buffer into which the form context's content
        // buffer should be added.
        DOMOutputBuffer containingBuffer = getCurrentBuffer();
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.layouts.FormInstance

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.