@Override public List<String> getFlavorNames(String themePageName) { if (pageReg != null) { PageDescriptor themePage = pageReg.getPage(themePageName); if (themePage != null) { List<String> flavors = new ArrayList<String>(); List<String> localFlavors = themePage.getFlavors(); if (localFlavors != null) { flavors.addAll(localFlavors); } // add flavors from theme for all pages PageDescriptor forAllPage = pageReg.getConfigurationApplyingToAll(); if (forAllPage != null) { localFlavors = forAllPage.getFlavors(); if (localFlavors != null) { flavors.addAll(localFlavors); } } // add default flavor if it's not listed there String defaultFlavor = themePage.getDefaultFlavor(); if (defaultFlavor != null) { if (!flavors.contains(defaultFlavor)) { flavors.add(0, defaultFlavor); } } return flavors; } } return null; }
@Override public String getDefaultFlavorName(String themePageName) { if (pageReg != null) { PageDescriptor themePage = pageReg.getPage(themePageName); if (themePage != null) { return themePage.getDefaultFlavor(); } } return null; }