JsArray<JsTheme> themes = JsTheme.getThemes( JsonUtils.escapeJsonForEval( response.getText() ) );
for ( int i = 0; i < themes.length(); i++ ) {
JsTheme theme = themes.get( i );
PentahoMenuItem themeMenuItem =
new PentahoMenuItem( theme.getName(), new SwitchThemeCommand( theme.getId() ) );
themeMenuItem.getElement().setId( theme.getId() + "_menu_item" ); //$NON-NLS-1$
themeMenuItem.setChecked( theme.getId().equals( activeTheme ) );
( (MenuBar) themesMenu.getManagedObject() ).addItem( themeMenuItem );
}
bf.createBinding( model, "saveEnabled", saveMenuItem, "!disabled" ); //$NON-NLS-1$ //$NON-NLS-2$
bf.createBinding( model, "saveAsEnabled", saveAsMenuItem, "!disabled" ); //$NON-NLS-1$ //$NON-NLS-2$