<commit_before>package org.lamport.tla.toolbox.ui.handler;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.lamport.tla.toolbox.Activator;
import org.lamport.tla.toolbox.spec.Spec;
import org.lamport.tla.toolbox.ui.perspective.InitialPerspective;
import org.lamport.tla.toolbox.util.UIHelper;

/**
 * Closes the specification and switches the UI back to the initial perspective
 *
 * @author zambrovski
 */
public class CloseSpecHandler extends AbstractHandler implements IHandler
{

    public Object execute(ExecutionEvent event) throws ExecutionException
    {
        Spec currentSpec =  Activator.getSpecManager().getSpecLoaded();
        
        String[] openedResources = UIHelper.getOpenedResources();
        if (currentSpec != null) 
        {
            currentSpec.setOpenedModules(openedResources);
        }
        UIHelper.getActivePage().closeAllEditors(true);
        UIHelper.switchPerspective(InitialPerspective.ID);
        Activator.getSpecManager().setSpecLoaded(null);
        return null;
    }

}
<commit_msg>storage of opened editors removed<commit_after>package org.lamport.tla.toolbox.ui.handler;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.lamport.tla.toolbox.Activator;
import org.lamport.tla.toolbox.ui.perspective.InitialPerspective;
import org.lamport.tla.toolbox.util.UIHelper;

/**
 * Closes the specification and switches the UI back to the initial perspective
 *
 * @author zambrovski
 */
public class CloseSpecHandler extends AbstractHandler implements IHandler
{

    public Object execute(ExecutionEvent event) throws ExecutionException
    {
        UIHelper.getActivePage().closeAllEditors(true);
        UIHelper.switchPerspective(InitialPerspective.ID);
        Activator.getSpecManager().setSpecLoaded(null);
        return null;
    }

}

{'fraction_non_alphanumeric': 0.08986175115207373, 'fraction_numerical': 0.0, 'mean_word_length': 3.6991341991341993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4370849', 'n_tokens_mistral': 617, 'n_tokens_neox': 608, 'n_words': 112}