Package com.volantis.mcs.protocols.layouts

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


        }
        context.setProtocol(protocol);

        TestDeviceLayoutContext dlc = new TestDeviceLayoutContext();
        Pane pane = new Pane(layout);
        FormFragmentInstance ffInstance = new FormFragmentInstance(
                NDimensionalIndex.ZERO_DIMENSIONS) {
            protected boolean isEmptyImpl() {
                return false;
            }

        };
        pane.setName("pane");

        // Activate the device layout.
        RuntimeDeviceLayout runtimeDeviceLayout =
                RuntimeDeviceLayoutTestHelper.activate(layout);

        context.setDeviceLayout(runtimeDeviceLayout);
        context.setDevice(InternalDeviceTestHelper.createTestDevice());
        context.setCurrentPane(pane);
        dlc.setFormatInstance(pane, NDimensionalIndex.ZERO_DIMENSIONS,
                ffInstance);
        dlc.setMarinerPageContext(context);
        dlc.setDeviceLayout(runtimeDeviceLayout);
        //dlc.initialise();
        context.pushDeviceLayoutContext(dlc);
        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        ContextInternals.setEnvironmentContext(requestContext, new TestEnvironmentContext());
        context.pushRequestContext(requestContext);
        ContextInternals.setMarinerPageContext(requestContext, context);

        DOMOutputBuffer dom = new DOMOutputBuffer();
        dom.initialise();
        XFFormAttributes attributes = new XFFormAttributes();
        final Styles styles = StylesBuilder.getInitialValueStyles();
        attributes.setStyles(styles);
        attributes.setFormData(formInstance);
        attributes.setAction(new LiteralLinkAssetReference("testaction"));
        attributes.setMethod("post");
        attributes.setFormSpecifier(formSpecifier);
        attributes.setFormDescriptor(fd);
        FormFragment formFragment = new FormFragment(layout);
        formFragment.setName(fragmentName);
        FormFragmentInstance formFragmentInstance = new FormFragmentInstance(
                NDimensionalIndex.ZERO_DIMENSIONS);
        formFragmentInstance.setFormat(formFragment);
        Link link = new Link(fragmentName, URLConstants.NEXT_FORM_FRAGMENT, styles);
        link.setFormFragment(formFragmentInstance);

        protocol.doFormLink(dom, attributes, link);
View Full Code Here


        if (fragmentContexts == null) {
            return null;
        }

        FormFragmentInstance fi = (FormFragmentInstance)
                fragmentContexts.get(name);

        if (fi != null) {
            fragment = PAPIInternals.createFormFragment(fi);
        }
View Full Code Here

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

            FormatInstance formatInstance = new FormFragmentInstance(index);
            initialiseFormatInstance(formatInstance, format);
            FormFragmentInstance formFragmentInstance =
                                      (FormFragmentInstance) formatInstance;
            formFragmentInstance.setNextLinkText(format.getNextLinkText());
            formFragmentInstance.setPreviousLinkText(format.
                                                     getPreviousLinkText());
           
            // Only visit the topmost format.
            return true;
        }
View Full Code Here

     */
    private AbstractFormFragment getCurrentFormFragment(AbstractForm form) {
        AbstractFormFragment fragment = null;
        if (form instanceof FormInstance) {
            FormFragment formFragment = context.getCurrentFormFragment();
            FormFragmentInstance formFragmentInstance =
                (FormFragmentInstance) context.getDeviceLayoutContext().
                                  getCurrentFormatInstance(formFragment);
            fragment = formFragmentInstance;
        } else if (form instanceof FragmentableFormData) {
            fragment = ((FragmentableFormData)form).getActiveFormFragment();
View Full Code Here

TOP

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

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.