Beispiel #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());
  }
Beispiel #2
0
 protected void createSettingControls(Composite parent) {
   Group group =
       ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_SETTING_GROUP), 1);
   stopOnErrorButton = new Button(group, SWT.CHECK);
   stopOnErrorButton.setText(MakeUIPlugin.getResourceString(MAKE_SETTING_STOP_ERROR));
   if (fBuildInfo.isStopOnError()) {
     stopOnErrorButton.setSelection(true);
   }
   stopOnErrorButton.setEnabled(fBuildInfo.isDefaultBuildCmd());
 }
Beispiel #3
0
  protected void createBuildCmdControls(Composite parent) {
    Group group =
        ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_CMD_GROUP), 1);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    layout.makeColumnsEqualWidth = false;
    group.setLayout(layout);
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    defButton =
        ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_CMD_USE_DEFAULT));
    defButton.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            if (defButton.getSelection() == true) {
              buildCommand.setEnabled(false);
              argumentVariablesButton.setEnabled(false);
              stopOnErrorButton.setEnabled(true);
              getContainer().updateContainer();
            } else {
              buildCommand.setEnabled(true);
              argumentVariablesButton.setEnabled(true);
              stopOnErrorButton.setEnabled(false);
              getContainer().updateContainer();
            }
          }
        });
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 3;
    defButton.setLayoutData(gd);
    Label label = ControlFactory.createLabel(group, MakeUIPlugin.getResourceString(MAKE_CMD_LABEL));
    ((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING;
    ((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false;
    buildCommand = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);

    ((GridData) (buildCommand.getLayoutData())).horizontalAlignment = GridData.FILL;
    ((GridData) (buildCommand.getLayoutData())).grabExcessHorizontalSpace = true;
    buildCommand.addListener(
        SWT.Modify,
        new Listener() {

          public void handleEvent(Event e) {
            getContainer().updateContainer();
          }
        });
    if (fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, null) != null) {
      StringBuffer cmd =
          new StringBuffer(
              fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, "")); // $NON-NLS-1$
      if (!fBuildInfo.isDefaultBuildCmd()) {
        String args =
            fBuildInfo.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, ""); // $NON-NLS-1$
        if (args != null && !args.equals("")) { // $NON-NLS-1$
          cmd.append(" "); // $NON-NLS-1$
          cmd.append(args);
        }
      }
      buildCommand.setText(cmd.toString());
    }
    argumentVariablesButton = addVariablesButton(group, buildCommand);
    if (fBuildInfo.isDefaultBuildCmd()) {
      buildCommand.setEnabled(false);
      argumentVariablesButton.setEnabled(false);
    }
    defButton.setSelection(fBuildInfo.isDefaultBuildCmd());
  }