<commit_before>package de.ptb.epics.eve.editor;

import java.io.File;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

import de.ptb.epics.eve.data.measuringstation.MeasuringStation;
import de.ptb.epics.eve.data.measuringstation.processors.MeasuringStationLoader;

/**
 * The activator class controls the plug-in life cycle
 */
public class Activator extends AbstractUIPlugin {

	// The plug-in ID
	public static final String PLUGIN_ID = "de.ptb.epics.eve.editor";

	// The shared instance
	private static Activator plugin;
	
	private MeasuringStation measuringStation;
	
	/**
	 * The constructor
	 */
	public Activator() {
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start( final BundleContext context ) throws Exception {
		super.start( context );
		plugin = this;
		
		final String measuringStationDescrition = this.getPreferenceStore().getString( PreferenceConstants.P_DEFAULT_MEASURING_STATION_DESCRIPTION );
		final File measuringStationDescriptionFile = new File( measuringStationDescrition );
		final MeasuringStationLoader measuringStationLoader = new MeasuringStationLoader();
		measuringStationLoader.load( measuringStationDescriptionFile );
		this.measuringStation = measuringStationLoader.getMeasuringStation();
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop( final BundleContext context ) throws Exception {
		plugin = null;
		super.stop( context );
	}

	/**
	 * Returns the shared instance
	 *<commit_msg>- Fixed the problem that the plugin was not startable if no measuring station was loaded.<commit_after>package de.ptb.epics.eve.editor;

import java.io.File;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

import de.ptb.epics.eve.data.measuringstation.MeasuringStation;
import de.ptb.epics.eve.data.measuringstation.processors.MeasuringStationLoader;

/**
 * The activator class controls the plug-in life cycle
 */
public class Activator extends AbstractUIPlugin {

	// The plug-in ID
	public static final String PLUGIN_ID = "de.ptb.epics.eve.editor";

	// The shared instance
	private static Activator plugin;
	
	private MeasuringStation measuringStation;
	
	/**
	 * The constructor
	 */
	public Activator() {
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start( final BundleContext context ) throws Exception {
		super.start( context );
		plugin = this;
		
		
		final String measuringStationDescrition = this.getPreferenceStore().getString( PreferenceConstants.P_DEFAULT_MEASURING_STATION_DESCRIPTION );
		if( !measuringStationDescrition.equals( "" ) ) {
			final File measuringStationDescriptionFile = new File( measuringStationDescrition );
			final MeasuringStationLoader measuringStationLoader = new MeasuringStationLoader();
			measuringStationLoader.load( measuringStationDescriptionFile );
			this.measuringStation = measuringStationLoader.getMeasuringStation();
		}
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop( final BundleContext context ) throws Exception {
		plugin = null;
		super.stop( context );
	}

	/**
	 * Returns the shared instance
	 *
{'fraction_non_alphanumeric': 0.09724663151728179, 'fraction_numerical': 0.0, 'mean_word_length': 4.701168614357262, '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': '3006047', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1003, 'n_words': 221}