Skip to main content


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 messageGo to next message
Stefan Zugal is currently offline Stefan ZugalFriend
Messages: 7
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));
Re: How to change the style of the main application window shell [message #1703051 is a reply to message #1469069] Tue, 28 July 2015 10:38 Go to previous message
Marco Descher is currently offline Marco DescherFriend
Messages: 194
Registered: October 2010
Location: Austria
Senior Member
This can now be solved with a specific "persisted state" key flag, as documented in https://bugs.eclipse.org/bugs/show_bug.cgi?id=386951 . For example to realize a NO_TRIM window, add the key/value styleOverride/8, where 8 is the value if you get the numeric of

int val = SWT.NO_TRIM;
System.out.println(val);

Hey Zugi: Liebe Grüsse! Master UIBK/2010 Wink
Previous Topic:Binding Context Shortcut is not visible
Next Topic:E4View & ESelectionService.setSelection
Goto Forum:
  


Current Time: Fri Mar 29 05:23:39 GMT 2024

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

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

Back to the top