Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Login Dialog is not CCS styled(Login Dialog is not CCS styled)
Login Dialog is not CCS styled [message #1745269] Fri, 07 October 2016 07:40 Go to next message
Jorge Martin is currently offline Jorge MartinFriend
Messages: 5
Registered: December 2009
Junior Member
Hi,

In the LifeCycle class I have the following:

@ProcessAdditions
void processAdditions(IApplicationContext appContext, IEclipseContext context) {

final Shell shell = new Shell(SWT.INHERIT_NONE);

appContext.applicationRunning();

String cssTheme = "login.theme.login";
context.set(E4Application.THEME_ID, cssTheme);
String cssURI = "css/login.css";
context.set(E4Workbench.CSS_URI_ARG, cssURI);

PartRenderingEngine.initializeStyling(shell.getDisplay(), context);

final LoginDialog dialog = new LoginDialog(shell);
if (dialog.open() != Window.OK) {
System.exit(0);
}
}

But the dialog is not CCS styled. After Application model is initialized I open the dialog from a handler and I see it correctlty styled.

What am I doing wrong?

Thanks in advance,
Re: Login Dialog is not CCS styled [message #1745270 is a reply to message #1745269] Fri, 07 October 2016 07:41 Go to previous messageGo to next message
Jorge Martin is currently offline Jorge MartinFriend
Messages: 5
Registered: December 2009
Junior Member
Sorry I am using Neon
Re: Login Dialog is not CCS styled [message #1745701 is a reply to message #1745270] Fri, 14 October 2016 17:58 Go to previous message
Jorge Martin is currently offline Jorge MartinFriend
Messages: 5
Registered: December 2009
Junior Member
I,ve being debugging and I think that it is a bug.

PartRenderingEngine.initializeStyling static function looks into enableThemePreference boolean to see if it can initialize CCS rendering or not. But this preference is initialized in the initialize() function that is non static, that is done in a PostConstruct annotation.

That seems to avoid styling in a lifecycle function previous to the initialization of the model. A correction of the above would be to initialize this preference also in the PartRenderingEngine.initializeStyling function:

IEclipsePreferences node = InstanceScope.INSTANCE.getNode("org.eclipse.e4.ui.workbench.renderers.swt");
enableThemePreference = node.getBoolean(ENABLED_THEME_KEY, true);

Greetings,
Previous Topic:EHelpService
Next Topic:Provide multiple service implementations via ContextFunction?
Goto Forum:
  


Current Time: Tue Sep 26 11:11:37 GMT 2017

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

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