title: JFace -SWT How to make TitleAreaDialog similaire to Eclipse one
body: <p>I would design TitleAreaDialog similar to those Eclipse but without sucess, below there is two screenshot, Eclipse form and my own form,</p>
  
  <p>i have problem to get the top and bottom separator, if you notice,Eclipse form don't gave a margin and the workspace have margin.</p>
  
  <p>in my own form my separator have a margin </p>
  
  <p><strong>Eclipse Form :</strong>
  <a href="http://farm8.staticflickr.com/7437/9075688435_d5c49770fa_b.jpg" rel="nofollow">http://farm8.staticflickr.com/7437/9075688435_d5c49770fa_b.jpg</a></p>
  
  <p><strong>My own Form</strong>
  <a href="http://farm4.staticflickr.com/3688/9077919366_8c25c40a79_b.jpg" rel="nofollow">http://farm4.staticflickr.com/3688/9077919366_8c25c40a79_b.jpg</a></p>
  
  <p>here is the source code of my class</p>
  
  
  
  <pre><code>public class CompteDialog extends TitleAreaDialog {
  
  private Text idCompteText;
  private Text libelleCompteText;
  private Text ribCompteText;
  private Text agenceCompteText;
  
  public CompteDialog(Shell parentShell) {
      super(parentShell);
  
  }
  
  @Override
  public void create() {
      super.create();
      // Set the title
      setTitle("Fiche comptes");
      // Set the message
      setMessage("Saisissez les informations relatives au compte",
              IMessageProvider.INFORMATION);
  
  }
  
  @Override
  protected Control createDialogArea(Composite parent) {
  
      setTitleImage(ResourceManager.getPluginImage(
              "dz.iaityahia.cieptalcars.matresorerie", "icons/wallet.png"));
  
      GridLayout layout = new GridLayout();
  
      layout.numColumns = 2;
      parent.setLayout(layout);
  
      // Champs ID
      Label idCompteLabel = new Label(parent, SWT.NONE);
      idCompteLabel.setText("Compte ID");
  
      GridData gridData = new GridData(GridData.BEGINNING,
              GridData.BEGINNING, true, false, 1, 1);
  
      idCompteText = new Text(parent, SWT.BORDER);
      idCompteText.setLayoutData(gridData);
      idCompteText.setTextLimit(20);
  
      gridData = new GridData(GridData.FILL, GridData.BEGINNING, true, false,
              1, 1);
  
      // Champs libelle
      Label libelleCompteLabel = new Label(parent, SWT.NONE);
      libelleCompteLabel.setText("Libellé compte");
  
      libelleCompteText = new Text(parent, SWT.BORDER);
      libelleCompteText.setLayoutData(gridData);
  
      // Champs Rib
      Label ribCompteLabel = new Label(parent, SWT.NONE);
      ribCompteLabel.setText("R.I.B");
  
      gridData = new GridData(GridData.FILL, GridData.BEGINNING, true, false,
              1, 1);
  
      ribCompteText = new Text(parent, SWT.BORDER);
      ribCompteText.setLayoutData(gridData);
  
      gridData = new GridData(GridData.FILL, GridData.BEGINNING, true, false,
              1, 1);
      // Champs libelle
      Label agenceCompteLabel = new Label(parent, SWT.NONE);
      agenceCompteLabel.setText("Agence bancaire");
  
      agenceCompteText = new Text(parent, SWT.BORDER);
      agenceCompteText.setLayoutData(gridData);
  
      // Create a bottom separator
      Label line = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
      line.setLayoutData(new GridData(SWT.FILL, SWT.END, true, true, 2, 1));
  
      return parent;
  }
  
  @Override
  protected Control createButtonBar(Composite parent) {
  
      final Composite buttonBar = new Composite(parent, SWT.NONE);
  
      final GridLayout layout = new GridLayout();
      layout.numColumns = 2;
      layout.makeColumnsEqualWidth = false;
      layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
      buttonBar.setLayout(layout);
  
      GridData gridData = new GridData(GridData.FILL, GridData.END, true,
              true, 2, 1);
  
      buttonBar.setLayoutData(gridData);
  
      /*
       * org.eclipse.swt.graphics.Color magenta =
       * Display.getDefault().getSystemColor(SWT.COLOR_MAGENTA);
       * buttonBar.setBackground(magenta);
       */
  
      // Create Add button
      // Own method as we need to overview the SelectionAdapter
  
      createOkButton(buttonBar, OK, "Add", true);
      // Add a SelectionListener
  
      // Create Cancel button
      Button cancelButton = createButton(buttonBar, CANCEL, "Cancel", false);
      // Add a SelectionListener
      cancelButton.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
              setReturnCode(CANCEL);
              close();
          }
      });
      return buttonBar;
  }
  
  protected Button createOkButton(Composite parent, int id, String label,
          boolean defaultButton) {
  
      Button button = new Button(parent, SWT.PUSH);
  
      button.setText(label);
      button.setFont(JFaceResources.getDialogFont());
      button.setData(new Integer(id));
      button.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(SelectionEvent event) {
              if (isValidInput()) {
                  okPressed();
              }
          }
      });
      if (defaultButton) {
          Shell shell = parent.getShell();
          if (shell != null) {
              shell.setDefaultButton(button);
          }
      }
      setButtonLayoutData(button);
      return button;
  }
  
  private boolean isValidInput() {
      boolean valid = true;
      if (idCompteText.getText().length() == 0) {
          setErrorMessage("Veuillez saisir le compte ID");
          valid = false;
      }
      if (libelleCompteText.getText().length() == 0) {
          setErrorMessage("Veuillez saisir le libellé du compte");
          valid = false;
      }
      return valid;
  }
  
  @Override
  protected boolean isResizable() {
      return true;
  }
  }
  </code></pre>
  
  <p>Could someone give me an idea how to get TiteAreaDialog similar to those of Eclipse ?</p>
  
  <p>with my thank's </p>