コード例 #1
0
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IconAndMessageDialog#createMessageArea(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createMessageArea(Composite parent) {
    initializeDialogUnits(parent);

    Composite messageComposite = new Composite(parent, SWT.NONE);
    messageComposite.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    messageComposite.setLayout(layout);
    messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    createLinkControl(messageComposite);

    int indent = convertWidthInCharsToPixels(3);

    fNotSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fNotSortAllRadio.getSelectionButton(null), indent);

    fSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fSortAllRadio.getSelectionButton(null), indent);

    final Composite warningComposite = new Composite(messageComposite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    warningComposite.setLayout(layout);
    warningComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    warningComposite.setFont(messageComposite.getFont());

    Image image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    final Label imageLabel1 = new Label(warningComposite, SWT.LEFT | SWT.WRAP);
    imageLabel1.setImage(image);
    imageLabel1.setLayoutData(
        new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));

    final Label label = new Label(warningComposite, SWT.WRAP);
    label.setText(DialogsMessages.SortMembersMessageDialog_sort_warning_label);
    GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1);
    gridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(gridData);
    label.setFont(warningComposite.getFont());

    fNotSortAllRadio.setDialogFieldListener(
        new IDialogFieldListener() {
          public void dialogFieldChanged(DialogField field) {
            imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
            label.setEnabled(!fNotSortAllRadio.isSelected());
          }
        });
    imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
    label.setEnabled(!fNotSortAllRadio.isSelected());

    return messageComposite;
  }
コード例 #2
0
  @Override
  protected Control createContents(Composite parent) {
    setShell(parent.getShell());

    fPixelConverter = new PixelConverter(parent);
    int indent = fPixelConverter.convertWidthInCharsToPixels(4);

    fBlockControl = new Composite(parent, SWT.NONE);
    fBlockControl.setFont(parent.getFont());

    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;

    fBlockControl.setLayout(layout);

    DialogField[] fields =
        fAptEnabledField != null
            ? new DialogField[] {
              fAptEnabledField, fReconcileEnabledField, fGenSrcDirField, fProcessorOptionsField,
            }
            : new DialogField[] {
              fReconcileEnabledField, fGenSrcDirField, fProcessorOptionsField,
            };
    LayoutUtil.doDefaultLayout(fBlockControl, fields, true, SWT.DEFAULT, SWT.DEFAULT);
    LayoutUtil.setHorizontalGrabbing(fProcessorOptionsField.getListControl(null));

    GridData reconcileGD =
        (GridData) fReconcileEnabledField.getSelectionButton(parent).getLayoutData();
    reconcileGD.horizontalIndent = indent;
    fReconcileEnabledField.getSelectionButton(parent).setLayoutData(reconcileGD);

    Label description = new Label(fBlockControl, SWT.WRAP);
    description.setText(Messages.AptConfigurationBlock_classpathAddedAutomaticallyNote);
    GridData gdLabel = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gdLabel.horizontalSpan = 2;
    gdLabel.widthHint = fPixelConverter.convertWidthInCharsToPixels(60);
    description.setLayoutData(gdLabel);

    Dialog.applyDialogFont(fBlockControl);

    validateSettings(null, null, null);

    return fBlockControl;
  }