@Override
  protected Control createDialogArea(Composite parent) {
    final Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    composite.setLayout(gridLayout);

    setTitle(UIText.RebaseInteractiveHandler_EditMessageDialogTitle);
    setMessage(UIText.RebaseInteractiveHandler_EditMessageDialogText);

    messageArea = new SpellcheckableMessageArea(composite, commitMessage);
    messageArea.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
    Point size = messageArea.getTextWidget().getSize();
    int minHeight = messageArea.getTextWidget().getLineHeight() * 3;
    messageArea.setLayoutData(
        GridDataFactory.fillDefaults()
            .grab(true, true)
            .hint(size)
            .minSize(size.x, minHeight)
            .align(SWT.FILL, SWT.FILL)
            .create());
    messageArea.setFocus();

    return composite;
  }
Esempio n. 2
0
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    parent.getShell().setText(UIText.CommitDialog_CommitChanges);

    container = toolkit.createComposite(container);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
    toolkit.paintBordersFor(container);
    GridLayoutFactory.swtDefaults().applyTo(container);

    final SashForm sashForm = new SashForm(container, SWT.VERTICAL | SWT.FILL);
    toolkit.adapt(sashForm, true, true);
    sashForm.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    createMessageAndPersonArea(sashForm);
    filesSection = createFileSection(sashForm);
    sashForm.setWeights(new int[] {50, 50});

    applyDialogFont(container);
    container.pack();
    commitText.setFocus();
    Image titleImage = UIIcons.WIZBAN_CONNECT_REPO.createImage();
    UIUtils.hookDisposal(parent, titleImage);
    setTitleImage(titleImage);
    setTitle(UIText.CommitDialog_Title);
    setMessage(UIText.CommitDialog_Message, IMessageProvider.INFORMATION);

    filesViewer.addCheckStateListener(
        new ICheckStateListener() {

          public void checkStateChanged(CheckStateChangedEvent event) {
            updateMessage();
          }
        });

    updateFileSectionText();
    return container;
  }