<commit_before>/*
 * generated by Xtext
 */
package de.cooperateproject.modeling.textual.cls.ui.outline

import de.cooperateproject.modeling.textual.cls.cls.ClassDiagram
import de.cooperateproject.modeling.textual.cls.cls.ClsPackage
import de.cooperateproject.modeling.textual.cls.cls.Connector
import de.cooperateproject.modeling.textual.cls.cls.Package
import de.cooperateproject.modeling.textual.cls.cls.XtextAssociation
import de.cooperateproject.modeling.textual.common.metamodel.textualCommons.Commentable
import de.cooperateproject.modeling.textual.common.metamodel.textualCommons.TextualCommonsPackage
import org.eclipse.xtext.ui.editor.outline.IOutlineNode
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode
import de.cooperateproject.modeling.textual.common.outline.CooperateOutlineTreeProvider
import de.cooperateproject.modeling.textual.common.outline.UMLImage
import de.cooperateproject.modeling.textual.cls.cls.Classifier

/**
 * Customization of the default outline structure.
 * 
 * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#outline
 */
class ClsOutlineTreeProvider extends CooperateOutlineTreeProvider {

	dispatch def createChildren(IOutlineNode parentNode, ClassDiagram root) {
		if (root.rootPackage === null) {
			return
		}
		createNode(parentNode, root.rootPackage)
	}

	dispatch def createChildren(IOutlineNode parentNode, Package pkg) {
		createFeatureNode(parentNode, pkg, TextualCommonsPackage.Literals.PACKAGE_BASE__PACKAGES, UMLImage.PACKAGE.image,
			getStyledString("Packages", pkg.packages.size), false)
		createFeatureNode(parentNode, pkg, TextualCommonsPackage.Literals.PACKAGE_BASE__PACKAGE_IMPORTS,
			UMLImage.PACKAGE_IMPORT.image, getStyledString("Imports", pkg.packageImports.size), false)
		createFeatureNode(parentNode, pkg, ClsPackage.Literals.PACKAGE__CLASSIFIERS, UMLImage.CLASS.image,
			getStyledString("Classifiers", pkg.classifiers.size), false)
		createFeatureNode(parentNode, pkg, ClsPackage.Literals.PACKAGE__CONNECTORS, UMLImage.ASSOCIATION.image,
			getStyledString("Connectors", pkg.connectors.size), false)
	}

	dispatch def createChildren(IOutlineNode parentNode, XtextAssociation asc) {
		asc.memberEndTypes.forEach[t|createEObjectNode(parentNode, t)];
		_createChildren(parentNode, asc as Commentable<?>)
	}
	
	dispatch def createChildren(IOutlineNode parentNode, Classifier classifier) {
		classifier.members.forEach[t|createEObjectNode(parentNode, t)];
		_createChildren(parentNode, classifier as Commentable<?>)
	}
	
	protected def dispatch createNode(EStructuralFeatureNode parentNode, Connector c) {
		createConnectorNode(parentNode, c)
	}
	protected def dispatch createNode(IOutlineNode parentNode, Package element) {<commit_msg>#197 fixed broken cls outline<commit_after>/*
 * generated by Xtext
 */
package de.cooperateproject.modeling.textual.cls.ui.outline

import de.cooperateproject.modeling.textual.cls.cls.ClassDiagram
import de.cooperateproject.modeling.textual.cls.cls.ClsPackage
import de.cooperateproject.modeling.textual.cls.cls.Connector
import de.cooperateproject.modeling.textual.cls.cls.Package
import de.cooperateproject.modeling.textual.cls.cls.XtextAssociation
import de.cooperateproject.modeling.textual.common.metamodel.textualCommons.Commentable
import de.cooperateproject.modeling.textual.common.metamodel.textualCommons.TextualCommonsPackage
import org.eclipse.xtext.ui.editor.outline.IOutlineNode
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode
import de.cooperateproject.modeling.textual.common.outline.CooperateOutlineTreeProvider
import de.cooperateproject.modeling.textual.common.outline.UMLImage
import de.cooperateproject.modeling.textual.cls.cls.Classifier

/**
 * Customization of the default outline structure.
 * 
 * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#outline
 */
class ClsOutlineTreeProvider extends CooperateOutlineTreeProvider {

	dispatch def createChildren(IOutlineNode parentNode, ClassDiagram root) {
	    if (root.rootPackage === null) {
            return
        }
        
        val pkg = root.rootPackage
		createFeatureNode(parentNode, pkg, TextualCommonsPackage.Literals.PACKAGE_BASE__PACKAGES, UMLImage.PACKAGE.image,
			getStyledString("Packages", pkg.packages.size), false)
		createFeatureNode(parentNode, pkg, TextualCommonsPackage.Literals.PACKAGE_BASE__PACKAGE_IMPORTS,
			UMLImage.PACKAGE_IMPORT.image, getStyledString("Imports", pkg.packageImports.size), false)
		createFeatureNode(parentNode, pkg, ClsPackage.Literals.PACKAGE__CLASSIFIERS, UMLImage.CLASS.image,
			getStyledString("Classifiers", pkg.classifiers.size), false)
		createFeatureNode(parentNode, pkg, ClsPackage.Literals.PACKAGE__CONNECTORS, UMLImage.ASSOCIATION.image,
			getStyledString("Connectors", pkg.connectors.size), false)
	}

	dispatch def createChildren(IOutlineNode parentNode, XtextAssociation asc) {
		asc.memberEndTypes.forEach[t|createEObjectNode(parentNode, t)];
		_createChildren(parentNode, asc as Commentable<?>)
	}
	
	dispatch def createChildren(IOutlineNode parentNode, Classifier classifier) {
		classifier.members.forEach[t|createEObjectNode(parentNode, t)];
		_createChildren(parentNode, classifier as Commentable<?>)
	}
	
	protected def dispatch createNode(EStructuralFeatureNode parentNode, Connector c) {
		createConnectorNode(parentNode, c)
	}
	
	protected def dispatch createNode(IOutlineNode parentNode, Package element) {
{'fraction_non_alphanumeric': 0.09254498714652956, 'fraction_numerical': 0.0016525890561880279, 'mean_word_length': 6.682651622002821, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6027786', 'n_tokens_mistral': 1783, 'n_tokens_neox': 1691, 'n_words': 255}