Package org.pentaho.platform.api.ui

Examples of org.pentaho.platform.api.ui.IThemeManager


  @Path( "/list" )
  @Produces( { APPLICATION_JSON, APPLICATION_XML } )
  @Facet( name = "Unsupported" )
  public List<Theme> getSystemThemes() {
    ArrayList<Theme> themes = new ArrayList<Theme>();
    IThemeManager themeManager = PentahoSystem.get( IThemeManager.class );
    List<String> ids = themeManager.getSystemThemeIds();
    for ( String id : ids ) {
      org.pentaho.platform.api.ui.Theme theme = themeManager.getSystemTheme( id );
      if ( theme.isHidden() == false ) {
        themes.add( new Theme( id, theme.getName() ) );
      }
    }
    return themes;
View Full Code Here


      activeThemeName = StringUtils.defaultIfEmpty( (String) session.getAttribute( "pentaho-user-activeThemeName" ), settingsService
        .getUserSetting( "pentaho-user-activeThemeName", PentahoSystem.getSystemSetting( "default-activeThemeName", "onyx" ) )
          .getSettingValue() );
    }

    IThemeManager themeManager = PentahoSystem.get( IThemeManager.class, null );
    Theme theme = themeManager.getSystemTheme( activeThemeName );

    final ServletContext servletContext = (ServletContext) PentahoSystem.getApplicationContext().getContext();
    if ( servletContext != null ) {
      for ( ThemeResource res : theme.getResources() ) {
        if ( res.getLocation().endsWith( ".css" ) ) {
View Full Code Here

    StandaloneSession session = new StandaloneSession();
    PentahoSessionHolder.setSession( session );
    PentahoSystem.get( IPluginManager.class ).reload();

    IThemeManager themeManager = PentahoSystem.get( IThemeManager.class );

    assertTrue( themeManager.getSystemThemeIds().contains( "core" ) );
    assertNotNull( themeManager.getModuleThemeInfo( "themeplugin" ) );
    assertEquals( 1, themeManager.getModuleThemeInfo( "themeplugin" ).getSystemThemes().size() );
    Set<ThemeResource> resources =
        themeManager.getModuleThemeInfo( "themeplugin" ).getSystemThemes().get( 0 ).getResources();
    assertEquals( 3, resources.size() );

    assertNotNull( themeManager.getModuleThemeInfo( "test-module" ) );
    assertEquals( 1, themeManager.getModuleThemeInfo( "test-module" ).getSystemThemes().size() );
    resources = themeManager.getModuleThemeInfo( "test-module" ).getSystemThemes().get( 0 ).getResources();
    assertEquals( 3, resources.size() );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.ui.IThemeManager

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.