Package org.auraframework.def

Examples of org.auraframework.def.DesignTemplateDef


        } else if (DesignTemplateDefHandler.TAG.equalsIgnoreCase(tag)) {
            if (builder.getDesignTemplateDef() != null) {
                throw new XMLStreamException(String.format("<%s> may only contain one %s definition", getHandledTag(),
                        tag));
            }
            DesignTemplateDef template = new DesignTemplateDefHandler(this, xmlReader, source).getElement();
            builder.setDesignTemplateDef(template);
        } else {
            throw new XMLStreamException(String.format("<%s> cannot contain tag %s", getHandledTag(), tag));
        }
    }
View Full Code Here


    public void testDesignTemplateWithRegions() throws Exception {
        ComponentDef cmp = Aura.getDefinitionService().getDefinition("test:fakeDesign", ComponentDef.class);
        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

    public DesignTemplateDefHandlerTest(String name) {
        super(name);
    }

    public void testGetElement() throws Exception {
        DesignTemplateDef element = setupDesignTemplateDef("<design:template><design:region name=\"regionone\"/></design:template>");
        assertNotNull(element.getDesignTemplateRegionDef("regionone"));
    }
View Full Code Here

        DesignTemplateDef element = setupDesignTemplateDef("<design:template><design:region name=\"regionone\"/></design:template>");
        assertNotNull(element.getDesignTemplateRegionDef("regionone"));
    }

    public void testGetEmptyTemplate() throws Exception {
        DesignTemplateDef element = setupDesignTemplateDef("<design:template></design:template>");
        assertTrue(element.getDesignTemplateRegionDefs().isEmpty());
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.DesignTemplateDef

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.