Community
Participate
Working Groups
Extension org.eclipse.rap.ui.themes has the attribute 'name', but if you create and add your custom theme - it will be registered with "unknown" name (see org.eclipse.rap.rwt.internal.application.ApplicationImpl): public void addStyleSheet( String themeId, String styleSheetLocation, ResourceLoader resourceLoader ) { ParamCheck.notNull( themeId, "themeId" ); ParamCheck.notNull( styleSheetLocation, "styleSheetLocation" ); ParamCheck.notNull( resourceLoader, "resourceLoader" ); StyleSheet styleSheet = readStyleSheet( styleSheetLocation, resourceLoader ); ThemeManager themeManager = applicationContext.getThemeManager(); Theme theme = themeManager.getTheme( themeId ); if( theme != null ) { theme.addStyleSheet( styleSheet ); } else { themeManager.registerTheme( new Theme( themeId, "unknown", styleSheet ) ); } } Think the name attribute defined by user must be passed here to create theme with it.
The "name" attribute in org.eclipse.rap.ui.themes extension is not use at all - see WorkbenchApplicationConfigurator#registerThemes.
I see, but what is the purpose to have an attribute name in theme extension defined in org.eclipse.rap.ui/schema/themes.exsd in this case? Why this attribute is not used now?
This attribute is leftover from the times before the Application/ApplicationConfiguration were introduced (RAP <1.5). We have to decide - keep it and change the signature of Application#addStyleSheet or remove it as not used anymore. But as method Theme#getName (name field) is not used in any code (only in test) I'm voting for removal together with Theme#name field.
We should consider it for RAP 3.0.
The name attribute is currently ignored. There doesn't seem to be a good reason to add it to the addStyleSheet() method now. Neither is there a need to remove it from the existing extension point (with the potential to break existing extensions). The extension point documentation states that the name attribute is currently not used. If we ever use the name in the future, we'll add a 'name' parameter to the API.