Skip to content

Conversation

@gonzalad
Copy link
Contributor

Showcase included in viewconfig webapp.

Sample usage

Theme initialization :

@Singleton
@Startup
public class MyAppStartupConfig {

    @Inject
    private ThemeConfig themeConfig;

    @PostConstruct
    public void onLoad() {
        themeConfig.setAvailableThemes(new String[]{"blue", "red", "black"});
    }
}

Theme usage :

#{theme.borderColor}

Theme selection :

<h:selectOneMenu value="#{themeSelector.theme}">
    <f:selectItems value="#{themeSelector.themes}"/>
</h:selectOneMenu>
<h:commandButton action="#{themeSelector.select}" id="themeSelector" value="OK"/>

Showcase included in viewconfig webapp.

 * initializing themes : create a startup Singleton bean, inject ThemeConfig and set availableThemes field.
  * theme key / values : property files (same name as the availableThemes properties).
   * to use a theme in a JSF file, just use {theme.key}

 see http://docs.jboss.org/seam/2.2.2.Final/reference/en-US/html/i18n.html#d0e14307
@lincolnthree
Copy link
Member

Hey, all these pull requests you submitted look pretty deep/big features. Do you have some test cases for this stuff that you could add?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants