private Control createConfigurationBlock(Composite parent) {
    Composite composite = ControlFactory.createComposite(parent, 1);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    Button checkboxFormat =
        addCheckBox(
            composite,
            PreferencesMessages.SaveActionsPreferencePage_formatSourceCode,
            FORMAT_SOURCE_CODE,
            0);
    Composite group = createRadioContainer(composite);
    fRadioFormatAllLines =
        addRadioButton(
            group, PreferencesMessages.SaveActionsPreferencePage_formatAllLines, null, 0);
    fRadioFormatEditedLines =
        addRadioButton(
            group,
            PreferencesMessages.SaveActionsPreferencePage_formatEditedLines,
            REMOVE_TRAILING_WHITESPACE_LIMIT_TO_EDITED_LINES,
            0);
    createDependency(checkboxFormat, FORMAT_SOURCE_CODE, fRadioFormatAllLines);
    createDependency(checkboxFormat, FORMAT_SOURCE_CODE, fRadioFormatEditedLines);

    ControlFactory.createEmptySpace(composite, 1);

    Button checkboxTrailingWhitespace =
        addCheckBox(
            composite,
            PreferencesMessages.SaveActionsPreferencePage_removeTrailingWhitespace,
            REMOVE_TRAILING_WHITESPACE,
            0);
    group = createRadioContainer(composite);
    fRadioTrailingWhitespaceAllLines =
        addRadioButton(group, PreferencesMessages.SaveActionsPreferencePage_inAllLines, null, 0);
    fRadioTrailingWhitespaceEditedLines =
        addRadioButton(
            group,
            PreferencesMessages.SaveActionsPreferencePage_inEditedLines,
            REMOVE_TRAILING_WHITESPACE_LIMIT_TO_EDITED_LINES,
            0);
    createDependency(
        checkboxTrailingWhitespace, REMOVE_TRAILING_WHITESPACE, fRadioTrailingWhitespaceAllLines);
    createDependency(
        checkboxTrailingWhitespace,
        REMOVE_TRAILING_WHITESPACE,
        fRadioTrailingWhitespaceEditedLines);

    ControlFactory.createEmptySpace(composite, 1);

    addCheckBox(
        composite,
        PreferencesMessages.SaveActionsPreferencePage_ensureNewline,
        ENSURE_NEWLINE_AT_EOF,
        0);

    return composite;
  }
Example #2
0
  @Override
  public void createControl(Composite parent) {
    Composite composite = ControlFactory.createComposite(parent, 1);
    setControl(composite);

    MakeUIPlugin.getDefault()
        .getWorkbench()
        .getHelpSystem()
        .setHelp(getControl(), IMakeHelpContextIds.MAKE_BUILDER_SETTINGS);

    if (fBuildInfo == null) {
      ControlFactory.createEmptySpace(composite);
      ControlFactory.createLabel(
          composite,
          MakeUIPlugin.getResourceString(
              "SettingsBlock.label.missingBuilderInformation")); //$NON-NLS-1$
      return;
    }

    createBuildCmdControls(composite);
    createSettingControls(composite);
    createWorkBenchBuildControls(composite);

    if (getContainer().getProject() != null) {
      createBuilderWorkingDirControls(composite);
    }
  }