1 | package de.uka.ipd.sdq.simulation.preferences; |
2 | |
3 | import org.apache.log4j.Logger; |
4 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; |
5 | import org.eclipse.core.runtime.preferences.DefaultScope; |
6 | import org.eclipse.core.runtime.preferences.IEclipsePreferences; |
7 | |
8 | import de.uka.ipd.sdq.simulation.Activator; |
9 | |
10 | /** |
11 | * Initialises the preferences for {@link SimulationPreferencePage}. |
12 | * |
13 | * @author Philipp Merkle |
14 | * |
15 | */ |
16 | public class SimulationPreferenceInitialiser extends AbstractPreferenceInitializer { |
17 | |
18 | private static final Logger logger = Logger.getLogger(SimulationPreferenceInitialiser.class); |
19 | |
20 | @Override |
21 | public void initializeDefaultPreferences() { |
22 | // retrieve all available simulation engines and set the first engine as default. |
23 | String firstEngineId = SimulationPreferencesHelper.getDefaultEngineId(); |
24 | |
25 | // set the default simulation engine |
26 | IEclipsePreferences preferences = new DefaultScope().getNode(Activator.PLUGIN_ID); |
27 | preferences.put(SimulationPreferencePage.PREFERENCE_SIMULATION_ENGINE_ID, firstEngineId); |
28 | } |
29 | |
30 | } |