Bug 408921 - User defined themes are always registered with "unknown" name
Summary: User defined themes are always registered with "unknown" name
Status: RESOLVED WONTFIX
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2013-05-24 02:11 EDT by Yury CLA
Modified: 2014-12-09 07:21 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yury CLA 2013-05-24 02:11:39 EDT
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.
Comment 1 Ivan Furnadjiev CLA 2013-05-27 06:26:38 EDT
The "name" attribute in org.eclipse.rap.ui.themes extension is not use at all - see WorkbenchApplicationConfigurator#registerThemes.
Comment 2 Yury CLA 2013-05-27 06:37:40 EDT
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?
Comment 3 Ivan Furnadjiev CLA 2013-05-27 06:56:22 EDT
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.
Comment 4 Ivan Furnadjiev CLA 2014-11-24 05:40:36 EST
We should consider it for RAP 3.0.
Comment 5 Ralf Sternberg CLA 2014-12-09 07:21:50 EST
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.