[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.albireo] Re: Size-Calculation of Embedded Swing Controls in Dialogs

I think the base problem here has to do with the fact that the preferred size of the Swing component is not yet known when the dialog decides on its own initial size. (It's not yet known because size calculations involve waiting for the AWT event dispatch thread to run. We defer actual layout of the SWT composite until this has happened, but this is a case where just a size computation is done, and it probably can't be deferred.)

One solution for you would be to override your TitleAreaDialog's getInitialSize() method and return a reasonable value that does not rely on waiting for the Swing component's preferred size to be known.

If that won't work, you could try to find a way to resize the dialog once the Swing control's preferred size has been calculated. I'm not sure how easy that would be.

Dominik Kaspar wrote:
I'm using the following environment:
-albireo standalone 0.0.3 (v20081031)
-java 1.6.0_12 64-Bit (also tested with 32-Bit)
-standalone swt win32 x86 64-Bit 3.4.1 (also tested with 32-Bit)
-standalone jface 3.4.1

I'm expecting:
-the dialog is big enough to display all JTextFields*
-there should be no scroll bar visible*

*as long the dialog is not resized and the screen resolution is not too low;)