/*******************************************************************************
 * 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;

/**
 * @author Sven Efftinge - Initial contribution and API
 * @since 2.1
 */
public class OutputConfigurationProvider implements IOutputConfigurationProvider {

	/**
	 * @return a set of {@link OutputConfiguration} available for the generator
	 */
	public Set<OutputConfiguration> getOutputConfigurations() {
		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);
		return newHashSet(defaultOutput);
	}
}

@@ -579,16 +579,53 @@
 l.Set;%0A%0A
+import com.google.inject.Singleton;%0A%0A
 /**%0A * @
@@ -694,16 +694,27 @@
 2.1%0A */%0A
+@Singleton%0A
 public c
@@ -787,16 +787,72 @@
 ovider %7B
+%0A%09private Set%3COutputConfiguration%3E outputConfigurations;
 %0A%0A%09/**%0A%09
@@ -993,16 +993,95 @@
 ons() %7B%0A
+%09%09if (outputConfigurations == null) %7B%0A%09%09%09outputConfigurations = newHashSet();%0A%09
 %09%09Output
@@ -1167,24 +1167,25 @@
 _OUTPUT);%0A%09%09
+%09
 defaultOutpu
@@ -1215,24 +1215,25 @@
 t Folder%22);%0A
+%09
 %09%09defaultOut
@@ -1269,16 +1269,17 @@
 -gen%22);%0A
+%09
 %09%09defaul
@@ -1316,32 +1316,33 @@
 ources(true);%0A%09%09
+%09
 defaultOutput.se
@@ -1363,32 +1363,33 @@
 irectory(true);%0A
+%09
 %09%09defaultOutput.
@@ -1424,16 +1424,17 @@
 rue);%0A%09%09
+%09
 defaultO
@@ -1474,40 +1474,250 @@
 ;%0A%09%09
-return newHashSet(defaultOutput)
+%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
 ;%0A%09%7D

allow overwriting default output configuration