Examples of ThemeList


Examples of org.auraframework.css.ThemeList

        DefDescriptor<?> appDesc = context.getLoadingApplicationDescriptor();
        final String uid = context.getUid(appDesc);
        keyBuilder.append(uid);

        // themes uid (themes specified directly to the context (not on the app) need to be considered)
        final ThemeList themeList = context.getThemeList();
        Optional<String> themesUid = themeList.getThemeDescriptorsUid();
        if (themesUid.isPresent()) {
          keyBuilder.append(":").append(themesUid.get());
        }

        // 2) TODONM: If a theme uses a map-provider it will affect the css key too. Current idea is to cache a "pre-themed"
        // version of the CSS (but still ordered and concatenated). Until this is addressed map-providers shouldn't be
        // used. Another idea is to defer cache to fileforce, etc... once a map-provider is involved. (actually right now
        // we are skipping the cache, but when we stop doing that then this needs to be addressed

        final String key = keyBuilder.toString();
        context.setPreloading(true);

        String cached = context.getDefRegistry().getCachedString(uid, appDesc, key);
        boolean skipCache = themeList.hasDynamicVars(); // for now, skip caching css with dynamic var overrides

        if (cached == null || skipCache) {
            Collection<StyleDef> orderedStyleDefs = filterAndLoad(StyleDef.class, dependencies, null);
            StringBuffer sb = new StringBuffer();
            Aura.getSerializationService().writeCollection(orderedStyleDefs, StyleDef.class, sb, "CSS");
View Full Code Here

Examples of org.auraframework.css.ThemeList

                    json.writeMapEntry("cmp", String.format("%s:%s", appDesc.getNamespace(), appDesc.getName()));
                }
            }

            if (ctx.getSerializeThemes()) {
                ThemeList themes = ctx.getThemeList();
                if (!themes.isEmpty()) {
                    List<String> stringed = Lists.newArrayList();
                    for (DefDescriptor<ThemeDef> theme : themes) {
                        stringed.add(theme.getQualifiedName());
                    }
                    json.writeMapEntry("themes", stringed);
                }

                Optional<String> dynamicVarsUid = themes.getActiveDynamicVarsUid();
                if (dynamicVarsUid.isPresent()) {
                    json.writeMapEntry("dynamicVarsUid", dynamicVarsUid.get());
                }
            }
View Full Code Here

Examples of org.auraframework.css.ThemeList

        AuraContext ctx = Aura.getContextService().startContext(Mode.UTEST, Format.JSON,
                Authentication.UNAUTHENTICATED, app);

        ctx.addAppThemeDescriptors();

        ThemeList descriptors = ctx.getThemeList();
        assertEquals(1, descriptors.size());
        assertEquals(t, descriptors.get(0));
    }
View Full Code Here

Examples of org.auraframework.css.ThemeList

        DefDescriptor<ThemeDef> t3 = addSourceAutoCleanup(ThemeDef.class, "<aura:theme/>");
        ctx.appendThemeDescriptor(t1);
        ctx.appendThemeDescriptor(t2);
        ctx.appendThemeDescriptor(t3);

        ThemeList explicit = ctx.getThemeList();
        assertEquals(explicit.get(0), t1);
        assertEquals(explicit.get(1), t2);
        assertEquals(explicit.get(2), t3);
    }
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.