예제 #1
0
  @Override
  public void performDefaults() {
    // Missing builder info
    if (fBuildInfo == null) {
      return;
    }
    IMakeBuilderInfo info;
    if (getContainer().getProject() != null) {
      info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, false);
    } else {
      info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, true);
    }
    if (info.isStopOnError()) stopOnErrorButton.setSelection(true);
    else stopOnErrorButton.setSelection(false);
    if (info.getBuildCommand() != null) {
      StringBuffer cmd = new StringBuffer(info.getBuildCommand().toOSString());
      if (!info.isDefaultBuildCmd()) {
        String args = info.getBuildArguments();
        if (args != null && !args.equals("")) { // $NON-NLS-1$
          cmd.append(" "); // $NON-NLS-1$
          cmd.append(args);
        }
      }
      buildCommand.setText(cmd.toString());
    }
    if (info.isDefaultBuildCmd()) {
      buildCommand.setEnabled(false);
      argumentVariablesButton.setEnabled(false);
      stopOnErrorButton.setEnabled(true);
    } else {
      buildCommand.setEnabled(true);
      argumentVariablesButton.setEnabled(true);
      stopOnErrorButton.setEnabled(false);
    }

    defButton.setSelection(info.isDefaultBuildCmd());

    autoButton.setSelection(info.isAutoBuildEnable());
    autoVariableButton.setEnabled(info.isAutoBuildEnable());
    targetAuto.setEnabled(info.isAutoBuildEnable());
    targetAuto.setText(info.getAutoBuildTarget());
    incrButton.setSelection(info.isIncrementalBuildEnabled());
    incrVariableButton.setEnabled(info.isIncrementalBuildEnabled());
    targetIncr.setText(info.getIncrementalBuildTarget());
    targetIncr.setEnabled(info.isIncrementalBuildEnabled());
    cleanButton.setSelection(info.isCleanBuildEnabled());
    cleanVariableButton.setEnabled(info.isCleanBuildEnabled());
    targetClean.setText(info.getCleanBuildTarget());
    targetClean.setEnabled(info.isCleanBuildEnabled());
  }
예제 #2
0
  protected void createWorkBenchBuildControls(Composite parent) {
    SelectionAdapter selectionAdapter =
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            targetAuto.setEnabled(autoButton.getSelection());
            autoVariableButton.setEnabled(autoButton.getSelection());
            targetIncr.setEnabled(incrButton.getSelection());
            incrVariableButton.setEnabled(incrButton.getSelection());
            targetClean.setEnabled(cleanButton.getSelection());
            cleanVariableButton.setEnabled(cleanButton.getSelection());
            getContainer().updateContainer();
          }
        };
    Group group =
        ControlFactory.createGroup(
            parent, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_GROUP), 1);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    layout.makeColumnsEqualWidth = false;
    group.setLayout(layout);
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Label label = new Label(group, SWT.NONE);
    label.setText(MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_TYPE));
    label = new Label(group, SWT.NONE);
    label.setText(MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_TARGET));
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 2;
    label.setLayoutData(gd);
    autoButton =
        ControlFactory.createCheckBox(
            group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_AUTO));
    autoButton.addSelectionListener(selectionAdapter);
    autoButton.setSelection(fBuildInfo.isAutoBuildEnable());
    targetAuto = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
    targetAuto.setText(
        fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, "")); // $NON-NLS-1$
    ((GridData) (targetAuto.getLayoutData())).horizontalAlignment = GridData.FILL;
    ((GridData) (targetAuto.getLayoutData())).grabExcessHorizontalSpace = true;
    addControlAccessibleListener(
        targetAuto, MakeUIPlugin.getResourceString(MAKE_BUILD_AUTO_TARGET));
    autoVariableButton = addVariablesButton(group, targetAuto);
    String noteTitle =
        MakeUIPlugin.getResourceString("SettingsBlock.makeWorkbench.note"); // $NON-NLS-1$
    String noteMessage =
        MakeUIPlugin.getResourceString(
            "SettingsBlock.makeWorkbench.autobuildMessage"); //$NON-NLS-1$
    Composite noteControl =
        createNoteComposite(JFaceResources.getDialogFont(), group, noteTitle, noteMessage);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 3;
    noteControl.setLayoutData(gd);
    incrButton =
        ControlFactory.createCheckBox(
            group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_INCR));
    incrButton.addSelectionListener(selectionAdapter);
    incrButton.setSelection(fBuildInfo.isIncrementalBuildEnabled());
    targetIncr = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
    targetIncr.setText(
        fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, "")); // $NON-NLS-1$
    ((GridData) (targetIncr.getLayoutData())).horizontalAlignment = GridData.FILL;
    ((GridData) (targetIncr.getLayoutData())).grabExcessHorizontalSpace = true;
    addControlAccessibleListener(
        targetIncr, MakeUIPlugin.getResourceString(MAKE_BUILD_INCREMENTAL_TARGET));
    incrVariableButton = addVariablesButton(group, targetIncr);
    cleanButton =
        ControlFactory.createCheckBox(
            group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_CLEAN));
    cleanButton.addSelectionListener(selectionAdapter);
    cleanButton.setSelection(fBuildInfo.isCleanBuildEnabled());
    targetClean = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
    targetClean.setText(
        fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, "")); // $NON-NLS-1$
    ((GridData) (targetClean.getLayoutData())).horizontalAlignment = GridData.FILL;
    ((GridData) (targetClean.getLayoutData())).grabExcessHorizontalSpace = true;
    addControlAccessibleListener(
        targetClean, MakeUIPlugin.getResourceString(MAKE_BUILD_CLEAN_TARGET));
    cleanVariableButton = addVariablesButton(group, targetClean);
    selectionAdapter.widgetSelected(null);
  }