Package org.auraframework.def

Examples of org.auraframework.def.DesignTemplateRegionDef


    @Override
    protected void handleChildTag() throws XMLStreamException, QuickFixException {
        String tag = getTagName();
        if (DesignTemplateRegionDefHandler.TAG.equalsIgnoreCase(tag)) {
            DesignTemplateRegionDef templateRegion = new DesignTemplateRegionDefHandler(getParentHandler(), xmlReader,
                    source).getElement();
            builder.addDesignTemplateRegion(
                    DefDescriptorImpl.getInstance(templateRegion.getName(), DesignTemplateRegionDef.class),
                    templateRegion);
        } else {
            throw new XMLStreamException(String.format("<%s> cannot contain tag %s", getHandledTag(), tag));
        }
    }
View Full Code Here


        DesignDef c = cmp.getDesignDefDescriptor().getDef();
        assertNotNull("DesignDef not found!", c);
        DesignTemplateDef template = c.getDesignTemplateDef();
        assertNotNull("DesignTemplateDef not found!", template);

        DesignTemplateRegionDef regionOne = template.getDesignTemplateRegionDef("regionOne");
        assertNotNull("DesignTemplateRegionDef regionOne not found!", regionOne);
        assertTrue("DesignTemplateRegionDef regionOne should have one allowed interface.", regionOne
                .getAllowedInterfaces().size() == 1);
        for (DefDescriptor<InterfaceDef> intf : regionOne.getAllowedInterfaces()) {
            assertTrue("InterfaceDef not found!", intf.exists());
        }

        DesignTemplateRegionDef regionTwo = template.getDesignTemplateRegionDef("regionTwo");
        assertNotNull("DesignTemplateRegionDef regionTwo not found!", regionTwo);
        assertTrue("DesignTemplateREgionDef regionTwo should not have any allowed interfaces.", regionTwo
                .getAllowedInterfaces().isEmpty());

        DesignTemplateRegionDef regionThree = template.getDesignTemplateRegionDef("regionThree");
        assertNotNull("DesignTemplateRegionDef regionThree not found!", regionThree);
        assertTrue("DesignTemplateRegionDef regionThree should have two allowed interfaces.", regionThree
                .getAllowedInterfaces().size() == 2);
        for (DefDescriptor<InterfaceDef> intf : regionThree.getAllowedInterfaces()) {
            assertTrue("InterfaceDef not found!", intf.exists());
        }
    }
View Full Code Here

        super(name);
    }

    public void testGetElement() throws Exception {
        String name = "regionone";
        DesignTemplateRegionDef element = setupDesignTemplateRegionDef(name, "<design:region name=\"" + name + "\"/>");

        assertEquals("regionone", element.getName());
        assertTrue(element.getAllowedInterfaces().isEmpty());
    }
View Full Code Here

        assertTrue(element.getAllowedInterfaces().isEmpty());
    }

    public void testAllowedInterfaces() throws Exception {
        String name = "regionone";
        DesignTemplateRegionDef element = setupDesignTemplateRegionDef(name, "<design:region name=\"" + name
                + "\" allowedInterfaces=\"test:fakeInterface\"/>");

        assertEquals("regionone", element.getName());
        assertTrue(element.getAllowedInterfaces().size() == 1);

        for (DefDescriptor<InterfaceDef> intf : element.getAllowedInterfaces()) {
            assertEquals("markup://test:fakeInterface", intf.getQualifiedName());
            assertTrue(intf.exists());
        }
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.DesignTemplateRegionDef

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.