Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » packing a dialog to the correct size
packing a dialog to the correct size [message #631629] Fri, 08 October 2010 09:13 Go to next message
Henno Vermeulen is currently offline Henno VermeulenFriend
Messages: 126
Registered: July 2009
Senior Member
This seems to be a basic question but I couldn't find the right answer on forums.

I am extending TitleAreaDialog and have a Composite as the dialog area which should be packed and the rest of the dialog contents should be packed around it.

I know I can override getInitialSize() and set a fixed size but I fear this size will be incorrect on other platforms than the one I'm using (windows 7).

I already tried adding getShell().setSize(getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT)); to createDialogArea and alternatively overriding getInitialSize to return getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT).

In both cases my dialog gets too large: there is a gray area above the ok button.
Re: packing a dialog to the correct size [message #632728 is a reply to message #631629] Thu, 14 October 2010 05:50 Go to previous message
Animesh Kumar is currently offline Animesh KumarFriend
Messages: 79
Registered: September 2010
Location: Bangalore
Member
why don't you try using grabExcessVerticalSpace and grabExcessHorizontalSpace

You can use the following for your dialog area which you want to be packed:-

GridData data = new GridData();
data.grabExcessVerticalSpace = true;
data.grabExcessHorizontalSpace = true;

For the remaining dialog area

GridData data = new GridData();
data.grabExcessVerticalSpace = false;
data.grabExcessHorizontalSpace = true;



Regards,
Animesh
Previous Topic:ILazyTreeContentProvider: AssertionFailedException after changing model
Next Topic:Cell navigation in a JFace TableViewer
Goto Forum:
  


Current Time: Thu Apr 25 11:45:26 GMT 2024

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

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

Back to the top