<commit_before>package org.openbel.workbench.ui;

import static java.lang.System.getenv;
import static java.lang.Thread.yield;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.openbel.workbench.core.common.BELUtilities.noItems;
import static org.openbel.workbench.core.common.BELUtilities.noLength;
import static org.openbel.workbench.core.common.BELUtilities.typedList;
import static org.openbel.workbench.ui.UIFunctions.denotesFile;
import static org.openbel.workbench.ui.UIFunctions.denotesFolder;
import static org.openbel.workbench.ui.UIFunctions.denotesProject;
import static org.openbel.workbench.ui.UIFunctions.isBuilder;
import static org.openbel.workbench.ui.UIFunctions.isSystemConfiguration;
import static org.openbel.workbench.ui.UIFunctions.logError;
import static org.openbel.workbench.ui.UIFunctions.runAsync;
import static org.openbel.workbench.ui.util.ValidationUtilities.validateFramework;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.eclipse.core.internal.resources.Project;
import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.dltk.ui.DLTKUIPlugin;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.openbel.workbench.core.Nature;
import org.openbel.workbench.core.index.Resource;
import org.openbel.workbench.core.index.ResourceIndex;
import org.openbel.workbench.ui.text.BELTextTools;
import org.openbel.workbench.ui.util.ValidationUtilities.FileState;
import org.osgi.framework.BundleContext;

/**
 * The activator class controls the plug-in life cycle.
 */
public class Activator extends DLTKUIPlugin {
    public static final String ENV_BELFRAMEWORK_HOME;
    private static Activator plugin;
    /** The plug-in identifier: {@value} */
    public static final String PLUGIN_ID = "org.openbel.workbench.ui";
    /** {@value} */
    public static final String BF_PREF_KEY = "bel_framework_home_pref";
    /** {@value} */
    public static final String CY_PREF_KEY = "cytoscape_pref";
    private static IWorkbench workbench;
    /** Initialize a single {@link ResourceLoader} instance. */
    private static final ResourceLoader resourceLoader;
    static {
        String s = getenv("BELFRAMEWORK_HOME");
        ENV_BELFRAMEWORK_HOME = s == null ? "" : s;
        resourceLoader = new ResourceLoader();
    }
    private BELTextTools fBELTextTools;
    private Listener listener;

    private ResourceIndex resourceIndex;
    private Map<Resource, List<String>> resourceCatalog;
    private List<String> selectedProjects;

    /**
     * Returns the configured BEL framework home.
     * 
     * @return String; may be null
     */
    public String getBELFrameworkHome() {
        return getPreferenceStore().getString(BF_PREF_KEY);
    }

    /**
     * Returns the configured Cytoscape home.
     * 
     * @return String; may be null
     */
    public String getCytoscapeHome() {
        return getPreferenceStore().getString(CY_PREF_KEY);
    }

    /**
     * Returns the {@link Shell shell} associated with the workbench's active
     * window.
     * 
     * @return {@link Shell}; may be null
     */
    public Shell getShell() {<commit_msg>Test repository trigger<commit_after>package org.openbel.workbench.ui;

import static java.lang.System.getenv;
import static java.lang.Thread.yield;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.openbel.workbench.core.common.BELUtilities.noItems;
import static org.openbel.workbench.core.common.BELUtilities.noLength;
import static org.openbel.workbench.core.common.BELUtilities.typedList;
import static org.openbel.workbench.ui.UIFunctions.denotesFile;
import static org.openbel.workbench.ui.UIFunctions.denotesFolder;
import static org.openbel.workbench.ui.UIFunctions.denotesProject;
import static org.openbel.workbench.ui.UIFunctions.isBuilder;
import static org.openbel.workbench.ui.UIFunctions.isSystemConfiguration;
import static org.openbel.workbench.ui.UIFunctions.logError;
import static org.openbel.workbench.ui.UIFunctions.runAsync;
import static org.openbel.workbench.ui.util.ValidationUtilities.validateFramework;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.eclipse.core.internal.resources.Project;
import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.dltk.ui.DLTKUIPlugin;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.openbel.workbench.core.Nature;
import org.openbel.workbench.core.index.Resource;
import org.openbel.workbench.core.index.ResourceIndex;
import org.openbel.workbench.ui.text.BELTextTools;
import org.openbel.workbench.ui.util.ValidationUtilities.FileState;
import org.osgi.framework.BundleContext;

/**
 * The activator class controls the plug-in life cycle.
 */
public class Activator extends DLTKUIPlugin {
    public static final String ENV_BELFRAMEWORK_HOME;
    private static Activator plugin;
    /** The plug-in identifier: {@value} */
    public static final String PLUGIN_ID = "org.openbel.workbench.ui";
    /** {@value} */
    public static final String BF_PREF_KEY = "bel_framework_home_pref";
    /** {@value} */
    public static final String CY_PREF_KEY = "cytoscape_pref";
    private static IWorkbench workbench;
    /** Initialize a single {@link ResourceLoader} instance. */
    private static final ResourceLoader resourceLoader;
    static {
        String s = getenv("BELFRAMEWORK_HOME");
        ENV_BELFRAMEWORK_HOME = s == null ? "" : s;
        resourceLoader = new ResourceLoader();
    }
    private BELTextTools fBELTextTools;
    private Listener listener;

    private ResourceIndex resourceIndex;
    private Map<Resource, List<String>> resourceCatalog;
    private List<String> selectedProjects;

    // Python saves.

    /**
     * Returns the configured BEL framework home.
     * 
     * @return String; may be null
     */
    public String getBELFrameworkHome() {
        return getPreferenceStore().getString(BF_PREF_KEY);
    }

    /**
     * Returns the configured Cytoscape home.
     * 
     * @return String; may be null
     */
    public String getCytoscapeHome() {
        return getPreferenceStore().getString(CY_PREF_KEY);
    }

    /**
     * Returns the {@link Shell shell} associated with the workbench's active
     * window.
     * 
     * @return {@link Shell}; may be null
     */
    public Shell getShell() {
{'fraction_non_alphanumeric': 0.10102576335877862, 'fraction_numerical': 0.0, 'mean_word_length': 4.473237597911227, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5832353', 'n_tokens_mistral': 2502, 'n_tokens_neox': 2516, 'n_words': 516}