/*
 * generated by Xtext 2.12.0
 */
package com.irtsaintexupery.xtext.pseim.formatting2

import com.google.inject.Inject
import com.irtsaintexupery.pseim.pseim.CardinalityElement
import com.irtsaintexupery.pseim.pseim.Pattern
import com.irtsaintexupery.pseim.pseim.PatternComponent
import com.irtsaintexupery.pseim.seim.Element
import com.irtsaintexupery.pseim.seim.GraphElement
import com.irtsaintexupery.xtext.pseim.services.PatternGrammarAccess
import org.eclipse.xtext.formatting2.AbstractFormatter2
import org.eclipse.xtext.formatting2.IFormattableDocument

class PatternFormatter extends AbstractFormatter2 {
	
	@Inject extension PatternGrammarAccess

	def dispatch void format(Pattern pattern, extension IFormattableDocument document) {
		// TODO: format HiddenRegions around keywords, attributes, cross references, etc. 
		for (CardinalityElement cardinalityElement : pattern.getCardinalityElements()) {
			cardinalityElement.format;
		}
		for (GraphElement graphElement : pattern.getModelElements()) {
			graphElement.format;
		}
	}

	def dispatch void format(PatternComponent patternComponent, extension IFormattableDocument document) {
		// TODO: format HiddenRegions around keywords, attributes, cross references, etc. 
		for (Element element : patternComponent.getContent()) {
			element.format;
		}
	}
	
	// TODO: implement for 
}
