示例#1
0
    public void configurationRemoved(ICConfigurationDescription cfg) {
      if (cfg.getProjectDescription() != CProjectDescription.this)
        throw new IllegalArgumentException();

      if (!cfg.getId().equals(getId())) return;

      fIsCfgModified = true;
      fCfg = null;
      getConfiguration();
    }
示例#2
0
    public void setConfiguration(ICConfigurationDescription cfg) {
      if (cfg.getProjectDescription() != CProjectDescription.this)
        throw new IllegalArgumentException();

      if (cfg.getId().equals(getId())) return;

      fCfg = cfg;
      fId = cfg.getId();
      fIsCfgModified = true;
      fNeedsPersistance = true;
    }
  @Override
  public void activate() {
    ICConfigurationDescription config = resolveSelectedConfiguration();

    if (config != null) {
      ICProjectDescription desc = config.getProjectDescription();

      if (desc.getActiveConfiguration() != config) {
        try {
          IProject project = desc.getProject();
          desc.setActiveConfiguration(config);
          CoreModel.getDefault().setProjectDescription(project, desc);
        } catch (CoreException e) {
          CUIPlugin.log(e);
        }
      }
    }
  }
  private void doOK() {
    ICConfigurationDescription confdesc = getConfdesc();
    if (confdesc != null) {
      saveAllSelections(confdesc);
      IProject project = confdesc.getProjectDescription().getProject();

      Helpers.setTheEnvironmentVariables(project, confdesc, false);

      try {
        Helpers.addArduinoCodeToProject(project, confdesc);
      } catch (CoreException e1) {
        Common.log(
            new Status(
                IStatus.ERROR, Const.CORE_PLUGIN_ID, Messages.error_adding_arduino_code, e1));
      }
      Helpers.removeInvalidIncludeFolders(confdesc);
      Helpers.setDirtyFlag(project, confdesc);
    }
  }