Hi,
I have created an RCP based on my 3.x plug-in.
I have applied CSS styling (based on http://www.slideshare.net/toedter_k/css-styling-for-eclipse-rcp-3x-and-4x) which works correctly when I launch my RCP application from with the Eclipse IDE.
When I export the RCP application and then run it, no CSS styling is applied; all other aspects of the application do however work correctly.
Details of the build and configuration as follows:
1) OS - Windows 7 64bit Professional
2) Eclipse - Juno Service Release 1 Build id: 20121004-1855
3) RCP plugin.xml->build.properties
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
bin/,\
icons/,\
studio.product,\
plugin_customization.ini,\
splash.bmp,\
css/,\
images/
source.. = src/
4) RCP Extension Point fragments:
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product ... >
...
<property
name="cssTheme"
value="com.workflowscience.designer.themeDef">
</property>
<property
name="applicationCSSResources"
value="platform:/plugin/z.studio/images">
</property>
</product>
</extension>
<extension
point="org.eclipse.e4.ui.css.swt.theme">
<theme
basestylesheeturi="css/wfs_default_win7.css"
id="com.workflowscience.designer.themeDef"
label="Windows 7 Custom Theme"
os="win32"
os_version="6.1">
</theme>
</extension>
5) ApplicationWorkbenchAdvisor.java
public void initialize( IWorkbenchConfigurer configurer )
{
super.initialize( configurer );
...
Bundle b = FrameworkUtil.getBundle( getClass() );
BundleContext context = b.getBundleContext();
ServiceReference serviceRef = context.getServiceReference( IThemeManager.class.getName());
IThemeManager themeManager = (IThemeManager) context.getService( serviceRef );
final IThemeEngine engine = themeManager.getEngineForDisplay( Display.getCurrent() );
engine.setTheme( "com.workflowscience.designer.themeDef", true );
}
I have checked the RCP application log file under workspace/.metadata post execution and there are no reported errors.
I included the following log statement in the ApplicationWorkbenchAdvisor class to query the theme directly after setting:
StaticLogger.get().info( "Theme: " + engine.getActiveTheme().getId() );
which logs: "Theme: com.workflowscience.designer.themeDef6.1"
I included the following log statements in the ApplicationWorkbenchAdvisor class to ensure that the css urls could be resolved:
Enumeration e = (Enumeration) b.findEntries( "", "*.css", true );
URL url = null;
URL cssUrl = null;
if ( e != null )
{
while ( e.hasMoreElements() )
{
url = (URL) e.nextElement();
try
{
cssUrl = FileLocator.resolve( url );
}
catch ( IOException e1 )
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
StaticLogger.get().info( "CSS URL: " + url.toString() );
StaticLogger.get().info( "CSS FILE: " + cssUrl != null ? cssUrl.toString() : "null" );
}
}
which shows that all css urls can be resolved to the RCP plugin.
I have found the following forum entries that highlight similar issues and provide suggested resolutions: http://dev.eclipse.org/mhonarc/lists/e4-dev/msg06652.html and http://www.eclipse.org/forums/index.php/m/1034649/?srch=3.x+rcp+theme+css#msg_1034649. I have checked my configuration which seems to be consistent with that suggested.
I am now at a complete loss as to how to further debug and would appreciate any insight as to the likely cause of the problem or any further avenues to explore.
Many thanks
Dan