Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to set BusinessTheme programatically?
How to set BusinessTheme programatically? [message #1764554] Wed, 31 May 2017 08:13 Go to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 61
Registered: July 2009
Hi there,

I am currently starting my RWT application using Eclipse (Launch Configuration -> RWT -> EntryPoint) and everthing seems to work fine. If possible I would like to stay with this setup as long as possible and avoid OSGI etc as my app is small and all the complexity doesn't seem to be worth it.

Is there any way to set a theme (in this case BusinessTheme) programatically, when just using the EntryPoint?

Thank you in advance, Clemens

PS: I tried to set the BusinessTheme using the ExtensionPoint mechanism and launch it as RAP application, but I get multiple errors:

1. at launch: Validation: Missing Constraint: Import-Package: org.eclipse.rap.rwt.internal.lifecycle (no copy&paste from the error window)

2. in console:
Command-line arguments:  -dev file:/home/ce/workspace-rap2/.metadata/.plugins/org.eclipse.pde.core/New_configuration/ -os linux -ws gtk -arch x86_64 -consoleLog -console -data /home/ce/workspace-rap2/.metadata/.plugins/

!ENTRY org.eclipse.rap.rwt.osgi 4 0 2017-05-31 10:12:34.753
!MESSAGE Unable to start RWT application.
java.lang.RuntimeException: org.eclipse.equinox.http.servlet.internal.error.PatternInUseException: Pattern already in use: /rwt-resources
	at org.eclipse.rap.rwt.osgi.internal.ApplicationReferenceImpl.registerResourceDirectory(

Caused by: org.eclipse.equinox.http.servlet.internal.error.PatternInUseException: Pattern already in use: /rwt-resources
	at org.eclipse.equinox.http.servlet.internal.HttpServiceRuntimeImpl.registerHttpServiceResources(

Re: How to set BusinessTheme programatically? [message #1764629 is a reply to message #1764554] Wed, 31 May 2017 23:27 Go to previous message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
I don't think you can launch an as a RAP Application an also use programmatic configuration.
Try launching as an RWT application using an ApplicationConfiguration

The configuration class will let you set your entrypoint and give you the opportunity to add themes using org.eclipse.rap.rwt.application.Application.addStyleSheet(String, String, ResourceLoader)
This is how the Workbench adds the themes configured using extension points. You'll need to use the theme bundle's classloader as the ResourceLoader, or do something like that the Workbench does in org.eclipse.rap.ui.internal.servlet.WorkbenchApplicationConfiguration.registerThemes(Application)
Previous Topic:Open SWT.Shell and make display sleep
Next Topic:RAP Supplemental repos not supported by Tycho 1.0
Goto Forum:

Current Time: Mon Dec 06 23:08:41 GMT 2021

Powered by FUDForum. Page generated in 0.01735 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top