Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Dialog with a fixed size?
Dialog with a fixed size? [message #1511966] Mon, 15 December 2014 10:23 Go to next message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
Hello,

I successfully created a dialog with the E4 application model including a MPart but as I see its size can be changed by the user which is not what I need in this concrete case. How can I say that the size of the dialog should be immutable?

Thanks,
Guenther
Re: Dialog with a fixed size? [message #1580250 is a reply to message #1511966] Fri, 23 January 2015 11:30 Go to previous messageGo to next message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
I now answer to my own question as I found out how it goes:

I created a custom renderer by copying the WBWRenderer to a new class and let it extend SWTPartRenderer. I also had to add init(context) at the beginning of the init()-method so that the images could be found. Then I adapted the createWidget(MUIElement element, Object parent) method to my specific needs. Meaning that where the syle variables are set (in the else-branch) I exchanged

int style = SWT.TITLE | SWT.RESIZE | SWT.MAX | SWT.CLOSE | rtlStyle;

by

int style = SWT.TITLE | SWT.APPLICATION_MODAL | SWT.CLOSE | rtlStyle;

in order to make it a fixed-size and modal dialog.

To let the new renderer be called, I went to the dialog definition (NOT the part definition) in the Application model . In the dialog definition on the Supplementary page I added under "Persisted State":

Key: Custom Renderer
Value: bundleclass://<bundle>/<package. rendererclass>.

That's it.

Regards,
Günther
Re: Dialog with a fixed size? [message #1580257 is a reply to message #1511966] Fri, 23 January 2015 11:32 Go to previous messageGo to next message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
I now answer to my own question as I found out how it goes:

I created a custom renderer by copying the WBWRenderer to a new class and let it extend SWTPartRenderer. I also had to add init(context) at the beginning of the init()-method so that the images could be found. Then I adapted the createWidget(MUIElement element, Object parent) method to my specific needs. Meaning that where the syle variables are set (in the else-branch) I exchanged

int style = SWT.TITLE | SWT.RESIZE | SWT.MAX | SWT.CLOSE | rtlStyle;

by

int style = SWT.TITLE | SWT.APPLICATION_MODAL | SWT.CLOSE | rtlStyle;

in order to make it a fixed-size and modal dialog.

To let the new renderer be called, I went to the dialog definition (NOT the part definition) in the Application model . In the dialog definition on the Supplementary page I added under "Persisted State":

Key: Custom Renderer
Value: bundleclass://<bundle>/<package. rendererclass>.

That's it.

Regards,
Günther
Re: Dialog with a fixed size? [message #1580258 is a reply to message #1511966] Fri, 23 January 2015 11:33 Go to previous message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
I now answer to my own question as I found out how it goes:

I created a custom renderer by copying the WBWRenderer to a new class and let it extend SWTPartRenderer. I also had to add init(context) at the beginning of the init()-method so that the images could be found. Then I adapted the createWidget(MUIElement element, Object parent) method to my specific needs. Meaning that where the syle variables are set (in the else-branch) I exchanged

int style = SWT.TITLE | SWT.RESIZE | SWT.MAX | SWT.CLOSE | rtlStyle;

by

int style = SWT.TITLE | SWT.APPLICATION_MODAL | SWT.CLOSE | rtlStyle;

in order to make it a fixed-size and modal dialog.

To let the new renderer be called, I went to the dialog definition (NOT the part definition) in the Application model . In the dialog definition on the Supplementary page I added under "Persisted State":

Key: Custom Renderer
Value: bundleclass://<bundle>/<package. rendererclass>.

That's it.

Regards,
Günther
Previous Topic:Broken Link to Download Eclipse E4 0.17
Next Topic:A lot of elements kept in UISynchronizer.pendingStartup attribute
Goto Forum:
  


Current Time: Wed Apr 24 21:19:04 GMT 2024

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

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

Back to the top