/*******************************************************************************
 * Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package org.eclipse.xtext.generator;

import static com.google.common.collect.Sets.*;

import java.util.Set;

import com.google.inject.Singleton;

/**
 * @author Sven Efftinge - Initial contribution and API
 * @since 2.1
 */
@Singleton
public class OutputConfigurationProvider implements IOutputConfigurationProvider {
	private Set<OutputConfiguration> outputConfigurations;

	/**
	 * @return a set of {@link OutputConfiguration} available for the generator
	 */
	public Set<OutputConfiguration> getOutputConfigurations() {
		if (outputConfigurations == null) {
			outputConfigurations = newHashSet();
			OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
			defaultOutput.setDescription("Output Folder");
			defaultOutput.setOutputDirectory("./src-gen");
			defaultOutput.setOverrideExistingResources(true);
			defaultOutput.setCreateOutputDirectory(true);
			defaultOutput.setCleanUpDerivedResources(true);
			defaultOutput.setSetDerivedProperty(true);
			outputConfigurations.add(defaultOutput);
		}
		return outputConfigurations;
	}

	/**
	 * @since 2.5
	 */
	public void setOutputConfigurations(Set<OutputConfiguration> outputConfigurations) {
		this.outputConfigurations = outputConfigurations;
	}
}

@@ -583,45 +583,8 @@
 t;%0A%0A
-import com.google.inject.Singleton;%0A%0A
 /**%0A
@@ -661,19 +661,8 @@
  */%0A
-@Singleton%0A
 publ
@@ -743,64 +743,8 @@
 er %7B
-%0A%09private Set%3COutputConfiguration%3E outputConfigurations;
 %0A%0A%09/
@@ -893,87 +893,8 @@
 ) %7B%0A
-%09%09if (outputConfigurations == null) %7B%0A%09%09%09outputConfigurations = newHashSet();%0A%09
 %09%09Ou
@@ -984,25 +984,24 @@
 _OUTPUT);%0A%09%09
-%09
 defaultOutpu
@@ -1031,25 +1031,24 @@
 t Folder%22);%0A
-%09
 %09%09defaultOut
@@ -1084,17 +1084,16 @@
 -gen%22);%0A
-%09
 %09%09defaul
@@ -1130,33 +1130,32 @@
 ources(true);%0A%09%09
-%09
 defaultOutput.se
@@ -1176,33 +1176,32 @@
 irectory(true);%0A
-%09
 %09%09defaultOutput.
@@ -1236,17 +1236,16 @@
 rue);%0A%09%09
-%09
 defaultO
@@ -1285,250 +1285,40 @@
 ;%0A%09%09
-%09outputConfigurations.add(defaultOutput);%0A%09%09%7D%0A%09%09return outputConfigurations;%0A%09%7D%0A%0A%09/**%0A%09 * @since 2.5%0A%09 */%0A%09public void setOutputConfigurations(Set%3COutputConfiguration%3E outputConfigurations) %7B%0A%09%09this.outputConfigurations = outputConfigurations
+return newHashSet(defaultOutput)
 ;%0A%09%7D

Revert "[generator] allow overwriting default output configuration"