Package org.auraframework.def

Examples of org.auraframework.def.StyleDef


        DefDescriptor<StyleDef> styleDescriptor = (DefDescriptor<StyleDef>) getAttributes().get("descriptor");
        StyleDefBuilder builder = builderService.getStyleDefBuilder();

        builder.setDescriptor(styleDescriptor);
        builder.setClassName(styleDescriptor.getNamespace() + AuraTextUtil.initCap(styleDescriptor.getName()));
        StyleDef styleDef = builder.build();
        definitionService.save(styleDef);
    }
View Full Code Here


    public void testFindDefinitions() throws Exception {
        DefDescriptor<StyleDef> styleDesc = definitionService.getDefDescriptor("ui.button", StyleDef.class);
        assertEquals("css://ui.button", styleDesc.toString());

        StyleDef styleDef = styleDesc.getDef();
        assertEquals("css://ui.button", styleDef.toString());

        DefDescriptor<ComponentDef> cmpDesc = definitionService.getDefDescriptor("ui:button", ComponentDef.class);
        assertEquals("markup://ui:button", cmpDesc.toString());
        ComponentDef componentDef = cmpDesc.getDef();
        assertEquals("markup://ui:button", componentDef.toString());
View Full Code Here

    }

    /* tokens functionality deprecated by themes */
    public void _testStyleTokens() throws Exception {
        DefinitionService defService = Aura.getDefinitionService();
        StyleDef styleDef = defService.getDefinition("namespaceDefTest.testStyleTokens", StyleDef.class);
        assertEquals(
                ".namespaceDefTestTestStyleTokens {background-color:red; color:FOOL; border-color:black; " +
                        "background:-webkit-linear-gradient(top, hsl(0, 80%, 70%), #bada55); " +
                        "background:linear-gradient(to bottom, hsl(0, 80%, 70%), #bada55)}",
                styleDef.getCode());
    }
View Full Code Here

    public void testCompilationPlugins() throws Exception {
        TestStyleAdapter adapter = TestStyleAdapter.compilation(observer);
        when(locator.get(StyleAdapter.class)).thenReturn(adapter);

        DefDescriptor<StyleDef> desc = addStyleDef(".THIS{color:red}");
        StyleDef def = desc.getDef();

        assertEquals("expected plugin to run at compilation", 1, observer.count);

        def.getCode();
        assertEquals("did not expect plugin to run at runtime", 1, observer.count);
    }
View Full Code Here

    public void testRuntimePlugins() throws Exception {
        TestStyleAdapter adapter = TestStyleAdapter.runtime(observer);
        when(locator.get(StyleAdapter.class)).thenReturn(adapter);

        DefDescriptor<StyleDef> desc = addStyleDef(".THIS{color:red}");
        StyleDef def = desc.getDef();

        assertEquals("expected plugin to run at compilation", 1, observer.count);

        def.getCode();
        assertEquals("expected plugin to run at runtime", 2, observer.count);
    }
View Full Code Here

     *
     * Expected result: Pick up only the style defined in file named exactly as the component but with a .css file type.
     */
    public void testTwoCssFilesForAComponent() throws Exception {
        DefDescriptor<StyleDef> descriptor = DefDescriptorImpl.getInstance("test.testTwoCSSFiles", StyleDef.class);
        StyleDef style = descriptor.getDef();
        assertTrue(style.getName().equals("testTwoCSSFiles"));
        serializeAndGoldFile(style, "_styleDef");
    }
View Full Code Here

     *
     * Expected result: Pick up only the style defined in file.
     */
    public void testValidCss() throws Exception {
        DefDescriptor<StyleDef> descriptor = DefDescriptorImpl.getInstance("test.testValidCSS", StyleDef.class);
        StyleDef style = descriptor.getDef();
        assertTrue(style.getName().equals("testValidCSS"));
        serializeAndGoldFile(style, "_styleDef");
    }
View Full Code Here

     *
     * Expected result: The parser just considers the css file for the parent for validation.
     */
    public void testValidNestedComponents() throws Exception {
        DefDescriptor<StyleDef> descriptor = DefDescriptorImpl.getInstance("test.testStyleValidParent", StyleDef.class);
        StyleDef style = descriptor.getDef();
        assertTrue(style.getName().equals("testStyleValidParent"));
        serializeAndGoldFile(style, "_styleDef");
    }
View Full Code Here

     * Expected result: Css file is valid.
     */
    public void testStyleNamespaceToken() throws Exception {
        DefDescriptor<StyleDef> descriptor = DefDescriptorImpl.getInstance("test.testStyleNamespaceToken",
                StyleDef.class);
        StyleDef style = descriptor.getDef();
        assertTrue(style.getName().equals("testStyleNamespaceToken"));
        serializeAndGoldFile(style, "_styleDef");
    }
View Full Code Here

     * Expected result: The parser just considers the css file for the parent for validation.
     */
    public void testStyleNamespaceTokenValidCss() throws Exception {
        DefDescriptor<StyleDef> descriptor = DefDescriptorImpl.getInstance("test.testStyleNamespaceTokenValidCSS",
                StyleDef.class);
        StyleDef style = descriptor.getDef();
        assertTrue(style.getName().equals("testStyleNamespaceTokenValidCSS"));
        serializeAndGoldFile(style, "_styleDef");
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.StyleDef

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.