<commit_before>/***********************************************************************************************************************
 * Copyright (c) 2008 TOPCASED consortium.
 * 
 * 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
 * 
 * Contributors: <NAME> (CS) - initial API and implementation
 * 
 **********************************************************************************************************************/
package org.topcased.requirement.core.wizards.operation;

import java.util.Arrays;
import java.util.List;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.command.AbstractCommand;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.topcased.requirement.RequirementFactory;
import org.topcased.requirement.RequirementProject;
import org.topcased.requirement.core.commands.UpdateMonitorCommand;
import org.topcased.requirement.core.internal.Messages;
import org.topcased.requirement.core.utils.RequirementUtils;
import org.topcased.requirement.util.RequirementResource;

/**
 * 
 * This class provides operation to create an empty requirement model
 * 
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * 
 * @since 2.1.0
 */
public class EmptyRequirementModelOperation extends AbstractRequirementModelOperation
{
    /**
     * The constructor
     * 
     * @param sourceFile
     * @param destFile
     */
    public EmptyRequirementModelOperation(IFile inFile, IFile destFile)
    {
        super(inFile, destFile);
    }

    /**
     * Get commands to create empty requirement model
     * 
     * @see AbstractRequirementModelOperation#getCommands(IProgressMonitor)
     */
    protected List<Command> getCommands(final IProgressMonitor monitor)
    {
        Command startTaskCmd = UpdateMonitorCommand.getCommand(monitor, getLabel(), 4, null, -1);
        Command cmdWS = new AbstractCommand()
        {
            public void redo()
            {
                // Create the empty requirement model
                createEmptyRequirementModel(monitor);
            }

            public void execute()<commit_msg>[#3855] [Requirements SAM] Impossible to create a void .requirement file with SAM<commit_after>/***********************************************************************************************************************
 * Copyright (c) 2008 TOPCASED consortium.
 * 
 * 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
 * 
 * Contributors: <NAME> (CS) - initial API and implementation
 * 
 **********************************************************************************************************************/
package org.topcased.requirement.core.wizards.operation;

import java.util.Arrays;
import java.util.List;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.command.AbstractCommand;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.topcased.requirement.RequirementFactory;
import org.topcased.requirement.RequirementProject;
import org.topcased.requirement.core.commands.UpdateMonitorCommand;
import org.topcased.requirement.core.internal.Messages;
import org.topcased.requirement.core.utils.RequirementUtils;
import org.topcased.requirement.util.RequirementResource;

/**
 * 
 * This class provides operation to create an empty requirement model
 * 
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * 
 * @since 2.1.0
 */
public class EmptyRequirementModelOperation extends AbstractRequirementModelOperation
{
    /**
     * The constructor
     * 
     * @param sourceFile
     * @param destFile
     */
    public EmptyRequirementModelOperation(IFile inFile, IFile destFile)
    {
        super(inFile, destFile);
    }

    /**
     * Get commands to create empty requirement model
     * 
     * @see AbstractRequirementModelOperation#getCommands(IProgressMonitor)
     */
    protected List<Command> getCommands(final IProgressMonitor monitor)
    {
        Command startTaskCmd = UpdateMonitorCommand.getCommand(monitor, getLabel(), 4, null, -1);
        Command cmdWS = new AbstractCommand()
        {
        	protected boolean prepare()
        	{
        		return true;
        	}

            public void redo()
            {
                // Create the empty requirement model
                createEmptyRequirementModel(monitor);
            }

            public void execute()
{'fraction_non_alphanumeric': 0.18078333011769246, 'fraction_numerical': 0.005788153579008296, 'mean_word_length': 3.918406072106262, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '6895396', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1332, 'n_words': 311}