<commit_before>package gov.nasa.jpl.mgss.mbee.docgen.actions;

import gov.nasa.jpl.logfire.RunnableSessionWrapperWithResult;
import gov.nasa.jpl.mbee.lib.MDUtils;
import gov.nasa.jpl.mbee.lib.Utils;
import gov.nasa.jpl.mgss.mbee.docgen.validation.ConstraintValidationRule;
import gov.nasa.jpl.mgss.mbee.docgen.validation.ValidationRule;
import gov.nasa.jpl.mgss.mbee.docgen.validation.ValidationSuite;
import gov.nasa.jpl.mgss.mbee.docgen.validation.ViolationSeverity;
import gov.nasa.jpl.ocl.OclEvaluator;

import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;

import com.nomagic.magicdraw.actions.MDAction;
import com.nomagic.magicdraw.annotation.Annotation;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element;

public class ValidateConstraints extends MDAction {
    protected List< Element > context = new ArrayList< Element >();

    public static final String actionid = "ValidateConstraints";
    
    public static String actionText = "Validate constraints";
    
    private ConstraintValidationRule constraintRule = new ConstraintValidationRule();//new ValidationRule("Constraint", "Model constraint violation", ViolationSeverity.WARNING);

    private ValidationSuite validationUi = new ValidationSuite("sweet");
    private Collection<ValidationSuite> validationOutput = new ArrayList<ValidationSuite>();

    
    public ValidateConstraints( Element context ) {
        super(actionid, actionText, null, null);
        if ( context != null ) getContext().add( context ); 
        validationUi.addValidationRule(constraintRule);
        //Need Collection to use the utils.DisplayValidationWindow method
        validationOutput.add(validationUi);
      }
      public ValidateConstraints() {
        this(null);
      }

    @Override
    public void actionPerformed( ActionEvent e ) {
        Collection< Element > selectedElements = MDUtils.getSelection( e );
        setContext( selectedElements );
<commit_msg>removed bad import<commit_after>package gov.nasa.jpl.mgss.mbee.docgen.actions;

import gov.nasa.jpl.mbee.lib.MDUtils;
import gov.nasa.jpl.mbee.lib.Utils;
import gov.nasa.jpl.mgss.mbee.docgen.validation.ConstraintValidationRule;
import gov.nasa.jpl.mgss.mbee.docgen.validation.ValidationSuite;
import gov.nasa.jpl.ocl.OclEvaluator;

import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;

import com.nomagic.magicdraw.actions.MDAction;
import com.nomagic.magicdraw.annotation.Annotation;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element;

public class ValidateConstraints extends MDAction {
    /**
     * 
     */
    private static final long serialVersionUID = 2202161655434764023L;

    protected List< Element > context = new ArrayList< Element >();

    public static final String actionid = "ValidateConstraints";
    
    public static String actionText = "Validate constraints";
    
    private ConstraintValidationRule constraintRule = new ConstraintValidationRule();//new ValidationRule("Constraint", "Model constraint violation", ViolationSeverity.WARNING);

    private ValidationSuite validationUi = new ValidationSuite("sweet");
    private Collection<ValidationSuite> validationOutput = new ArrayList<ValidationSuite>();

    
    public ValidateConstraints( Element context ) {
        super(actionid, actionText, null, null);
        if ( context != null ) getContext().add( context ); 
        validationUi.addValidationRule(constraintRule);
        //Need Collection to use the utils.DisplayValidationWindow method
        validationOutput.add(validationUi);
      }
      public ValidateConstraints() {
        this(null);
      }

    @Override
    public void actionPerformed( ActionEvent e ) {
        Collection< Element > selectedElements = MDUtils.getSelection( e );
        setContext( selectedElements );

{'fraction_non_alphanumeric': 0.09640688259109312, 'fraction_numerical': 0.005313765182186235, 'mean_word_length': 4.263648468708388, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3439122', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1109, 'n_words': 234}