Examples of FormatReference


Examples of com.volantis.mcs.protocols.FormatReference

    }

    public void testRenderer()
            throws Exception {

        FormatReference MENU_PANE
                = new FormatReference("menu",
                                      NDimensionalIndex.ZERO_DIMENSIONS);

        FormatReference ITEM1_PANE
                = new FormatReference("item1",
                                      NDimensionalIndex.ZERO_DIMENSIONS);

        FormatReference ITEM2_PANE
                = new FormatReference("item2",
                                      NDimensionalIndex.ZERO_DIMENSIONS);

        final AssetResolverMock assetResolverMock =
                new AssetResolverMock("assetResolverMock", expectations);
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

     */
    public void testGetPane() {
        AbstractMenuEntry testClass = (AbstractMenuEntry) createTestInstance();

        // Test null values
        FormatReference basePane = null;
        testClass.setPane(basePane);
        FormatReference testPane = testClass.getPane();

        assertNull("The test pane should be null", testPane);
        assertEquals("The base and test objects should be the same",
                basePane, testPane);

        // Test non-null values
        basePane = new FormatReference();
        basePane.setStem("Test stem text");
        testClass.setPane(basePane);
        testPane = testClass.getPane();

        assertNotNull("The test pane should not be null", testPane);
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

            /**
             * Augmented to record the mapping created by the locator between
             * a menu entry and its allocated format reference.
             */
            protected FormatReference findFormatReferenceFor(MenuEntry entry) {
                FormatReference ref = super.findFormatReferenceFor(entry);

                formatReferences.put(entry, ref);

                return ref;
            }
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

        // incompletely specified to ensure automatic iteration allocation
        builder.setElementDetails("menu", null,
                StylesBuilder.getCompleteStyles(
                        "mcs-menu-item-iterator-allocation: automatic"));

        builder.setPane(new FormatReference("pane",
                                            new NDimensionalIndex(
                                                    new int[]{1, 2, 0},
                                                    2)));

        createMenuItem(builder, "item1");
        createMenuItem(builder, "item2");
        createMenuGroup(builder);
        createMenuItem(builder, "item3",
                       new FormatReference("other",
                                           new NDimensionalIndex(
                                                   new int[]{0},
                                                   0)));

        builder.startMenu();
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

        // fully specified to ensure no automatic iteration allocation
        builder.setElementDetails("menu", null,
                StylesBuilder.getCompleteStyles(
                        "mcs-menu-item-iterator-allocation: automatic"));

        builder.setPane(new FormatReference("pane",
                                            new NDimensionalIndex(
                                                    new int[] {1, 2, 0})));

        createMenuItem(builder, "item1");
        createMenuItem(builder, "item2");
        createMenuGroup(builder);
        createMenuItem(builder, "item3",
                       new FormatReference("other",
                                           new NDimensionalIndex(
                                                   new int[] {0},
                                                   0)));

        builder.startMenu();
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

        // incompletely specified to ensure no automatic iteration allocation
        builder.setElementDetails("menu", null,
                StylesBuilder.getCompleteStyles(
                        "mcs-menu-item-iterator-allocation: none"));

        builder.setPane(new FormatReference("pane",
                                            new NDimensionalIndex(
                                                    new int[]{1, 2, 0},
                                                    2)));

        createMenuItem(builder, "item1");
        createMenuItem(builder, "item2");
        createMenuGroup(builder);
        createMenuItem(builder, "item3",
                       new FormatReference("other",
                                           new NDimensionalIndex(
                                                   new int[]{0},
                                                   0)));

        builder.startMenu();
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

        // incompletely specified to ensure automatic iteration allocation
        builder.setElementDetails("menu", null,
                StylesBuilder.getCompleteStyles(
                        "mcs-menu-item-iterator-allocation: automatic"));

        builder.setPane(new FormatReference("pane",
                                            new NDimensionalIndex(
                                                    new int[]{1, 2, 0},
                                                    2)));

        createMenuItem(builder, "item1");

        builder.startMenu();

        // Make this menu automatic allocate and set the pane as incompletely
        // specified to enable automatic iteration allocation
        builder.setElementDetails("submenu", null,
                StylesBuilder.getCompleteStyles(
                        "mcs-menu-item-iterator-allocation: automatic"));

        builder.setPane(new FormatReference("sub",
                                            new NDimensionalIndex(
                                                    new int[]{0, 0, 0},
                                                    0)));

        createMenuItem(builder, "item2.1");
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

        // incompletely specified to ensure automatic iteration allocation
        builder.setElementDetails("menu", null,
                StylesBuilder.getCompleteStyles(
                        "mcs-menu-item-iterator-allocation: automatic"));

        builder.setPane(new FormatReference("pane",
                                            new NDimensionalIndex(
                                                    new int[]{1, 2, 0},
                                                    2)));

        createMenuItem(builder, "item1");
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

     * @param stem the base name for the format being targeted
     * @param indices the indices for the format reference's instance
     * @return a fully specified format reference
     */
    protected FormatReference fr(String stem, int[] indices) {
        return new FormatReference(stem, new NDimensionalIndex(indices));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.FormatReference

     * @param expectedObject the expected format reference as an object
     * @param actual the actual format reference
     */
    protected void checkSame(Object expectedObject,
                             FormatReference actual) {
        FormatReference expected = (FormatReference)expectedObject;

        if (expected == null) {
            assertNull("actual should be null", actual);
        } else {
            assertNotNull("actual should not be null",
                          actual);

            assertEquals("stems not as",
                         expected.getStem(),
                         actual.getStem());

            if (expected.getIndex() == null) {
                assertNull("actual instance should be null",
                           actual.getIndex());
            } else {
                assertNotNull("actual instance should not be null",
                              actual.getIndex());

                assertTrue("indices don't match (expected: " +
                           toString(expected.getIndex().getIndicies()) +
                           ") (actual: " +
                           toString(actual.getIndex().getIndicies()) + ")",
                           Arrays.equals(expected.getIndex().getIndicies(),
                                         actual.getIndex().getIndicies()));
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.