Using Eclipse application model persisted state to specify the SWT stylebits

With Eclipse Luna M6 and M7 we introduced the possibility to set the stylebits for user interface controls via persisted state data. Use “styleOverride” as key and the integer value for the SWT stylebits you want to use.

For example to create a SWT shell which cannot be resized you need to supply the integer value for SWT.SHELL_TRIM & (~SWT.RESIZE), which is 1024 on the MWindow application element.

styleOverride

If your MPartStack should render its tab below the parts, use 1024.

This results in the following application (in which the window cannot be resized).

styleOverrideresult

About Lars Vogel

Lars Vogel is the founder and CEO of the vogella GmbH and works as Eclipse and Android consultant, trainer and book author. He is a regular speaker at international conferences, With more than one million visitors per month his website vogella.com is one of the central sources for Eclipse and Android programming information.
This entry was posted in Eclipse, Java, Lars Vogel and tagged , . Bookmark the permalink.

2 Responses to Using Eclipse application model persisted state to specify the SWT stylebits

  1. Marco Descher says:

    Thats nice!

    Lars, with the new vertical extension point, we could maybe have an additional tab, which is only active in the SWT implementation that will document all these “hidden” features more openly to the user!

    I know that you are against renderer dependent code parts, but I would see this more and more as a very good extension! :)

  2. S├ębastien Ollier says:

    The extension is actually nice. thank you for this information

Comments are closed.