Bug 438513 - [Themes] Theme is unset in Preferences
Summary: [Themes] Theme is unset in Preferences
Status: NEW
Alias: None
Product: EPP
Classification: Technology
Component: modeling-package (show other bugs)
Version: 4.4.0   Edit
Hardware: PC Windows NT
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-30 02:49 EDT by Vincenzo Caselli CLA
Modified: 2014-10-14 06:39 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincenzo Caselli CLA 2014-06-30 02:49:00 EDT
After download, unzip and run of latest Luna Modeling R release, theme is empty in Preferences (field is unset).
Moreover the Default theme is missing, so maybe it is trying to set this, which doesn't exists.

Here my setup details:

Windows 8.1 64bit

Eclipse Modeling Tools

Version: Luna Release (4.4.0)
Build id: 20140612-0600
Comment 1 Toshihiro Izumi CLA 2014-07-08 09:20:16 EDT
It was intentionally introduced in
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/bundles/org.eclipse.ui.themes/plugin.xml?id=a1e01a7f4b54aab0539c1bde9029a302075349a1

org.eclipse.platform(or product configuration plugin)/plugin.xml has a cssTheme property for the default theme
          <property
                name="cssTheme"
                value="org.eclipse.e4.ui.css.theme.e4_default">
          </property>
and the value "org.eclipse.e4.ui.css.theme.e4_default" was matching to Windows XP Blue theme.
Former(org.eclipse.platform/plugin.xml@Kepler4.3.2):
            <theme
                  basestylesheeturi="css/e4_default_winxp_blu.css"
                  id="org.eclipse.e4.ui.css.theme.e4_default"
                  label="%theme.winxpBlue"
                  os="win32">
      </theme>
However, now, it matches only when os_version="6.1"(Windows 7).
Current(org.eclipse.ui.themes/plugin.xml@Luna4.4):
      <theme
            basestylesheeturi="css/e4_default_win7.css"
            id="org.eclipse.e4.ui.css.theme.e4_default"
            label="%theme.win7"
            os="win32"
            os_version="6.1">
      </theme>
      <theme
            basestylesheeturi="css/e4_default_winxp_blu.css"
            id="org.eclipse.e4.ui.css.theme.e4_default.xpblu"
            label="%theme.winxpBlue"
            os="win32">
      </theme>
      ...
Thus no theme is applied by default other than Windows 7.

This Glorious New Design Of Eclipse is not EPP/modeling-package specific.
Same in eclipse-platform-4.4-win32-x86_64, eclipse-SDK-4.4-win32-x86_64, eclipse-jee-luna-R-win32-x86_64, eclipse-php-luna-R-win32-x86_64.
Comment 2 Matthieu Wipliez CLA 2014-07-23 11:46:28 EDT
The problem I see is that as a result, Eclipse 4.4 now looks kind of like Eclipse 2.x, which in my opinion was quite ugly by today's standards. And I'm not sure the first thing users will do is go explore where they can change the theme to something nice. My guess is that they will think 'man that interface looks old' (honestly my first thought when seeing that was more like 'what the hell happened to my build?')

It seems that this bug belongs to the UI category/component. And I would raise its priority if I could :-)
Comment 3 Matthieu Wipliez CLA 2014-09-25 05:11:40 EDT
Any news/plans to fix this? Any workaround? The majority of desktop users is still using Windows as far as I know, so this matters.
Comment 4 Matthieu Wipliez CLA 2014-10-14 06:39:30 EDT
I ended up writing the following code as a workaround:

// set default theme for Windows 8 (otherwise the product looks ugly)
ServiceReference<IThemeManager> reference;
reference = context.getServiceReference(IThemeManager.class);
try {
  IThemeManager manager = context.getService(reference);
  Display display = PlatformUI.getWorkbench().getDisplay();
  IThemeEngine engine = manager.getEngineForDisplay(display);
  ITheme themeActive = engine.getActiveTheme();
  if (themeActive == null) {
    if (Platform.OS_WIN32.equals(Platform.getOS())) {
      final String versionWin7 = "6.1";
      String osVersion = System.getProperty("os.version");
      if (osVersion != null && osVersion.compareTo(versionWin7) > 0) {
        // if OS is more recent than Windows 7, make theme API use Windows 7 theme
        System.setProperty("os.version", versionWin7);
      }

      // set default theme
      engine.setTheme("org.eclipse.e4.ui.css.theme.e4_default", true);
    }
  }
} finally {
  context.ungetService(reference);
}