Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to change the style of the main application window shell(set custom style of the workbench window shell in eclipse 4)
How to change the style of the main application window shell [message #1219476] Wed, 04 December 2013 05:20 Go to next message
Divya garg is currently offline Divya gargFriend
Messages: 8
Registered: November 2013
Junior Member
Hello,

I am migrating my application from eclipse 3.x to eclipse 4.3 and I want to set the style of the main application window i.e. the shell that is created in application MTrimmedWindow in e4.

Earlier we were doing it using

IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(0, 0));
configurer.setShowCoolBar(false);
configurer.setShowStatusLine(false);
configurer.setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE);

But now in e4 application after reading some forum replies I got to know that custom renderer needs to be created for that.
I created my own renderer extending WBWRenderer and as I wanted to change the style of shell I am overriding createWidget method.
Now the problem is that if I am just creating a new shell in this createWidget method then it is not working. Might be because this method has a lot of other code also.
So I copied all this code into my overridden method of createWidget & just changed the style of shell according to my need. Then this worked but for this I have to put some private methods also into my custom renderer class from WBWRenderer.
SO my question is to confirm that if I am doing it in a right way?
or is there any other mechanism to do this in a more efficient way?

Thanks



Re: How to change the style of the main application window shell [message #1469069 is a reply to message #1219476] Tue, 11 November 2014 09:21 Go to previous message
Stefan Zugal is currently offline Stefan ZugalFriend
Messages: 2
Registered: October 2014
Junior Member
A bit late, but still: I had the same problem in 4.3 - I also saw no other choice but to extend the WBWRenderer. In 4.4 it is possible to adapt the shell style by doing someting along these lines (at least working in my case):

MWindow window = /*get window model*/
window.getPersistedState().put(IPresentationEngine.STYLE_OVERRIDE_KEY, String.valueOf(SWT.TOOL));
Previous Topic:Future of adt + gradle
Next Topic:Exception Workbench has not been created yet
Goto Forum:
  


Current Time: Thu Nov 27 18:49:52 GMT 2014

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

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