title: JFace resizing only the last group in a TitleAreaDialog
body: <p>the program attached below creates a TitleAreaDialog with four groups in them. Each of the groups contain controls and the last one is "dynamic", i.e. when selecting an entry in the combo box, a certain number of controls is generated.</p>
  
  <p>Now, fortunately, the dialog re-sizes automatically -- but I'd like to have more control over the resize. As it is right now, the dialog size is "distributed" evenly between the groups. What I would like to accomplish is to <em>only</em> enlarge (or shrink) the last group, even if the user resizes the dialog with the mouse. The size (height) of the three static groups should remain fixed.</p>
  
  <p>Is there a way to achieve this?
  TIA!</p>
  
  <pre><code>public class DialogExample extends ApplicationWindow {
      class MyDialog extends TitleAreaDialog {
          MyDialog(Shell shell) {
              super(shell);
              setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE);
          }
  
          private Composite createComposite(Composite parent) {
              Composite c = new Composite(parent, SWT.NONE);
              GridLayout layout = new GridLayout(1, false);
              layout.horizontalSpacing = 10;
              c.setLayout(layout);
              c.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
              return c;
          }
  
          private Group createGroup(Composite parent, String title) {
              Group newGroup = new Group(parent, SWT.NONE);
              newGroup.setText(title);
              newGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
              GridLayout layout = new GridLayout();
              newGroup.setLayout(layout);          
              return newGroup;
          }
  
          private Group createGroup(Composite parent, int controlCount) {
              Group newGroup = createGroup(parent, "Group " + controlCount);
              for (int i = 0; i &lt; controlCount; i++) {
                  Label l = new Label(newGroup, SWT.NONE);
                  l.setText("Label " + (i + 1));
              }          
              return newGroup;
          }
  
          private Group createControlGroup(final Composite parent) {          
              final Group newGroup = createGroup(parent, "Control Group");
              final Combo combo = new Combo(newGroup, SWT.READ_ONLY);
              combo.add("1");
              combo.add("2");
              combo.add("3");
              combo.addSelectionListener(new SelectionListener() {
                    @Override
                    public void widgetSelected(SelectionEvent event) {
                        for (Control c: newGroup.getChildren()) {
                             if (c != combo) {
                                  c.dispose();
                             }
                        }
                        for (int i = 0; i &lt;combo.getSelectionIndex() + 1; i++) {
                            Label l = new Label(newGroup, SWT.None);
                            l.setText("Dynamic Label " + (i + 1));
                        }
                        parent.getShell().pack();
                    }
  
                    @Override
                    public void widgetDefaultSelected(SelectionEvent arg0) {
                    }
              });
          return newGroup;
       }
  
       public void create() {
          super.create();
          setTitle("Title");
          setMessage("Message");
       }
  
       protected Control createDialogArea(Composite parent) {
          Composite main = createComposite(parent);
          createGroup(main, 1);
          createGroup(main, 2);
          createGroup(main, 3);     
          createControlGroup(main);
          return main;
        }
      }
  
      public DialogExample() 
      {
        super(null);
      }
  
      public void run() {
        setBlockOnOpen(true);
        open();
        Display.getCurrent().dispose();
      }
  
      protected Control createContents(Composite parent) {
        Label label = new Label(parent, SWT.CENTER);
        label.setText("Dialog example");
        TitleAreaDialog dialog = new MyDialog(parent.getShell());
  
        dialog.open();
        return label;
      }
  
      public static void main(String... args) {
        new DialogExample().run();
      }
  }
  </code></pre>