@Override
  public void apply() throws ConfigurationException {
    if (myChangelistNameFormat.getText().trim().isEmpty()) {
      throw new ConfigurationException(TaskBundle.message("settings.change.list.name.format.should.not.be.empty"));
    }
    if (myBranchNameFormat.getText().trim().isEmpty()) {
      throw new ConfigurationException(TaskBundle.message("settings.Branch.name.format.should.not.be.empty"));
    }
    boolean oldUpdateEnabled = getConfig().updateEnabled;
    super.apply();
    TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = myAlwaysDisplayTaskCombo.isSelected();
    int oldConnectionTimeout = TaskSettings.getInstance().CONNECTION_TIMEOUT;
    int connectionTimeout = Integer.parseInt(myConnectionTimeout.getText());
    TaskSettings.getInstance().CONNECTION_TIMEOUT = connectionTimeout;
    TaskSettings.getInstance().LOWER_CASE_BRANCH = myLowerCase.isSelected();
    TaskSettings.getInstance().REPLACE_SPACES = myReplaceSpaces.getText();

    if (myProject.isDefault()) return;
    TaskManager manager = TaskManager.getManager(myProject);
    if (getConfig().updateEnabled && !oldUpdateEnabled) {
      manager.updateIssues(null);
    }
    if (connectionTimeout != oldConnectionTimeout) {
      for (TaskRepository repository : manager.getAllRepositories()) {
        if (repository instanceof BaseRepositoryImpl) {
          ((BaseRepositoryImpl)repository).reconfigureClient();
        }
      }
    }
  }
@Override
  public void apply()