<commit_before>/*******************************************************************************
 * Copyright (c) 2011 Red Hat, Inc.
 *  All rights reserved.
 * This program is 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
 *
 * Contributors:
 * Red Hat, Inc. - initial API and implementation
 *
 * @author <NAME>
 ******************************************************************************/

package org.eclipse.bpmn2.modeler.core.runtime;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map.Entry;

import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.di.BpmnDiPackage;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;

/**
 * @author <NAME>
 *
 */
public class ModelEnablementDescriptor extends BaseRuntimeDescriptor {

	private Hashtable<String, HashSet<String>> classes = new Hashtable<String, HashSet<String>>();
	
	// require a TargetRuntime!
	private ModelEnablementDescriptor() {
	}
	
	public ModelEnablementDescriptor(TargetRuntime rt) {
		super(rt);
		setEnabledAll(true);
	}

	private void setEnabledAll(boolean enabled) {
		if (enabled) {
			Bpmn2Package i = Bpmn2Package.eINSTANCE;
			setEnabled(getSubClasses(i.getFlowElement()), true);
			setEnabled(getSubClasses(i.getDataAssociation()), true);
			setEnabled(getSubClasses(i.getRootElement()), true);
			setEnabled(getSubClasses(i.getEventDefinition()), true);
			setEnabled(getSubClasses(i.getLoopCharacteristics()), true);
			setEnabled(getSubClasses(i.getExpression()), true);
<<<<<<< HEAD
			setEnabled(i.getDefinitions(), true);
=======
>>>>>>> e599c5400a96417341377f0733275c921a766e14
			setEnabled(i.getOperation(), true);
			setEnabled(i.getLane(), true);
			setEnabled(i.getEscalation(), true);
			setEnabled(i.getPotentialOwner(), true);
			setEnabled(i.getResourceAssignmentExpression(), true);
			setEnabled(i.getInputSet(), true);
			setEnabled(i.getOutputSet(), true);
			setEnabled(i.getAssignment(), true);
			setEnabled(i.getAssociation(), true);
			setEnabled(i.getTextAnnotation(), true);
			setEnabled(i.getMessageFlow(), true);
			setEnabled(i.getConversationLink(), true);
			setEnabled(i.getGroup(), true);
			setEnabled(i.getConversation(), true);
		}
		else {
			classes.clear();
		}
	}
	
	private void setEnabled(List<EClass> eClasses, boolean enabled) {
		for (EClass c : eClasses) {<commit_msg>more modelenablement changes<commit_after>/*******************************************************************************
 * Copyright (c) 2011 Red Hat, Inc.
 *  All rights reserved.
 * This program is 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
 *
 * Contributors:
 * Red Hat, Inc. - initial API and implementation
 *
 * @author <NAME>
 ******************************************************************************/

package org.eclipse.bpmn2.modeler.core.runtime;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map.Entry;

import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.di.BpmnDiPackage;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;

/**
 * @author <NAME>
 *
 */
public class ModelEnablementDescriptor extends BaseRuntimeDescriptor {

	private Hashtable<String, HashSet<String>> classes = new Hashtable<String, HashSet<String>>();
	
	// require a TargetRuntime!
	private ModelEnablementDescriptor() {
	}
	
	public ModelEnablementDescriptor(TargetRuntime rt) {
		super(rt);
		setEnabledAll(true);
	}

	private void setEnabledAll(boolean enabled) {
		if (enabled) {
			Bpmn2Package i = Bpmn2Package.eINSTANCE;
			setEnabled(getSubClasses(i.getFlowElement()), true);
			setEnabled(getSubClasses(i.getDataAssociation()), true);
			setEnabled(getSubClasses(i.getRootElement()), true);
			setEnabled(getSubClasses(i.getEventDefinition()), true);
			setEnabled(getSubClasses(i.getLoopCharacteristics()), true);
			setEnabled(getSubClasses(i.getExpression()), true);
			setEnabled(i.getDefinitions(), true);
			setEnabled(i.getOperation(), true);
			setEnabled(i.getLane(), true);
			setEnabled(i.getEscalation(), true);
			setEnabled(i.getPotentialOwner(), true);
			setEnabled(i.getResourceAssignmentExpression(), true);
			setEnabled(i.getInputSet(), true);
			setEnabled(i.getOutputSet(), true);
			setEnabled(i.getAssignment(), true);
			setEnabled(i.getAssociation(), true);
			setEnabled(i.getTextAnnotation(), true);
			setEnabled(i.getMessageFlow(), true);
			setEnabled(i.getConversationLink(), true);
			setEnabled(i.getGroup(), true);
			setEnabled(i.getConversation(), true);
		}
		else {
			classes.clear();
		}
	}
	
	private void setEnabled(List<EClass> eClasses, boolean enabled) {
		for (EClass c : eClasses) {
{'fraction_non_alphanumeric': 0.18345782474038988, 'fraction_numerical': 0.011113135361632356, 'mean_word_length': 5.646489104116223, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, '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': '3115807', 'n_tokens_mistral': 1850, 'n_tokens_neox': 1679, 'n_words': 328}